[cfe-commits] r143340 - in /cfe/trunk: include/clang/Serialization/ASTReader.h lib/Serialization/ASTReader.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Mon Oct 31 00:20:08 PDT 2011
Author: akirtzidis
Date: Mon Oct 31 02:20:08 2011
New Revision: 143340
URL: http://llvm.org/viewvc/llvm-project?rev=143340&view=rev
Log:
[PCH] For ASTReader's FileDeclIDs also associate the Module that the
local DeclIDs came from.
Modified:
cfe/trunk/include/clang/Serialization/ASTReader.h
cfe/trunk/lib/Serialization/ASTReader.cpp
Modified: cfe/trunk/include/clang/Serialization/ASTReader.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTReader.h?rev=143340&r1=143339&r2=143340&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/ASTReader.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTReader.h Mon Oct 31 02:20:08 2011
@@ -296,8 +296,17 @@
/// \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
Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=143340&r1=143339&r2=143340&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Mon Oct 31 02:20:08 2011
@@ -1139,7 +1139,8 @@
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;
More information about the cfe-commits
mailing list