diff options
| author | Matthias Braun <matze@braunis.de> | 2016-11-30 23:49:01 +0000 |
|---|---|---|
| committer | Matthias Braun <matze@braunis.de> | 2016-11-30 23:49:01 +0000 |
| commit | ed14cb060420040e712ff159058e53c62a7326a0 (patch) | |
| tree | 188dd87febe4d79ed3d1ad33ba403cbe708d9ac5 /llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp | |
| parent | ef331eff5aa56a70d5bef2e5cf3202a326d697e9 (diff) | |
| download | bcm5719-llvm-ed14cb060420040e712ff159058e53c62a7326a0.tar.gz bcm5719-llvm-ed14cb060420040e712ff159058e53c62a7326a0.zip | |
Move most EH from MachineModuleInfo to MachineFunction
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: 288293
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp index b334263a823..efe7059a3a0 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp @@ -44,11 +44,11 @@ DwarfCFIExceptionBase::DwarfCFIExceptionBase(AsmPrinter *A) void DwarfCFIExceptionBase::markFunctionEnd() { endFragment(); - if (MMI->getLandingPads().empty()) - return; - // Map all labels and get rid of any dead landing pads. - MMI->TidyLandingPads(); + if (!Asm->MF->getLandingPads().empty()) { + MachineFunction *NonConstMF = const_cast<MachineFunction*>(Asm->MF); + NonConstMF->tidyLandingPads(); + } } void DwarfCFIExceptionBase::endFragment() { @@ -98,7 +98,7 @@ void DwarfCFIException::beginFunction(const MachineFunction *MF) { const Function *F = MF->getFunction(); // If any landing pads survive, we need an EH table. - bool hasLandingPads = !MMI->getLandingPads().empty(); + bool hasLandingPads = !MF->getLandingPads().empty(); // See if we need frame move info. AsmPrinter::CFIMoveType MoveType = Asm->needsCFIMoves(); @@ -170,7 +170,7 @@ void DwarfCFIException::beginFragment(const MachineBasicBlock *MBB, /// endFunction - Gather and emit post-function exception information. /// -void DwarfCFIException::endFunction(const MachineFunction *) { +void DwarfCFIException::endFunction(const MachineFunction *MF) { if (!shouldEmitPersonality) return; |

