diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-20 15:53:59 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-20 15:53:59 +0000 |
commit | e7785040107266d01ebdcc066365f70b7ace371f (patch) | |
tree | fa7201b641213c1415b1e35f710339cce4666bd6 /lib/Sema/ParseAST.cpp | |
parent | 53c9d8a4b8f0a76cb9dd2fdd8c433ccf110f2eec (diff) |
Introduce the notion of a SemaConsumer, which is an ASTConsumer that
also gets access to the Sema object performing semantic analysis. This
will be used by the PCH writer to serialize Sema state.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69595 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/ParseAST.cpp')
-rw-r--r-- | lib/Sema/ParseAST.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/ParseAST.cpp b/lib/Sema/ParseAST.cpp index b27734745a..448556092f 100644 --- a/lib/Sema/ParseAST.cpp +++ b/lib/Sema/ParseAST.cpp @@ -13,6 +13,7 @@ #include "clang/Sema/ParseAST.h" #include "Sema.h" +#include "clang/Sema/SemaConsumer.h" #include "clang/AST/ASTConsumer.h" #include "clang/AST/ExternalASTSource.h" #include "clang/AST/Stmt.h" @@ -46,6 +47,9 @@ void clang::ParseAST(Preprocessor &PP, ASTConsumer *Consumer, Consumer->Initialize(Ctx); + if (SemaConsumer *SC = dyn_cast<SemaConsumer>(Consumer)) + SC->InitializeSema(S); + if (Ctx.getExternalSource()) Ctx.getExternalSource()->StartTranslationUnit(Consumer); |