This is an archive of the discontinued LLVM Phabricator instance.

Unify landing pad information adding routines (NFC)
ClosedPublic

Authored by aheejin on Sep 24 2018, 10:52 AM.

Details

Summary

We have llvm::addLandingPadInfo and MachineFunction::addLandingPad,
both of which add landing pad information to populate LandingPadInfo
but are called from different locations, which was confusing. This patch
unifies them with one MachineFunction::addLandingPad function, which
now has functionlities of both functions.

Diff Detail

Event Timeline

aheejin created this revision.Sep 24 2018, 10:52 AM
aheejin added inline comments.Sep 24 2018, 11:36 AM
lib/CodeGen/MachineFunction.cpp
661

A followup patch for wasm exception handling will fill in this part. I have this else if statement just to make sure code structure is there.

rnk added a comment.Sep 24 2018, 4:44 PM

Looks good to me.

lib/CodeGen/MachineFunction.cpp
632–633

We can simplify this to dyn_cast<Function>(F.getPersonalityFn()->stripPointerCasts()), now that personalities live on the parent function, not the landingpad.

639–641

This comment is scary, but pre-existing, so I guess let's not worry about it.

aheejin updated this revision to Diff 166794.Sep 24 2018, 5:44 PM
aheejin marked 2 inline comments as done.
  • Address comments
rnk accepted this revision.Sep 25 2018, 8:48 AM

lgtm, thanks!

This revision is now accepted and ready to land.Sep 25 2018, 8:48 AM
This revision was automatically updated to reflect the committed changes.