Deleted Added
full compact
DwarfEHPrepare.cpp (206083) DwarfEHPrepare.cpp (206124)
1//===-- DwarfEHPrepare - Prepare exception handling for code generation ---===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 647 unchanged lines hidden (view full) ---

656 }
657 return false;
658}
659
660/// CreateExceptionValueCall - Insert a call to the eh.exception intrinsic at
661/// the start of the basic block (unless there already is one, in which case
662/// the existing call is returned).
663Instruction *DwarfEHPrepare::CreateExceptionValueCall(BasicBlock *BB) {
1//===-- DwarfEHPrepare - Prepare exception handling for code generation ---===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 647 unchanged lines hidden (view full) ---

656 }
657 return false;
658}
659
660/// CreateExceptionValueCall - Insert a call to the eh.exception intrinsic at
661/// the start of the basic block (unless there already is one, in which case
662/// the existing call is returned).
663Instruction *DwarfEHPrepare::CreateExceptionValueCall(BasicBlock *BB) {
664 Instruction *Start = BB->getFirstNonPHI();
664 Instruction *Start = BB->getFirstNonPHIOrDbg();
665 // Is this a call to eh.exception?
666 if (IntrinsicInst *CI = dyn_cast<IntrinsicInst>(Start))
667 if (CI->getIntrinsicID() == Intrinsic::eh_exception)
668 // Reuse the existing call.
669 return Start;
670
671 // Find the eh.exception intrinsic if we didn't already.
672 if (!ExceptionValueIntrinsic)
673 ExceptionValueIntrinsic = Intrinsic::getDeclaration(F->getParent(),
674 Intrinsic::eh_exception);
675
676 // Create the call.
677 return CallInst::Create(ExceptionValueIntrinsic, "eh.value.call", Start);
678}
679
680/// CreateValueLoad - Insert a load of the exception value stack variable
681/// (creating it if necessary) at the start of the basic block (unless
682/// there already is a load, in which case the existing load is returned).
683Instruction *DwarfEHPrepare::CreateValueLoad(BasicBlock *BB) {
665 // Is this a call to eh.exception?
666 if (IntrinsicInst *CI = dyn_cast<IntrinsicInst>(Start))
667 if (CI->getIntrinsicID() == Intrinsic::eh_exception)
668 // Reuse the existing call.
669 return Start;
670
671 // Find the eh.exception intrinsic if we didn't already.
672 if (!ExceptionValueIntrinsic)
673 ExceptionValueIntrinsic = Intrinsic::getDeclaration(F->getParent(),
674 Intrinsic::eh_exception);
675
676 // Create the call.
677 return CallInst::Create(ExceptionValueIntrinsic, "eh.value.call", Start);
678}
679
680/// CreateValueLoad - Insert a load of the exception value stack variable
681/// (creating it if necessary) at the start of the basic block (unless
682/// there already is a load, in which case the existing load is returned).
683Instruction *DwarfEHPrepare::CreateValueLoad(BasicBlock *BB) {
684 Instruction *Start = BB->getFirstNonPHI();
684 Instruction *Start = BB->getFirstNonPHIOrDbg();
685 // Is this a load of the exception temporary?
686 if (ExceptionValueVar)
687 if (LoadInst* LI = dyn_cast<LoadInst>(Start))
688 if (LI->getPointerOperand() == ExceptionValueVar)
689 // Reuse the existing load.
690 return Start;
691
692 // Create the temporary if we didn't already.

--- 44 unchanged lines hidden ---
685 // Is this a load of the exception temporary?
686 if (ExceptionValueVar)
687 if (LoadInst* LI = dyn_cast<LoadInst>(Start))
688 if (LI->getPointerOperand() == ExceptionValueVar)
689 // Reuse the existing load.
690 return Start;
691
692 // Create the temporary if we didn't already.

--- 44 unchanged lines hidden ---