This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho][NFC] define more strings in section_names:: and segment_names::
ClosedPublic

Authored by gkm on Apr 27 2021, 12:42 PM.

Details

Summary

As preparation for a subsequent diff that implements builtin section renaming, define more constexpr strings in namespaces lld::macho::segment_names and lld::macho::section_names, and use them to replace string literals.

Diff Detail

Event Timeline

gkm created this revision.Apr 27 2021, 12:42 PM
Herald added a project: Restricted Project. · View Herald Transcript
gkm requested review of this revision.Apr 27 2021, 12:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2021, 12:42 PM
int3 accepted this revision.Apr 27 2021, 1:54 PM
int3 added inline comments.
lld/MachO/MergedOutputSection.cpp
58–60 ↗(On Diff #340949)

technically a change in an error message is a functional change :)

It seems like we are lacking a test for this; could you add it in this diff?

Also I think the flags would be more readable as hex values (there's to_hexString() in ScopedPrinter.h)

This revision is now accepted and ready to land.Apr 27 2021, 1:54 PM
gkm marked an inline comment as done.Apr 27 2021, 2:11 PM
gkm added inline comments.
lld/MachO/MergedOutputSection.cpp
58–60 ↗(On Diff #340949)

Oops. This change should migrate back into the builtin-section-renaming diff.

gkm updated this revision to Diff 340985.Apr 27 2021, 2:22 PM
gkm marked an inline comment as done.
  • migrate bugfix in MergedOutputSection::mergeFlags() out of this NFC diff
This revision was landed with ongoing or failed builds.Apr 27 2021, 5:49 PM
This revision was automatically updated to reflect the committed changes.