/// to this set, so that we can write out lexical content updates for it.
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.
///
/// When a decl changes fundamentally after being deserialized (this shouldn't
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);
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);