Skip to content
Snippets Groups Projects
Commit a83c17c2 authored by Nico Weber's avatar Nico Weber
Browse files

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
parent cba681af
No related branches found
No related tags found
No related merge requests found
...@@ -93,6 +93,12 @@ int main(int argc, char **argv) { ...@@ -93,6 +93,12 @@ int main(int argc, char **argv) {
clang::tooling::FindCompileArgsInJsonDatabase( clang::tooling::FindCompileArgsInJsonDatabase(
File.str(), JsonDatabase->getBuffer(), ErrorMessage); File.str(), JsonDatabase->getBuffer(), ErrorMessage);
if (!LookupResult.CommandLine.empty()) { 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( if (!clang::tooling::RunToolWithFlags(
new clang::SyntaxOnlyAction, new clang::SyntaxOnlyAction,
LookupResult.CommandLine.size(), LookupResult.CommandLine.size(),
......
...@@ -78,7 +78,7 @@ class JsonCompileCommandLineParser { ...@@ -78,7 +78,7 @@ class JsonCompileCommandLineParser {
CompileCommandHandler *CommandHandler); CompileCommandHandler *CommandHandler);
/// \brief Parses the specified input. Returns true if no parsing errors were /// \brief Parses the specified input. Returns true if no parsing errors were
/// foudn. /// found.
bool Parse(); bool Parse();
/// \brief Returns an error message if Parse() returned false previously. /// \brief Returns an error message if Parse() returned false previously.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment