aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/IndVarSimplify.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-02-12 03:26:49 +0000
committerChris Lattner <sabre@nondot.org>2005-02-12 03:26:49 +0000
commitf6249261a9467cb93c4ccf5ae24798e2977db5a0 (patch)
treea5784e15d8fe043d184082d9e63891dbccdec13d /lib/Transforms/Scalar/IndVarSimplify.cpp
parent50237f28c5b8774fb48008828a0ea35cbdee7e7b (diff)
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
Diffstat (limited to 'lib/Transforms/Scalar/IndVarSimplify.cpp')
-rw-r--r--lib/Transforms/Scalar/IndVarSimplify.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp
index 7ad8ef403c..bc86702956 100644
--- a/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -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.