aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Tooling/TestVisitor.h4
-rw-r--r--unittests/Tooling/ToolingTest.cpp4
2 files changed, 5 insertions, 3 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);
}
diff --git a/unittests/Tooling/ToolingTest.cpp b/unittests/Tooling/ToolingTest.cpp
index f6681f8153..fb3af2678c 100644
--- a/unittests/Tooling/ToolingTest.cpp
+++ b/unittests/Tooling/ToolingTest.cpp
@@ -104,7 +104,9 @@ TEST(newFrontendActionFactory, CreatesFrontendActionFactoryFromType) {
}
struct IndependentFrontendActionCreator {
- FrontendAction *newFrontendAction() { return new SyntaxOnlyAction; }
+ ASTConsumer *newASTConsumer() {
+ return new FindTopLevelDeclConsumer(NULL);
+ }
};
TEST(newFrontendActionFactory, CreatesFrontendActionFactoryFromFactoryType) {