summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling/JSONCompilationDatabase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Tooling/JSONCompilationDatabase.cpp')
-rw-r--r--clang/lib/Tooling/JSONCompilationDatabase.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Tooling/JSONCompilationDatabase.cpp b/clang/lib/Tooling/JSONCompilationDatabase.cpp
index 3ac6f697e57..dd4d7a8f083 100644
--- a/clang/lib/Tooling/JSONCompilationDatabase.cpp
+++ b/clang/lib/Tooling/JSONCompilationDatabase.cpp
@@ -232,8 +232,11 @@ void JSONCompilationDatabase::getCommands(
std::vector<CompileCommand> &Commands) const {
for (int I = 0, E = CommandsRef.size(); I != E; ++I) {
SmallString<8> DirectoryStorage;
- Commands.emplace_back(CommandsRef[I].first->getValue(DirectoryStorage),
- nodeToCommandLine(CommandsRef[I].second));
+ SmallString<32> FilenameStorage;
+ Commands.emplace_back(
+ std::get<0>(CommandsRef[I])->getValue(DirectoryStorage),
+ std::get<1>(CommandsRef[I])->getValue(FilenameStorage),
+ nodeToCommandLine(std::get<2>(CommandsRef[I])));
}
}
@@ -335,7 +338,7 @@ bool JSONCompilationDatabase::parse(std::string &ErrorMessage) {
llvm::sys::path::native(FileName, NativeFilePath);
}
IndexByFile[NativeFilePath].push_back(
- CompileCommandRef(Directory, *Command));
+ CompileCommandRef(Directory, File, *Command));
MatchTrie.insert(NativeFilePath);
}
return true;
OpenPOWER on IntegriCloud