Skip the insertion iterator past the landingpad instruction if there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137626 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2011-08-15 18:21:07 +00:00
parent 6f9d8ffe5e
commit 1178fb4701

View File

@ -411,6 +411,7 @@ static bool OptimizeNoopCopyExpression(CastInst *CI, const TargetLowering &TLI){
if (!InsertedCast) {
BasicBlock::iterator InsertPt = UserBB->getFirstNonPHI();
if (isa<LandingPadInst>(InsertPt)) ++InsertPt;
InsertedCast =
CastInst::Create(CI->getOpcode(), CI->getOperand(0), CI->getType(), "",