This is an archive of the discontinued LLVM Phabricator instance.

Move most EH from MachineModuleInfo to MachineFunction
ClosedPublic

Authored by MatzeB on Nov 29 2016, 2:11 PM.

Details

Summary

Most of the exception handling members in MachineModuleInfo is actually
per function data (talks about the "current function") so it is better
to keep it at the function instead of the module.

This is a necessary step to have machine module passes work properly.

Also:

  • Rename TidyLandingPads() to tidyLandingPads()
  • Use doxygen member groups instead of "//===- EH ---"... so it is clear where a group ends.
  • I had to add an ugly const_cast at two places in the AsmPrinter because the available MachineFunction pointers are const, but the code wants to call tidyLandingPads() in between (markFunctionEnd()/endFunction()).

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB updated this revision to Diff 79642.Nov 29 2016, 2:11 PM
MatzeB retitled this revision from to Move most EH from MachineModuleInfo to MachineFunction.
MatzeB updated this object.
MatzeB added reviewers: rnk, echristo, asl.
MatzeB set the repository for this revision to rL LLVM.
MatzeB added a subscriber: llvm-commits.
rnk accepted this revision.Nov 29 2016, 4:37 PM
rnk edited edge metadata.

lgtm Thanks, I think we just never questioned why that stuff lived on MMI when doing all that funclet work.

include/llvm/CodeGen/MachineFunction.h
30 ↗(On Diff #79642)

We can probably forward declare class MCSymbol.

include/llvm/CodeGen/MachineModuleInfo.h
235 ↗(On Diff #79642)

Mmmm, delicious SjLj state.

This revision is now accepted and ready to land.Nov 29 2016, 4:37 PM
This revision was automatically updated to reflect the committed changes.