diff options
Diffstat (limited to 'lib/Tooling/JSONCompilationDatabase.cpp')
-rw-r--r-- | lib/Tooling/JSONCompilationDatabase.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Tooling/JSONCompilationDatabase.cpp b/lib/Tooling/JSONCompilationDatabase.cpp index 232c329de2..04568757d4 100644 --- a/lib/Tooling/JSONCompilationDatabase.cpp +++ b/lib/Tooling/JSONCompilationDatabase.cpp @@ -122,7 +122,7 @@ class JSONCompilationDatabasePlugin : public CompilationDatabasePlugin { StringRef Directory, std::string &ErrorMessage) { SmallString<1024> JSONDatabasePath(Directory); llvm::sys::path::append(JSONDatabasePath, "compile_commands.json"); - OwningPtr<CompilationDatabase> Database( + std::unique_ptr<CompilationDatabase> Database( JSONCompilationDatabase::loadFromFile(JSONDatabasePath, ErrorMessage)); if (!Database) return NULL; @@ -144,14 +144,14 @@ volatile int JSONAnchorSource = 0; JSONCompilationDatabase * JSONCompilationDatabase::loadFromFile(StringRef FilePath, std::string &ErrorMessage) { - OwningPtr<llvm::MemoryBuffer> DatabaseBuffer; + std::unique_ptr<llvm::MemoryBuffer> DatabaseBuffer; llvm::error_code Result = llvm::MemoryBuffer::getFile(FilePath, DatabaseBuffer); if (Result != 0) { ErrorMessage = "Error while opening JSON database: " + Result.message(); return NULL; } - OwningPtr<JSONCompilationDatabase> Database( + std::unique_ptr<JSONCompilationDatabase> Database( new JSONCompilationDatabase(DatabaseBuffer.release())); if (!Database->parse(ErrorMessage)) return NULL; @@ -161,9 +161,9 @@ JSONCompilationDatabase::loadFromFile(StringRef FilePath, JSONCompilationDatabase * JSONCompilationDatabase::loadFromBuffer(StringRef DatabaseString, std::string &ErrorMessage) { - OwningPtr<llvm::MemoryBuffer> DatabaseBuffer( + std::unique_ptr<llvm::MemoryBuffer> DatabaseBuffer( llvm::MemoryBuffer::getMemBuffer(DatabaseString)); - OwningPtr<JSONCompilationDatabase> Database( + std::unique_ptr<JSONCompilationDatabase> Database( new JSONCompilationDatabase(DatabaseBuffer.release())); if (!Database->parse(ErrorMessage)) return NULL; |