From bab175ec4b075c8076ba14c762900392533f6ee4 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 2 Jan 2017 19:18:08 +0000 Subject: Vendor import of clang trunk r290819: https://llvm.org/svn/llvm-project/cfe/trunk@290819 --- lib/Tooling/CompilationDatabase.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/Tooling/CompilationDatabase.cpp') diff --git a/lib/Tooling/CompilationDatabase.cpp b/lib/Tooling/CompilationDatabase.cpp index 8fc4a1fe5beb0..8ca0b2df70130 100644 --- a/lib/Tooling/CompilationDatabase.cpp +++ b/lib/Tooling/CompilationDatabase.cpp @@ -32,12 +32,14 @@ using namespace clang; using namespace tooling; +LLVM_INSTANTIATE_REGISTRY(CompilationDatabasePluginRegistry) + CompilationDatabase::~CompilationDatabase() {} std::unique_ptr 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 CommandLine) { ToolCommandLine.insert(ToolCommandLine.end(), CommandLine.begin(), CommandLine.end()); CompileCommands.emplace_back(Directory, StringRef(), - std::move(ToolCommandLine)); + std::move(ToolCommandLine), + StringRef()); } std::vector -- cgit v1.2.3