summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Tooling/TestVisitor.h
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2012-08-30 02:02:19 +0000
committerNico Weber <nicolasweber@gmx.de>2012-08-30 02:02:19 +0000
commit077a53e5ab1d8e194aa02d7ca2ce3f646af0be9f (patch)
tree630c1ffbfb60c36423f2850e16ee5eb672a5af13 /clang/unittests/Tooling/TestVisitor.h
parent14c8a051cae8e15920825a3c061522f8d224e254 (diff)
downloadbcm5719-llvm-077a53e5ab1d8e194aa02d7ca2ce3f646af0be9f.tar.gz
bcm5719-llvm-077a53e5ab1d8e194aa02d7ca2ce3f646af0be9f.zip
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
Diffstat (limited to 'clang/unittests/Tooling/TestVisitor.h')
-rw-r--r--clang/unittests/Tooling/TestVisitor.h9
1 files changed, 6 insertions, 3 deletions
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<std::string> 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 {
OpenPOWER on IntegriCloud