This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho][nfc] Remove unnecessary parameterization of section sort
ClosedPublic

Authored by int3 on May 22 2021, 8:09 PM.

Details

Summary

As @alexshap pointed out here,
it's a bit confusing to have the option to sort OutputSections with any
comparator when in practice we only use one.

Diff Detail

Event Timeline

int3 created this revision.May 22 2021, 8:09 PM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: mgrang. · View Herald Transcript
int3 requested review of this revision.May 22 2021, 8:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2021, 8:09 PM
thakis added a subscriber: thakis.May 23 2021, 9:22 AM

Once we handle N_COLD_FUNC this will also affect ordering. I don't know if that'd go in the one comparator or if it'd use a different comparator. If it's the latter, maybe we shouldn't change this?

int3 added a comment.May 23 2021, 9:57 AM

I think it'd use/extend the same comparator, since much of the ordering defined in the current comparator is needed for correctness.

thakis accepted this revision.May 23 2021, 10:13 AM

Sounds good :)

lld/MachO/OutputSegment.cpp
98

wrap to 80

This revision is now accepted and ready to land.May 23 2021, 10:13 AM
int3 marked an inline comment as done.May 23 2021, 10:36 AM
int3 added inline comments.
lld/MachO/OutputSegment.cpp
98

it's already wrapped at 80 :)

lld/MachO/OutputSegment.cpp
65
static auto compareByOrder(...) {
   return ...
}
This revision was landed with ongoing or failed builds.May 25 2021, 11:59 AM
This revision was automatically updated to reflect the committed changes.
int3 marked 2 inline comments as done.