[PATCH] D113301: [NFC][llvm-libtool-darwin]Remove unnecessary conditionals around errors.
Roger Kim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 5 12:27:50 PDT 2021
Roger updated this revision to Diff 385151.
Roger added a comment.
Fix unnecessary variable creation.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113301/new/
https://reviews.llvm.org/D113301
Files:
llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
Index: llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
===================================================================
--- llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
+++ 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<SmallVector<Slice, 2>>
@@ -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<OwningBinary<Archive>, 2> OutputBinaries;
for (const std::pair<const uint64_t, std::vector<NewArchiveMember>> &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<Config> parseCommandLine(int Argc, char **Argv) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113301.385151.patch
Type: text/x-patch
Size: 2034 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211105/f6b16924/attachment.bin>
More information about the llvm-commits
mailing list