[lld] r282801 - Remove HasError check after lto::LTO::run.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 29 15:50:37 PDT 2016


Author: ruiu
Date: Thu Sep 29 17:50:37 2016
New Revision: 282801

URL: http://llvm.org/viewvc/llvm-project?rev=282801&view=rev
Log:
Remove HasError check after lto::LTO::run.

Because LTO::run doesn't change HasError, it doesn't make
sense to check that value.

Modified:
    lld/trunk/ELF/LTO.cpp

Modified: lld/trunk/ELF/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LTO.cpp?rev=282801&r1=282800&r2=282801&view=diff
==============================================================================
--- lld/trunk/ELF/LTO.cpp (original)
+++ lld/trunk/ELF/LTO.cpp Thu Sep 29 17:50:37 2016
@@ -120,14 +120,10 @@ std::vector<InputFile *> BitcodeCompiler
   unsigned MaxTasks = LtoObj->getMaxTasks();
   Buff.resize(MaxTasks);
 
-  auto AddStream = [&](size_t Task) {
+  checkError(LtoObj->run([&](size_t Task) {
     return llvm::make_unique<lto::NativeObjectStream>(
         llvm::make_unique<llvm::raw_svector_ostream>(Buff[Task]));
-  };
-
-  checkError(LtoObj->run(AddStream));
-  if (HasError)
-    return Ret;
+  }));
 
   for (unsigned I = 0; I != MaxTasks; ++I) {
     if (Buff[I].empty())
@@ -138,8 +134,7 @@ std::vector<InputFile *> BitcodeCompiler
       else
         saveBuffer(Buff[I], Config->OutputFile + Twine(I) + ".lto.o");
     }
-    MemoryBufferRef CompiledObjRef(Buff[I], "lto.tmp");
-    InputFile *Obj = createObjectFile(CompiledObjRef);
+    InputFile *Obj = createObjectFile(MemoryBufferRef(Buff[I], "lto.tmp"));
     Ret.push_back(Obj);
   }
   return Ret;




More information about the llvm-commits mailing list