From 077a53e5ab1d8e194aa02d7ca2ce3f646af0be9f Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Thu, 30 Aug 2012 02:02:19 +0000 Subject: Tooling: Add a runToolOnCodeWithArgs() function that allows passing additional parameters to a tool. Use this to fix a FIXME in testing code. llvm-svn: 162889 --- clang/unittests/Tooling/TestVisitor.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'clang/unittests/Tooling/TestVisitor.h') diff --git a/clang/unittests/Tooling/TestVisitor.h b/clang/unittests/Tooling/TestVisitor.h index 44ae63a8f55..8333c24a688 100644 --- a/clang/unittests/Tooling/TestVisitor.h +++ b/clang/unittests/Tooling/TestVisitor.h @@ -44,9 +44,12 @@ public: /// \brief Runs the current AST visitor over the given code. bool runOver(StringRef Code, Language L = Lang_CXX) { - // FIXME: The input language is determined based on the provided filename. - static const StringRef Filenames[] = { "input.c", "input.cc" }; - return tooling::runToolOnCode(CreateTestAction(), Code, Filenames[L]); + std::vector Args; + switch (L) { + case Lang_C: Args.push_back("-std=c99"); break; + case Lang_CXX: Args.push_back("-std=c++98"); break; + } + return tooling::runToolOnCodeWithArgs(CreateTestAction(), Code, Args); } bool shouldVisitTemplateInstantiations() const { -- cgit v1.2.3