This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho][nfc] De-templatize UnwindInfoSection
ClosedPublic

Authored by int3 on Apr 6 2022, 8:55 PM.

Details

Reviewers
oontvoo
Group Reviewers
Restricted Project
Commits
rG2a6669060f35: [lld-macho][nfc] De-templatize UnwindInfoSection
Summary

Follow-on to D123276: [lld-macho] Use fewer indirections in UnwindInfo implementation. Now that we work with an internal
representation of compact unwind entries, we no longer need to template
our UnwindInfoSectionImpl code based on the pointer size of the target
architecture.

I've still kept the split between UnwindInfoSectionImpl and
UnwindInfoSection. I'd introduced that split in order to do type
erasure, but I think it's still useful to have in order to keep
UnwindInfoSection's definition in the header file clean.

Diff Detail

Event Timeline

int3 created this revision.Apr 6 2022, 8:55 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 6 2022, 8:55 PM
int3 requested review of this revision.Apr 6 2022, 8:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2022, 8:55 PM
oontvoo added inline comments.
lld/MachO/UnwindInfoSection.cpp
106–123

nit: I'm not a big fan of macros and all these lines are quite repetitive, so i'm wondering if maybe we could shorten them to a helper function like this ^
(technically shorter :) )

107

👍 nicer than the previous struct (i.e hide the template stuff)

170

Why do you need another symbolsVec? (shouldh't this be inheritted from UnwindInfoSection?)

int3 updated this revision to Diff 422611.Apr 13 2022, 12:48 PM
int3 marked 2 inline comments as done.

address comments

lld/MachO/UnwindInfoSection.cpp
106–123

good suggestion, thanks!

170

oh good catch. the symbolsVec in the parent class is the redundant one :)

oontvoo accepted this revision.Apr 13 2022, 12:57 PM

LG thanks!

This revision is now accepted and ready to land.Apr 13 2022, 12:57 PM
This revision was landed with ongoing or failed builds.Apr 13 2022, 1:19 PM
This revision was automatically updated to reflect the committed changes.