diff options
| author | Nico Weber <nicolasweber@gmx.de> | 2011-05-14 21:20:23 +0000 |
|---|---|---|
| committer | Nico Weber <nicolasweber@gmx.de> | 2011-05-14 21:20:23 +0000 |
| commit | 1eace078a48af107906ec49f3156a86e282360d3 (patch) | |
| tree | a5ed3cee2793c3eb75e18368442c1522593f859e /clang | |
| parent | 5880fb8edfa364555fc66d952f283d014c64fccb (diff) | |
| download | bcm5719-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')
| -rw-r--r-- | clang/examples/Tooling/ClangCheck.cpp | 6 | ||||
| -rw-r--r-- | clang/lib/Tooling/JsonCompileCommandLineDatabase.h | 2 |
2 files changed, 7 insertions, 1 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(), diff --git a/clang/lib/Tooling/JsonCompileCommandLineDatabase.h b/clang/lib/Tooling/JsonCompileCommandLineDatabase.h index 9e776d60010..ea7cf0e6e15 100644 --- a/clang/lib/Tooling/JsonCompileCommandLineDatabase.h +++ b/clang/lib/Tooling/JsonCompileCommandLineDatabase.h @@ -78,7 +78,7 @@ class JsonCompileCommandLineParser { CompileCommandHandler *CommandHandler); /// \brief Parses the specified input. Returns true if no parsing errors were - /// foudn. + /// found. bool Parse(); /// \brief Returns an error message if Parse() returned false previously. |

