summaryrefslogtreecommitdiffstats
path: root/examples
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
commita83c17c28f4a570e18678f6031834487534f120d (patch)
treeea3891a9260c87b6b47af19e880324dcf42fc5f7 /examples
parentcba681af356e24ec4335bcf2b6bb6515072ace99 (diff)
Let clang-check actually use the Directory entry in the json file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131367 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples')
-rw-r--r--examples/Tooling/ClangCheck.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/Tooling/ClangCheck.cpp b/examples/Tooling/ClangCheck.cpp
index 0dfa53d44e..db24ec31ec 100644
--- a/examples/Tooling/ClangCheck.cpp
+++ b/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(),