[lld] r297687 - Remove a useless temporary variable.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 13 16:26:37 PDT 2017


Author: ruiu
Date: Mon Mar 13 18:26:37 2017
New Revision: 297687

URL: http://llvm.org/viewvc/llvm-project?rev=297687&view=rev
Log:
Remove a useless temporary variable.

Modified:
    lld/trunk/ELF/Driver.cpp

Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=297687&r1=297686&r2=297687&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Mon Mar 13 18:26:37 2017
@@ -812,9 +812,7 @@ static uint64_t getImageBase(opt::InputA
 // is called. We use that class without calling commit() to predict
 // if the given file is writable.
 static bool isWritable(StringRef Path) {
-  ErrorOr<std::unique_ptr<FileOutputBuffer>> Err =
-      FileOutputBuffer::create(Path, 1);
-  if (auto EC = Err.getError()) {
+  if (auto EC = FileOutputBuffer::create(Path, 1).getError()) {
     error("cannot open output file " + Path + ": " + EC.message());
     return false;
   }




More information about the llvm-commits mailing list