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 | e6df0ce08fcdf9f906556d98cca96d38ab440bba (patch) | |
tree | f28e0ad159fa0e02a49af323145b39f1345c471d /unittests/Tooling/TestVisitor.h | |
parent | 1176bcdb21945c7913d684973887e6f588a49236 (diff) | |
download | clang-e6df0ce08fcdf9f906556d98cca96d38ab440bba.tar.gz |
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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159760 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Tooling/TestVisitor.h')
-rw-r--r-- | unittests/Tooling/TestVisitor.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/unittests/Tooling/TestVisitor.h b/unittests/Tooling/TestVisitor.h index f73d2e0c2f..d439d81d89 100644 --- a/unittests/Tooling/TestVisitor.h +++ b/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); } |