diff options
author | Reid Kleckner <reid@kleckner.net> | 2015-01-23 18:49:01 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2015-01-23 18:49:01 +0000 |
commit | 5cc1569c548048e5427ef2c5c82de4a787c2a397 (patch) | |
tree | 1e04addd27f71eba672ba56a85dad8702fc710be /llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | 577feba44b9552a1b68ba52e3bf36b3054b6dae7 (diff) | |
download | bcm5719-llvm-5cc1569c548048e5427ef2c5c82de4a787c2a397.tar.gz bcm5719-llvm-5cc1569c548048e5427ef2c5c82de4a787c2a397.zip |
Classify functions by EH personality type rather than using the triple
This mostly reverts commit r222062 and replaces it with a new enum. At
some point this enum will grow at least for other MSVC EH personalities.
Also beefs up the way we were sniffing the personality function.
Previously we would emit the Itanium LSDA despite using
__C_specific_handler.
Reviewers: majnemer
Differential Revision: http://reviews.llvm.org/D6987
llvm-svn: 226920
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index d37de980e06..c56973a44fa 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -924,8 +924,13 @@ void SelectionDAGISel::PrepareEHLandingPad() { BuildMI(*MBB, FuncInfo->InsertPt, SDB->getCurDebugLoc(), II) .addSym(Label); - if (TM.getMCAsmInfo()->getExceptionHandlingType() == - ExceptionHandling::MSVC) { + // If this is an MSVC-style personality function, we need to split the landing + // pad into several BBs. + const BasicBlock *LLVMBB = MBB->getBasicBlock(); + const LandingPadInst *LPadInst = LLVMBB->getLandingPadInst(); + MF->getMMI().addPersonality( + MBB, cast<Function>(LPadInst->getPersonalityFn()->stripPointerCasts())); + if (MF->getMMI().getPersonalityType() == EHPersonality::Win64SEH) { // Make virtual registers and a series of labels that fill in values for the // clauses. auto &RI = MF->getRegInfo(); @@ -937,8 +942,6 @@ void SelectionDAGISel::PrepareEHLandingPad() { // Emit separate machine basic blocks with separate labels for each clause // before the main landing pad block. - const BasicBlock *LLVMBB = MBB->getBasicBlock(); - const LandingPadInst *LPadInst = LLVMBB->getLandingPadInst(); MachineInstrBuilder SelectorPHI = BuildMI( *MBB, MBB->begin(), SDB->getCurDebugLoc(), TII->get(TargetOpcode::PHI), FuncInfo->ExceptionSelectorVirtReg); |