mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 04:29:21 +00:00
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
This commit is contained in:
parent
6595635175
commit
ea632439d4
@ -2574,7 +2574,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
|
|||||||
case Intrinsic::eh_exception: {
|
case Intrinsic::eh_exception: {
|
||||||
MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
|
MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
|
||||||
|
|
||||||
if (MMI) {
|
if (ExceptionHandling && MMI) {
|
||||||
// Mark exception register as live in.
|
// Mark exception register as live in.
|
||||||
unsigned Reg = TLI.getExceptionAddressRegister();
|
unsigned Reg = TLI.getExceptionAddressRegister();
|
||||||
if (Reg) CurMBB->addLiveIn(Reg);
|
if (Reg) CurMBB->addLiveIn(Reg);
|
||||||
@ -2596,7 +2596,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
|
|||||||
case Intrinsic::eh_filter:{
|
case Intrinsic::eh_filter:{
|
||||||
MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
|
MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
|
||||||
|
|
||||||
if (MMI) {
|
if (ExceptionHandling && MMI) {
|
||||||
// Inform the MachineModuleInfo of the personality for this landing pad.
|
// Inform the MachineModuleInfo of the personality for this landing pad.
|
||||||
ConstantExpr *CE = dyn_cast<ConstantExpr>(I.getOperand(2));
|
ConstantExpr *CE = dyn_cast<ConstantExpr>(I.getOperand(2));
|
||||||
assert(CE && CE->getOpcode() == Instruction::BitCast &&
|
assert(CE && CE->getOpcode() == Instruction::BitCast &&
|
||||||
@ -4386,12 +4386,11 @@ bool SelectionDAGISel::runOnFunction(Function &Fn) {
|
|||||||
|
|
||||||
FunctionLoweringInfo FuncInfo(TLI, Fn, MF);
|
FunctionLoweringInfo FuncInfo(TLI, Fn, MF);
|
||||||
|
|
||||||
|
if (ExceptionHandling)
|
||||||
for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
|
for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
|
||||||
if (InvokeInst *Invoke = dyn_cast<InvokeInst>(I->getTerminator())) {
|
if (InvokeInst *Invoke = dyn_cast<InvokeInst>(I->getTerminator()))
|
||||||
// Mark landing pad.
|
// Mark landing pad.
|
||||||
MachineBasicBlock *LandingPad = FuncInfo.MBBMap[Invoke->getSuccessor(1)];
|
FuncInfo.MBBMap[Invoke->getSuccessor(1)]->setIsLandingPad();
|
||||||
LandingPad->setIsLandingPad();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
|
for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
|
||||||
SelectBasicBlock(I, MF, FuncInfo);
|
SelectBasicBlock(I, MF, FuncInfo);
|
||||||
|
Loading…
Reference in New Issue
Block a user