diff options
Diffstat (limited to 'clang/lib/Tooling/CompilationDatabase.cpp')
-rw-r--r-- | clang/lib/Tooling/CompilationDatabase.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/clang/lib/Tooling/CompilationDatabase.cpp b/clang/lib/Tooling/CompilationDatabase.cpp index f252ef0b722..92b76b157dc 100644 --- a/clang/lib/Tooling/CompilationDatabase.cpp +++ b/clang/lib/Tooling/CompilationDatabase.cpp @@ -112,6 +112,15 @@ CompilationDatabase::autoDetectFromDirectory(StringRef SourceDir, return DB; } +std::vector<CompileCommand> CompilationDatabase::getAllCompileCommands() const { + std::vector<CompileCommand> Result; + for (const auto &File : getAllFiles()) { + auto C = getCompileCommands(File); + std::move(C.begin(), C.end(), std::back_inserter(Result)); + } + return Result; +} + CompilationDatabasePlugin::~CompilationDatabasePlugin() {} namespace { @@ -342,16 +351,6 @@ FixedCompilationDatabase::getCompileCommands(StringRef FilePath) const { return Result; } -std::vector<std::string> -FixedCompilationDatabase::getAllFiles() const { - return std::vector<std::string>(); -} - -std::vector<CompileCommand> -FixedCompilationDatabase::getAllCompileCommands() const { - return std::vector<CompileCommand>(); -} - namespace { class FixedCompilationDatabasePlugin : public CompilationDatabasePlugin { |