From cb28f9d7adfc51225fe1553052608e5a5c0442b6 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 9 Oct 2012 23:05:51 +0000 Subject: Rework the (de-)serialization of macros, as stored in MacroInfo*. Instead of simply dumping an offset into the current file, give each macro definition a proper ID with all of the standard modules-remapping facilities. Additionally, when a macro is modified in a subsequent AST file (e.g., #undef'ing a macro loaded from another module or from a precompiled header), provide a macro update record rather than rewriting the entire macro definition. This gives us greater consistency with the way we handle declarations, and ties together macro definitions much more cleanly. Note that we're still not actually deserializing macro history (we never were), but it's far easy to do properly now. llvm-svn: 165560 --- clang/lib/Frontend/ChainedIncludesSource.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/Frontend/ChainedIncludesSource.cpp') diff --git a/clang/lib/Frontend/ChainedIncludesSource.cpp b/clang/lib/Frontend/ChainedIncludesSource.cpp index dbb06bd23cd..5f7ff74bc6f 100644 --- a/clang/lib/Frontend/ChainedIncludesSource.cpp +++ b/clang/lib/Frontend/ChainedIncludesSource.cpp @@ -108,6 +108,8 @@ ChainedIncludesSource *ChainedIncludesSource::create(CompilerInstance &CI) { OwningPtr consumer; consumer.reset(new PCHGenerator(Clang->getPreprocessor(), "-", 0, /*isysroot=*/"", &OS)); + Clang->getPreprocessor().setPPMutationListener( + consumer->GetPPMutationListener()); Clang->getASTContext().setASTMutationListener( consumer->GetASTMutationListener()); Clang->setASTConsumer(consumer.take()); -- cgit v1.2.3