[PATCH] D32909: [Tooling] Remove redundant check, NFCi

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


This revision was automatically updated to reflect the committed changes.
Closed by commit rL302236: [Tooling] Remove redundant check, NFCi (authored by krasimir).

Changed prior to commit:
  https://reviews.llvm.org/D32909?vs=97952&id=97953#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D32909

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


Index: cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp
===================================================================
--- cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp
+++ cfe/trunk/lib/Tooling/JSONCompilationDatabase.cpp
@@ -146,12 +146,8 @@
   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);
   }
 };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32909.97953.patch
Type: text/x-patch
Size: 845 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170505/dd9d52df/attachment.bin>


More information about the cfe-commits mailing list