diff options
author | Duncan Sands <baldrick@free.fr> | 2007-06-13 16:53:21 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2007-06-13 16:53:21 +0000 |
commit | ea632439d4259254670dc4a27b13d6f9370216a8 (patch) | |
tree | df84033844065efa8d29f4e3300c194121106d53 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | 6595635175764f402e7a5e53216c8d46bdce8c28 (diff) |
Only correctly lower exception handing intrinsics if exception handling is
turned on. Likewise for scanning of invokes to mark landing pads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37570 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index c870edfd68..69d51d81c2 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -2574,7 +2574,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { case Intrinsic::eh_exception: { MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); - if (MMI) { + if (ExceptionHandling && MMI) { // Mark exception register as live in. unsigned Reg = TLI.getExceptionAddressRegister(); if (Reg) CurMBB->addLiveIn(Reg); @@ -2596,7 +2596,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { case Intrinsic::eh_filter:{ MachineModuleInfo *MMI = DAG.getMachineModuleInfo(); - if (MMI) { + if (ExceptionHandling && MMI) { // Inform the MachineModuleInfo of the personality for this landing pad. ConstantExpr *CE = dyn_cast<ConstantExpr>(I.getOperand(2)); assert(CE && CE->getOpcode() == Instruction::BitCast && @@ -4386,12 +4386,11 @@ bool SelectionDAGISel::runOnFunction(Function &Fn) { FunctionLoweringInfo FuncInfo(TLI, Fn, MF); - for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) - if (InvokeInst *Invoke = dyn_cast<InvokeInst>(I->getTerminator())) { - // Mark landing pad. - MachineBasicBlock *LandingPad = FuncInfo.MBBMap[Invoke->getSuccessor(1)]; - LandingPad->setIsLandingPad(); - } + if (ExceptionHandling) + for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) + if (InvokeInst *Invoke = dyn_cast<InvokeInst>(I->getTerminator())) + // Mark landing pad. + FuncInfo.MBBMap[Invoke->getSuccessor(1)]->setIsLandingPad(); for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) SelectBasicBlock(I, MF, FuncInfo); |