r302236 - [Tooling] Remove redundant check, NFCi

Krasimir Georgiev via cfe-commits cfe-commits at lists.llvm.org
Fri May 5 07:07:24 PDT 2017


Author: krasimir
Date: Fri May  5 09:07:23 2017
New Revision: 302236

URL: http://llvm.org/viewvc/llvm-project?rev=302236&view=rev
Log:
[Tooling] Remove redundant check, NFCi

Summary: The Database check looks redundant.

Reviewers: bkramer

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D32909

Modified:
    cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp

Modified: cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp?rev=302236&r1=302235&r2=302236&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp (original)
+++ cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp Fri May  5 09:07:23 2017
@@ -146,12 +146,8 @@ class JSONCompilationDatabasePlugin : pu
   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);
   }
 };
 




More information about the cfe-commits mailing list