summaryrefslogtreecommitdiffstats
path: root/include/clang/Serialization
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-06-29 20:46:25 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-06-29 20:46:25 +0000
commit013450120264d4ef3d486856a67866a91e4f56f6 (patch)
tree7707650157b6638211ed830da6dbbed089fdc6bc /include/clang/Serialization
parentdd5dcddd4129abf56d69a0d5b380cc7c31ef07ee (diff)
[modules] Emit the type of the TypeSourceInfo for a DeclaratorDecl (but
not the corresponding location information) earlier. We need the type as written in order to properly merge functions with deduced return types, so we need to load that early. But we don't want to load the location information early, because that contains problematic things such as the function parameters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336016 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Serialization')
-rw-r--r--include/clang/Serialization/ASTReader.h9
-rw-r--r--include/clang/Serialization/ASTWriter.h2
2 files changed, 10 insertions, 1 deletions
diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h
index d09a9f4023..bf9ed38a15 100644
--- a/include/clang/Serialization/ASTReader.h
+++ b/include/clang/Serialization/ASTReader.h
@@ -1771,6 +1771,10 @@ public:
TypeSourceInfo *GetTypeSourceInfo(ModuleFile &F,
const RecordData &Record, unsigned &Idx);
+ /// Raad the type locations for the given TInfo.
+ void ReadTypeLoc(ModuleFile &F, const RecordData &Record, unsigned &Idx,
+ TypeLoc TL);
+
/// Resolve a type ID into a type, potentially building a new
/// type.
QualType GetType(serialization::TypeID ID);
@@ -2460,6 +2464,11 @@ public:
return Reader->GetTypeSourceInfo(*F, Record, Idx);
}
+ /// Reads the location information for a type.
+ void readTypeLoc(TypeLoc TL) {
+ return Reader->ReadTypeLoc(*F, Record, Idx, TL);
+ }
+
/// Map a local type ID within a given AST file to a global type ID.
serialization::TypeID getGlobalTypeID(unsigned LocalID) const {
return Reader->getGlobalTypeID(*F, LocalID);
diff --git a/include/clang/Serialization/ASTWriter.h b/include/clang/Serialization/ASTWriter.h
index 28db00df89..a93579930f 100644
--- a/include/clang/Serialization/ASTWriter.h
+++ b/include/clang/Serialization/ASTWriter.h
@@ -886,7 +886,7 @@ public:
/// Emits a reference to a declarator info.
void AddTypeSourceInfo(TypeSourceInfo *TInfo);
- /// Emits a type with source-location information.
+ /// Emits source location information for a type. Does not emit the type.
void AddTypeLoc(TypeLoc TL);
/// Emits a template argument location info.