This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho][nfc] Factor out callgraph parsing code
ClosedPublic

Authored by int3 on Feb 15 2022, 2:15 PM.

Details

Reviewers
lgrey
oontvoo
Group Reviewers
Restricted Project
Commits
rG94c28d289aec: [lld-macho][nfc] Factor out callgraph parsing code
Summary

parseSections() is a getting a bit large unwieldy, let's factor out
logic where we can.

Other minor changes in this diff:

  • "__cg_profile" is now a global constexpr
  • We now use checkError() instead of fatal()-ing without handling the Error
  • Check for callGraphProfileSort before checking the section name, since the boolean comparison is likely cheaper

Diff Detail

Event Timeline

int3 created this revision.Feb 15 2022, 2:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 15 2022, 2:15 PM
int3 requested review of this revision.Feb 15 2022, 2:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 15 2022, 2:15 PM
oontvoo added inline comments.
lld/MachO/InputFiles.cpp
278–282

not your change but since you're here, how about this?

oontvoo accepted this revision.Feb 15 2022, 2:21 PM

Thanks!

This revision is now accepted and ready to land.Feb 15 2022, 2:21 PM
lgrey accepted this revision.Feb 15 2022, 2:48 PM

+1, thanks!

This revision was automatically updated to reflect the committed changes.
int3 marked an inline comment as done.