summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling/CompilationDatabase.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2015-09-11 20:43:05 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2015-09-11 20:43:05 +0000
commit74bcd21e342faffb558ff58d635f4c974c4213fc (patch)
treeff003ed177014ce223a0d7f2ea6900e480f6a522 /clang/lib/Tooling/CompilationDatabase.cpp
parent744267765caabf432cbcc126ad2726d96761a865 (diff)
downloadbcm5719-llvm-74bcd21e342faffb558ff58d635f4c974c4213fc.tar.gz
bcm5719-llvm-74bcd21e342faffb558ff58d635f4c974c4213fc.zip
[tooling] In CompileCommand, Expose the 'file' that was associated with the command.
llvm-svn: 247468
Diffstat (limited to 'clang/lib/Tooling/CompilationDatabase.cpp')
-rw-r--r--clang/lib/Tooling/CompilationDatabase.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Tooling/CompilationDatabase.cpp b/clang/lib/Tooling/CompilationDatabase.cpp
index c1817b7afcc..957e40137ea 100644
--- a/clang/lib/Tooling/CompilationDatabase.cpp
+++ b/clang/lib/Tooling/CompilationDatabase.cpp
@@ -299,13 +299,15 @@ FixedCompilationDatabase(Twine Directory, ArrayRef<std::string> CommandLine) {
std::vector<std::string> ToolCommandLine(1, "clang-tool");
ToolCommandLine.insert(ToolCommandLine.end(),
CommandLine.begin(), CommandLine.end());
- CompileCommands.emplace_back(Directory, std::move(ToolCommandLine));
+ CompileCommands.emplace_back(Directory, StringRef(),
+ std::move(ToolCommandLine));
}
std::vector<CompileCommand>
FixedCompilationDatabase::getCompileCommands(StringRef FilePath) const {
std::vector<CompileCommand> Result(CompileCommands);
Result[0].CommandLine.push_back(FilePath);
+ Result[0].Filename = FilePath;
return Result;
}
OpenPOWER on IntegriCloud