From 5da9dcb27528e788fae20c9b3911c7be0af8000e Mon Sep 17 00:00:00 2001 From: Manuel Klimek Date: Thu, 5 Jul 2012 18:13:01 +0000 Subject: 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 --- clang/unittests/Tooling/TestVisitor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/unittests/Tooling/TestVisitor.h') 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); } -- cgit v1.2.3