Fix for testcase Transforms/IndVarsSimplify/2005-02-11-InvokeCrash.ll

and PR504.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20129 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-02-12 03:26:49 +00:00
parent 50237f28c5
commit f6249261a9

View File

@ -133,6 +133,8 @@ namespace {
if ((*UI)->getType() == Ty)
if (CastInst *CI = dyn_cast<CastInst>(cast<Instruction>(*UI))) {
BasicBlock::iterator It = I; ++It;
if (isa<InvokeInst>(I))
It = cast<InvokeInst>(I)->getNormalDest()->begin();
while (isa<PHINode>(It)) ++It;
if (It != BasicBlock::iterator(CI)) {
// Splice the cast immediately after the operand in question.