diff options
| author | Manuel Klimek <klimek@google.com> | 2012-07-05 18:13:01 +0000 |
|---|---|---|
| committer | Manuel Klimek <klimek@google.com> | 2012-07-05 18:13:01 +0000 |
| commit | 5da9dcb27528e788fae20c9b3911c7be0af8000e (patch) | |
| tree | dbd878af8c922c88d06b12eceeb7db9805d220b7 /clang/unittests/Tooling/TestVisitor.h | |
| parent | 4d6c832165c6a9892890e0f1c303be5afc2fb11d (diff) | |
| download | bcm5719-llvm-5da9dcb27528e788fae20c9b3911c7be0af8000e.tar.gz bcm5719-llvm-5da9dcb27528e788fae20c9b3911c7be0af8000e.zip | |
Adapts the FrontendAction convenience functions so that it can be
used with classes that generate ASTConsumers; this allows decoupling
the ASTConsumer generation from the Frontend library (like, for example,
the MatchFinder in the upcoming ASTMatcher patch).
llvm-svn: 159760
Diffstat (limited to 'clang/unittests/Tooling/TestVisitor.h')
| -rw-r--r-- | clang/unittests/Tooling/TestVisitor.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/unittests/Tooling/TestVisitor.h b/clang/unittests/Tooling/TestVisitor.h index f73d2e0c2ff..d439d81d89e 100644 --- a/clang/unittests/Tooling/TestVisitor.h +++ b/clang/unittests/Tooling/TestVisitor.h @@ -56,6 +56,7 @@ protected: FindConsumer(TestVisitor *Visitor) : Visitor(Visitor) {} virtual void HandleTranslationUnit(clang::ASTContext &Context) { + Visitor->Context = &Context; Visitor->TraverseDecl(Context.getTranslationUnitDecl()); } @@ -68,8 +69,7 @@ protected: TestAction(TestVisitor *Visitor) : Visitor(Visitor) {} virtual clang::ASTConsumer* CreateASTConsumer( - CompilerInstance& compiler, llvm::StringRef dummy) { - Visitor->Context = &compiler.getASTContext(); + CompilerInstance&, llvm::StringRef dummy) { /// TestConsumer will be deleted by the framework calling us. return new FindConsumer(Visitor); } |

