forked from OSchip/llvm-project
Introduce a DeclsToRewrite field in ASTWrite, used for collecting the decls that will be replaced in the chained PCH.
llvm-svn: 117238
This commit is contained in:
parent
97bfda9b9b
commit
3ba70b89cf
|
@ -223,6 +223,10 @@ private:
|
||||||
/// to this set, so that we can write out lexical content updates for it.
|
/// to this set, so that we can write out lexical content updates for it.
|
||||||
llvm::SmallPtrSet<const NamespaceDecl *, 16> UpdatedNamespaces;
|
llvm::SmallPtrSet<const NamespaceDecl *, 16> UpdatedNamespaces;
|
||||||
|
|
||||||
|
typedef llvm::SmallPtrSet<const Decl *, 16> DeclsToRewriteTy;
|
||||||
|
/// \brief Decls that will be replaced in the current dependent AST file.
|
||||||
|
DeclsToRewriteTy DeclsToRewrite;
|
||||||
|
|
||||||
/// \brief Decls that have been replaced in the current dependent AST file.
|
/// \brief Decls that have been replaced in the current dependent AST file.
|
||||||
///
|
///
|
||||||
/// When a decl changes fundamentally after being deserialized (this shouldn't
|
/// When a decl changes fundamentally after being deserialized (this shouldn't
|
||||||
|
|
|
@ -2410,6 +2410,10 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls,
|
||||||
else
|
else
|
||||||
WriteDecl(Context, DOT.getDecl());
|
WriteDecl(Context, DOT.getDecl());
|
||||||
}
|
}
|
||||||
|
for (DeclsToRewriteTy::iterator
|
||||||
|
I = DeclsToRewrite.begin(), E = DeclsToRewrite.end(); I != E; ++I) {
|
||||||
|
WriteDecl(Context, const_cast<Decl*>(*I));
|
||||||
|
}
|
||||||
Stream.ExitBlock();
|
Stream.ExitBlock();
|
||||||
|
|
||||||
WritePreprocessor(PP);
|
WritePreprocessor(PP);
|
||||||
|
@ -2720,6 +2724,9 @@ void ASTWriter::WriteDeclUpdatesBlocks() {
|
||||||
const Decl *D = I->first;
|
const Decl *D = I->first;
|
||||||
UpdateRecord &URec = I->second;
|
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();
|
uint64_t Offset = Stream.GetCurrentBitNo();
|
||||||
Stream.EmitRecord(DECL_UPDATES, URec);
|
Stream.EmitRecord(DECL_UPDATES, URec);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue