aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/ParseAST.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-14 00:24:19 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-14 00:24:19 +0000
commitfdd0172ca1b3c837f8c2b37d69cc2085234e09fa (patch)
treee3b58dd5415f44fb1ede881b6518bd2e2e333fe2 /lib/Sema/ParseAST.cpp
parentab76d45e023fc5ae966968344e180cd09fdcc746 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69005 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/ParseAST.cpp')
-rw-r--r--lib/Sema/ParseAST.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/ParseAST.cpp b/lib/Sema/ParseAST.cpp
index 4bcb478e89..bb5acb0ee8 100644
--- a/lib/Sema/ParseAST.cpp
+++ b/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.