17class TargetAndModeAdderDatabase :
public CompilationDatabase {
19 TargetAndModeAdderDatabase(std::unique_ptr<CompilationDatabase>
Base)
21 assert(this->Base !=
nullptr);
24 std::vector<std::string> getAllFiles()
const override {
25 return Base->getAllFiles();
28 std::vector<CompileCommand> getAllCompileCommands()
const override {
29 return addTargetAndMode(
Base->getAllCompileCommands());
32 std::vector<CompileCommand>
33 getCompileCommands(StringRef FilePath)
const override {
34 return addTargetAndMode(
Base->getCompileCommands(FilePath));
38 std::vector<CompileCommand>
39 addTargetAndMode(std::vector<CompileCommand> Cmds)
const {
40 for (
auto &
Cmd : Cmds) {
41 if (
Cmd.CommandLine.empty())
47 std::unique_ptr<CompilationDatabase>
Base;
51std::unique_ptr<CompilationDatabase>
53 return std::make_unique<TargetAndModeAdderDatabase>(std::move(
Base));
The JSON file list parser is used to communicate input to InstallAPI.