diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Tooling/CompilationDatabase.cpp')
-rw-r--r-- | contrib/llvm/tools/clang/lib/Tooling/CompilationDatabase.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/llvm/tools/clang/lib/Tooling/CompilationDatabase.cpp b/contrib/llvm/tools/clang/lib/Tooling/CompilationDatabase.cpp index 8fc4a1f..8ca0b2d 100644 --- a/contrib/llvm/tools/clang/lib/Tooling/CompilationDatabase.cpp +++ b/contrib/llvm/tools/clang/lib/Tooling/CompilationDatabase.cpp @@ -32,12 +32,14 @@ using namespace clang; using namespace tooling; +LLVM_INSTANTIATE_REGISTRY(CompilationDatabasePluginRegistry) + CompilationDatabase::~CompilationDatabase() {} std::unique_ptr<CompilationDatabase> CompilationDatabase::loadFromDirectory(StringRef BuildDirectory, std::string &ErrorMessage) { - std::stringstream ErrorStream; + llvm::raw_string_ostream ErrorStream(ErrorMessage); for (CompilationDatabasePluginRegistry::iterator It = CompilationDatabasePluginRegistry::begin(), Ie = CompilationDatabasePluginRegistry::end(); @@ -49,7 +51,6 @@ CompilationDatabase::loadFromDirectory(StringRef BuildDirectory, return DB; ErrorStream << It->getName() << ": " << DatabaseErrorMessage << "\n"; } - ErrorMessage = ErrorStream.str(); return nullptr; } @@ -299,7 +300,8 @@ FixedCompilationDatabase(Twine Directory, ArrayRef<std::string> CommandLine) { ToolCommandLine.insert(ToolCommandLine.end(), CommandLine.begin(), CommandLine.end()); CompileCommands.emplace_back(Directory, StringRef(), - std::move(ToolCommandLine)); + std::move(ToolCommandLine), + StringRef()); } std::vector<CompileCommand> |