diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-14 00:24:19 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-14 00:24:19 +0000 |
commit | 1a0d0b9acc57e0c14ad32008ffac0fea49098121 (patch) | |
tree | 374aef8d8ccca117ae326262ca743b283391cb74 /clang/lib/Sema/ParseAST.cpp | |
parent | e4e55d2706a5736e251ec89b1eb68081c18263bb (diff) | |
download | bcm5719-llvm-1a0d0b9acc57e0c14ad32008ffac0fea49098121.tar.gz bcm5719-llvm-1a0d0b9acc57e0c14ad32008ffac0fea49098121.zip |
When writing a PCH file, keep track of all of the non-static,
non-inline external definitions (and tentative definitions) that are
found at the top level. The corresponding declarations are stored in a
record in the PCH file, so that they can be provided to the
ASTConsumer (via HandleTopLevelDecl) when the PCH file is read.
llvm-svn: 69005
Diffstat (limited to 'clang/lib/Sema/ParseAST.cpp')
-rw-r--r-- | clang/lib/Sema/ParseAST.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/ParseAST.cpp b/clang/lib/Sema/ParseAST.cpp index 4bcb478e890..bb5acb0ee8d 100644 --- a/clang/lib/Sema/ParseAST.cpp +++ b/clang/lib/Sema/ParseAST.cpp @@ -14,6 +14,7 @@ #include <llvm/ADT/OwningPtr.h> #include "clang/Sema/ParseAST.h" #include "clang/AST/ASTConsumer.h" +#include "clang/AST/ExternalASTSource.h" #include "clang/AST/Stmt.h" #include "Sema.h" #include "clang/Parse/Parser.h" @@ -44,6 +45,9 @@ void clang::ParseAST(Preprocessor &PP, ASTConsumer *Consumer, Consumer->Initialize(Ctx); + if (Ctx.getExternalSource()) + Ctx.getExternalSource()->StartTranslationUnit(Consumer); + Parser::DeclGroupPtrTy ADecl; while (!P.ParseTopLevelDecl(ADecl)) { // Not end of file. |