diff options
| author | Rui Ueyama <ruiu@google.com> | 2016-09-29 22:50:37 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2016-09-29 22:50:37 +0000 |
| commit | 5b8a3b3262047b4468485b2f427be189cb793caf (patch) | |
| tree | 01e034a18961541cb58241f8c1b47cd08c008de3 /lld/ELF/LTO.cpp | |
| parent | 96269c59eab5f3528cf819f89d216d7f9592f90f (diff) | |
| download | bcm5719-llvm-5b8a3b3262047b4468485b2f427be189cb793caf.tar.gz bcm5719-llvm-5b8a3b3262047b4468485b2f427be189cb793caf.zip | |
Remove HasError check after lto::LTO::run.
Because LTO::run doesn't change HasError, it doesn't make
sense to check that value.
llvm-svn: 282801
Diffstat (limited to 'lld/ELF/LTO.cpp')
| -rw-r--r-- | lld/ELF/LTO.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp index eb35e18ef61..9c7de9d613d 100644 --- a/lld/ELF/LTO.cpp +++ b/lld/ELF/LTO.cpp @@ -120,14 +120,10 @@ std::vector<InputFile *> BitcodeCompiler::compile() { 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::compile() { 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; |

