Summary: The Database check looks redundant.
Reviewers: bkramer
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D32909
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302236
91177308-0d34-0410-b5e6-
96231b3b80d8
loadFromDirectory(StringRef Directory, std::string &ErrorMessage) override {
SmallString<1024> JSONDatabasePath(Directory);
llvm::sys::path::append(JSONDatabasePath, "compile_commands.json");
- std::unique_ptr<CompilationDatabase> Database(
- JSONCompilationDatabase::loadFromFile(
- JSONDatabasePath, ErrorMessage, JSONCommandLineSyntax::AutoDetect));
- if (!Database)
- return nullptr;
- return Database;
+ return JSONCompilationDatabase::loadFromFile(
+ JSONDatabasePath, ErrorMessage, JSONCommandLineSyntax::AutoDetect);
}
};