This is an archive of the discontinued LLVM Phabricator instance.

[NFC][llvm-libtool-darwin]Remove unnecessary conditionals around errors.
ClosedPublic

Authored by Roger on Nov 5 2021, 10:48 AM.

Details

Summary

The existing code has unnecessary logic to indirectly pass
errors through function calls. This diff gets rid of the fluff.

Test Plan: Existing unit tests

Diff Detail

Event Timeline

Roger requested review of this revision.Nov 5 2021, 10:48 AM
Roger created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptNov 5 2021, 10:48 AM
Roger retitled this revision from Remove unnecessary conditionals around errors. to [NFC][llvm-libtool-darwin]Remove unnecessary conditionals around errors..Nov 5 2021, 10:48 AM
Roger updated this revision to Diff 385151.Nov 5 2021, 12:27 PM

Fix unnecessary variable creation.

drodriguez accepted this revision.Nov 5 2021, 1:15 PM
drodriguez added a subscriber: drodriguez.
drodriguez added inline comments.
llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
481–501

For this last case, if you want to remove the else branch, I think it will fit more with the code style: https://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return

This revision is now accepted and ready to land.Nov 5 2021, 1:15 PM
llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
481–501

yeah, i think this 'else' should be removed

Roger updated this revision to Diff 385307.Nov 6 2021, 5:25 PM

Removing unnecessary else statement.

Roger updated this revision to Diff 385311.Nov 6 2021, 5:28 PM

Clang-tidy

Roger marked 2 inline comments as done.Nov 6 2021, 5:33 PM
Roger added inline comments.
llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
481–501

Done :)

Roger marked an inline comment as done.Nov 8 2021, 10:21 AM
This revision was landed with ongoing or failed builds.Nov 8 2021, 10:34 AM
This revision was automatically updated to reflect the committed changes.