diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-10-31 07:20:08 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-10-31 07:20:08 +0000 |
commit | 9d128d04578c62675eeb0cce83066052f9c19c9a (patch) | |
tree | 7f62860538ea93ece0b553f993124da65247d4c8 | |
parent | 718699169a7ccaf623e375031789efeed82f869b (diff) |
[PCH] For ASTReader's FileDeclIDs also associate the Module that the
local DeclIDs came from.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143340 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Serialization/ASTReader.h | 11 | ||||
-rw-r--r-- | lib/Serialization/ASTReader.cpp | 3 |
2 files changed, 12 insertions, 2 deletions
diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h index f9ca9b2758..ecc73c97fc 100644 --- a/include/clang/Serialization/ASTReader.h +++ b/include/clang/Serialization/ASTReader.h @@ -296,8 +296,17 @@ private: /// \brief Declarations that have been replaced in a later file in the chain. DeclReplacementMap ReplacedDecls; + struct FileDeclsInfo { + Module *Mod; + ArrayRef<serialization::LocalDeclID> Decls; + + FileDeclsInfo() : Mod(0) {} + FileDeclsInfo(Module *Mod, ArrayRef<serialization::LocalDeclID> Decls) + : Mod(Mod), Decls(Decls) {} + }; + /// \brief Map from a FileID to the file-level declarations that it contains. - llvm::DenseMap<FileID, ArrayRef<serialization::DeclID> > FileDeclIDs; + llvm::DenseMap<FileID, FileDeclsInfo> FileDeclIDs; // Updates for visible decls can occur for other contexts than just the // TU, and when we read those update records, the actual context will not diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index 8a1ae3da1a..7ae0c42069 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -1139,7 +1139,8 @@ ASTReader::ASTReadResult ASTReader::ReadSLocEntryRecord(int ID) { unsigned NumFileDecls = Record[8]; if (NumFileDecls) { assert(F->FileSortedDecls && "FILE_SORTED_DECLS not encountered yet ?"); - FileDeclIDs[FID] = llvm::makeArrayRef(FirstDecl, NumFileDecls); + FileDeclIDs[FID] = FileDeclsInfo(F, llvm::makeArrayRef(FirstDecl, + NumFileDecls)); } break; |