diff --git a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp --- a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp +++ b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp @@ -309,10 +309,7 @@ if (Magic == file_magic::bitcode) return verifyAndAddIRObject(Members, std::move(*NMOrErr), C); - if (Error E = verifyAndAddMachOObject(Members, std::move(*NMOrErr), C)) - return E; - - return Error::success(); + return verifyAndAddMachOObject(Members, std::move(*NMOrErr), C); } static Error processArchive(MembersPerArchitectureMap &Members, @@ -441,9 +438,7 @@ if (Magic == file_magic::bitcode) return verifyAndAddIRObject(Members, std::move(*NMOrErr), C); - if (Error E = verifyAndAddMachOObject(Members, std::move(*NMOrErr), C)) - return E; - return Error::success(); + return verifyAndAddMachOObject(Members, std::move(*NMOrErr), C); } static Expected> @@ -477,12 +472,10 @@ } if (NewMembers.size() == 1) { - if (Error E = - writeArchive(OutputFile, NewMembers.begin()->second, - /*WriteSymtab=*/true, - /*Kind=*/object::Archive::K_DARWIN, C.Deterministic, - /*Thin=*/false)) - return E; + return writeArchive(OutputFile, NewMembers.begin()->second, + /*WriteSymtab=*/true, + /*Kind=*/object::Archive::K_DARWIN, C.Deterministic, + /*Thin=*/false); } else { SmallVector, 2> OutputBinaries; for (const std::pair> &M : @@ -512,10 +505,8 @@ return Slices.takeError(); llvm::stable_sort(*Slices); - if (Error E = writeUniversalBinary(*Slices, OutputFile)) - return E; + return writeUniversalBinary(*Slices, OutputFile); } - return Error::success(); } static Expected parseCommandLine(int Argc, char **Argv) {