summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-10-24 17:26:46 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-10-24 17:26:46 +0000
commit3ba70b89cf94c5090aae9962bf633de871c7d32d (patch)
treed75bf3891c1a41c3d441e07e9a365db3e3016894 /clang/lib/Serialization/ASTWriter.cpp
parent97bfda9b9b7d44c1201608c636c3fa838261e7f6 (diff)
downloadbcm5719-llvm-3ba70b89cf94c5090aae9962bf633de871c7d32d.tar.gz
bcm5719-llvm-3ba70b89cf94c5090aae9962bf633de871c7d32d.zip
Introduce a DeclsToRewrite field in ASTWrite, used for collecting the decls that will be replaced in the chained PCH.
llvm-svn: 117238
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriter.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 7636f02bdf0..c6df2dd95d3 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -2410,6 +2410,10 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls,
else
WriteDecl(Context, DOT.getDecl());
}
+ for (DeclsToRewriteTy::iterator
+ I = DeclsToRewrite.begin(), E = DeclsToRewrite.end(); I != E; ++I) {
+ WriteDecl(Context, const_cast<Decl*>(*I));
+ }
Stream.ExitBlock();
WritePreprocessor(PP);
@@ -2720,6 +2724,9 @@ void ASTWriter::WriteDeclUpdatesBlocks() {
const Decl *D = I->first;
UpdateRecord &URec = I->second;
+ if (DeclsToRewrite.count(D))
+ continue; // The decl will be written completely,no need to store updates.
+
uint64_t Offset = Stream.GetCurrentBitNo();
Stream.EmitRecord(DECL_UPDATES, URec);
OpenPOWER on IntegriCloud