From 952eddef9aff85b1e92626e89baaf7a360e2ac85 Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 22 Dec 2013 00:07:40 +0000 Subject: Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3): https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841 --- unittests/Tooling/TestVisitor.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'unittests/Tooling/TestVisitor.h') diff --git a/unittests/Tooling/TestVisitor.h b/unittests/Tooling/TestVisitor.h index ce3246a..ec751c3 100644 --- a/unittests/Tooling/TestVisitor.h +++ b/unittests/Tooling/TestVisitor.h @@ -31,7 +31,7 @@ namespace clang { /// This is a drop-in replacement for RecursiveASTVisitor itself, with the /// additional capability of running it over a snippet of code. /// -/// Visits template instantiations (but not implicit code) by default. +/// Visits template instantiations and implicit code by default. template class TestVisitor : public RecursiveASTVisitor { public: @@ -39,14 +39,15 @@ public: virtual ~TestVisitor() { } - enum Language { Lang_C, Lang_CXX }; + enum Language { Lang_C, Lang_CXX98, Lang_CXX11, Lang_CXX=Lang_CXX98 }; /// \brief Runs the current AST visitor over the given code. bool runOver(StringRef Code, Language L = Lang_CXX) { std::vector Args; switch (L) { case Lang_C: Args.push_back("-std=c99"); break; - case Lang_CXX: Args.push_back("-std=c++98"); break; + case Lang_CXX98: Args.push_back("-std=c++98"); break; + case Lang_CXX11: Args.push_back("-std=c++11"); break; } return tooling::runToolOnCodeWithArgs(CreateTestAction(), Code, Args); } @@ -55,6 +56,10 @@ public: return true; } + bool shouldVisitImplicitCode() const { + return true; + } + protected: virtual ASTFrontendAction* CreateTestAction() { return new TestAction(this); -- cgit v1.1