This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho][nfc] Construct CFString literals by copying the ConcatInputSection
ClosedPublic

Authored by int3 on Sep 16 2021, 8:53 AM.

Details

Summary

... instead of constructing a new one each time. This allows us
to take advantage of D105305: [lld-macho] Factor out common InputSection members.

I didn't see a substantial difference when linking chromium_framework,
but this paves the way for reusing similar logic for splitting compact
unwind entries into sections. There are a lot more of those, so the
performance impact is significant.

Diff Detail

Event Timeline

int3 created this revision.Sep 16 2021, 8:53 AM
Herald added a project: Restricted Project. · View Herald Transcript
int3 requested review of this revision.Sep 16 2021, 8:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 16 2021, 8:53 AM
int3 retitled this revision from [lld-macho] Construct CFString literals by copying the ConcatInputSection to [lld-macho][nfc] Construct CFString literals by copying the ConcatInputSection.Sep 16 2021, 9:42 AM
oontvoo accepted this revision.Sep 16 2021, 9:44 AM
oontvoo added a subscriber: oontvoo.

LGTM
...with some nits. Thanks!

lld/MachO/InputFiles.cpp
238–239

why not && here rather than nested if?

303

nit: no braces

This revision is now accepted and ready to land.Sep 16 2021, 9:44 AM
int3 added inline comments.Sep 16 2021, 12:58 PM
lld/MachO/InputFiles.cpp
238–239

because there's an incoming else if clause in the next diff :)

303

I think convention is to include braces if other clauses of the same if chain need braces