From ba901b507fc36408fe6f8478e8ac90b554f1d230 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Sun, 24 Oct 2010 17:26:46 +0000 Subject: Introduce a DeclsToRewrite field in ASTWrite, used for collecting the decls that will be replaced in the chained PCH. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117238 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Serialization/ASTWriter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index 7636f02bdf..c6df2dd95d 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/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(*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); -- cgit v1.2.3-18-g5258