diff options
author | Matthias Braun <matze@braunis.de> | 2016-12-01 19:32:15 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2016-12-01 19:32:15 +0000 |
commit | d0ee66c2e9decd064b84399fb81616a01b6d1f22 (patch) | |
tree | 915616f68a075b08e13f484add438eb5a6640b7d /llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp | |
parent | 6c299ca6e769be0ffa075ceb2310113748449ee8 (diff) | |
download | bcm5719-llvm-d0ee66c2e9decd064b84399fb81616a01b6d1f22.tar.gz bcm5719-llvm-d0ee66c2e9decd064b84399fb81616a01b6d1f22.zip |
Move most EH from MachineModuleInfo to MachineFunction
Recommitting r288293 with some extra fixes for GlobalISel code.
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()).
Differential Revision: https://reviews.llvm.org/D27227
llvm-svn: 288405
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp b/llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp index e24dcb1bffd..0a4a7a06cb2 100644 --- a/llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp @@ -74,7 +74,7 @@ computeActionsTable(const SmallVectorImpl<const LandingPadInfo*> &LandingPads, // output using a fixed width encoding. FilterOffsets[i] holds the byte // offset corresponding to FilterIds[i]. - const std::vector<unsigned> &FilterIds = MMI->getFilterIds(); + const std::vector<unsigned> &FilterIds = Asm->MF->getFilterIds(); SmallVector<int, 16> FilterOffsets; FilterOffsets.reserve(FilterIds.size()); int Offset = -1; @@ -296,7 +296,7 @@ computeCallSiteTable(SmallVectorImpl<CallSiteEntry> &CallSites, else { // SjLj EH must maintain the call sites in the order assigned // to them by the SjLjPrepare pass. - unsigned SiteNo = MMI->getCallSiteBeginLabel(BeginLabel); + unsigned SiteNo = Asm->MF->getCallSiteBeginLabel(BeginLabel); if (CallSites.size() < SiteNo) CallSites.resize(SiteNo); CallSites[SiteNo - 1] = Site; @@ -336,9 +336,10 @@ computeCallSiteTable(SmallVectorImpl<CallSiteEntry> &CallSites, /// 3. Type ID table contains references to all the C++ typeinfo for all /// catches in the function. This tables is reverse indexed base 1. void EHStreamer::emitExceptionTable() { - const std::vector<const GlobalValue *> &TypeInfos = MMI->getTypeInfos(); - const std::vector<unsigned> &FilterIds = MMI->getFilterIds(); - const std::vector<LandingPadInfo> &PadInfos = MMI->getLandingPads(); + const MachineFunction *MF = Asm->MF; + const std::vector<const GlobalValue *> &TypeInfos = MF->getTypeInfos(); + const std::vector<unsigned> &FilterIds = MF->getFilterIds(); + const std::vector<LandingPadInfo> &PadInfos = MF->getLandingPads(); // Sort the landing pads in order of their type ids. This is used to fold // duplicate actions. @@ -649,8 +650,9 @@ void EHStreamer::emitExceptionTable() { } void EHStreamer::emitTypeInfos(unsigned TTypeEncoding) { - const std::vector<const GlobalValue *> &TypeInfos = MMI->getTypeInfos(); - const std::vector<unsigned> &FilterIds = MMI->getFilterIds(); + const MachineFunction *MF = Asm->MF; + const std::vector<const GlobalValue *> &TypeInfos = MF->getTypeInfos(); + const std::vector<unsigned> &FilterIds = MF->getFilterIds(); bool VerboseAsm = Asm->OutStreamer->isVerboseAsm(); |