This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho][nfc] Simplify unwind section lookup
ClosedPublic

Authored by int3 on Apr 8 2022, 7:26 PM.

Details

Reviewers
Roger
Group Reviewers
Restricted Project
Commits
rGe6382d23fcc8: [lld-macho][nfc] Simplify unwind section lookup
Summary

Previously, we stored a pointer from the ObjFile to its compact unwind
section in order to avoid iterating over the file's sections a second
time. However, given the small number of sections (not subsections) per
file, this caching was really quite unnecessary. We will soon do lookups
for more sections (such as the __eh_frame section), so let's simplify
the code first.

Diff Detail

Event Timeline

int3 created this revision.Apr 8 2022, 7:26 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 8 2022, 7:26 PM
int3 requested review of this revision.Apr 8 2022, 7:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 8 2022, 7:26 PM
Roger accepted this revision.Apr 22 2022, 11:33 AM
Roger added a subscriber: Roger.

I love the use of StringSwitch! Very cool!

This revision is now accepted and ready to land.Apr 22 2022, 11:33 AM
Roger added inline comments.Apr 22 2022, 11:35 AM
lld/MachO/InputFiles.cpp
919

It looks like we do not use this variable aside from assigning to it. Can we get rid of it?

int3 marked an inline comment as done.Apr 22 2022, 11:36 AM
int3 added inline comments.
lld/MachO/InputFiles.cpp
919

it's used in the next diff, I don't think finagling with merge conflicts just to relocate it there is worthwhile :P

Roger added inline comments.Apr 22 2022, 11:38 AM
lld/MachO/InputFiles.cpp
919

Sounds good.

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