This is an archive of the discontinued LLVM Phabricator instance.

[lld/mac] Use fewer magic numbers in magic $ld$ handling code
ClosedPublic

Authored by thakis on Jun 6 2021, 1:12 PM.

Details

Summary

Also simply a conditional and de-alias a variable.
Minor cleanups, no behavior change.

Diff Detail

Event Timeline

thakis created this revision.Jun 6 2021, 1:12 PM
Herald added a reviewer: gkm. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
thakis requested review of this revision.Jun 6 2021, 1:12 PM
thakis added inline comments.
lld/MachO/InputFiles.cpp
978

(can't consume_front here since we want to pass on the full originalName below)

thakis updated this revision to Diff 350130.Jun 6 2021, 1:18 PM
thakis edited the summary of this revision. (Show Details)

more

alexander-shaposhnikov added inline comments.
lld/MachO/InputFiles.cpp
1052

https://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code
e.g. the "preferred style" also uses extra lines for early returns with the benefit of keeping the code path where the real changes take effect at the same indentation level. Here the code is small enough, personally I don't have a very strong opinion regarding different versions.

This revision is now accepted and ready to land.Jun 6 2021, 2:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2021, 3:13 PM