summaryrefslogtreecommitdiffstats
path: root/clang/examples/Tooling
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2011-05-14 21:20:23 +0000
committerNico Weber <nicolasweber@gmx.de>2011-05-14 21:20:23 +0000
commit1eace078a48af107906ec49f3156a86e282360d3 (patch)
treea5ed3cee2793c3eb75e18368442c1522593f859e /clang/examples/Tooling
parent5880fb8edfa364555fc66d952f283d014c64fccb (diff)
downloadbcm5719-llvm-1eace078a48af107906ec49f3156a86e282360d3.tar.gz
bcm5719-llvm-1eace078a48af107906ec49f3156a86e282360d3.zip
Let clang-check actually use the Directory entry in the json file.
llvm-svn: 131367
Diffstat (limited to 'clang/examples/Tooling')
-rw-r--r--clang/examples/Tooling/ClangCheck.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/examples/Tooling/ClangCheck.cpp b/clang/examples/Tooling/ClangCheck.cpp
index 0dfa53d44e6..db24ec31ecc 100644
--- a/clang/examples/Tooling/ClangCheck.cpp
+++ b/clang/examples/Tooling/ClangCheck.cpp
@@ -93,6 +93,12 @@ int main(int argc, char **argv) {
clang::tooling::FindCompileArgsInJsonDatabase(
File.str(), JsonDatabase->getBuffer(), ErrorMessage);
if (!LookupResult.CommandLine.empty()) {
+ if (LookupResult.Directory.size()) {
+ // FIXME: What should happen if CommandLine includes -working-directory
+ // as well?
+ LookupResult.CommandLine.push_back(
+ "-working-directory=" + LookupResult.Directory);
+ }
if (!clang::tooling::RunToolWithFlags(
new clang::SyntaxOnlyAction,
LookupResult.CommandLine.size(),
OpenPOWER on IntegriCloud