[lld] r312177 - Simplify writeArchive return type.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 30 15:11:03 PDT 2017


Author: ruiu
Date: Wed Aug 30 15:11:03 2017
New Revision: 312177

URL: http://llvm.org/viewvc/llvm-project?rev=312177&view=rev
Log:
Simplify writeArchive return type.

writeArchive returned a pair, but the first element of the pair is always
its first argument on failure, so it doesn't make sense to return it from
the function. This patch change the return type so that it does't return it.

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

Modified:
    lld/trunk/COFF/Driver.cpp

Modified: lld/trunk/COFF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=312177&r1=312176&r2=312177&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.cpp (original)
+++ lld/trunk/COFF/Driver.cpp Wed Aug 30 15:11:03 2017
@@ -581,12 +581,12 @@ filterBitcodeFiles(StringRef Path, std::
   std::string Temp = S.str();
   TemporaryFiles.push_back(Temp);
 
-  std::pair<StringRef, std::error_code> Ret =
+  std::error_code EC =
       llvm::writeArchive(Temp, New, /*WriteSymtab=*/true, Archive::Kind::K_GNU,
                          /*Deterministics=*/true,
                          /*Thin=*/false);
-  if (Ret.second)
-    error("failed to create a new archive " + S.str() + ": " + Ret.first);
+  if (EC)
+    error("failed to create a new archive " + S.str() + ": " + EC.message());
   return Temp;
 }
 




More information about the llvm-commits mailing list