diff options
author | Chris Lattner <sabre@nondot.org> | 2001-12-04 08:13:06 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-12-04 08:13:06 +0000 |
commit | d23d752dc5708a037de314b95bf8285ebea3155f (patch) | |
tree | 8f9be1dc0874b84ace3830b971d6ed2126f76e07 /llvm/lib/Transforms | |
parent | 4c160c39b40a4ac98df975d560ea71425ab25c08 (diff) | |
download | bcm5719-llvm-d23d752dc5708a037de314b95bf8285ebea3155f.tar.gz bcm5719-llvm-d23d752dc5708a037de314b95bf8285ebea3155f.zip |
Fix bugs, don't do external methods which causes segv.
llvm-svn: 1414
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index a6e0bd12534..3b64756cb19 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -127,7 +127,8 @@ static bool TransformLoop(cfg::LoopInfo *Loops, cfg::Loop *Loop) { #ifdef DEBUG cerr << IndVars[i]; #endif - if (IV != Cannonical) { // Don't modify the cannonical indvar + // Don't modify the cannonical indvar or unrecognized indvars... + if (IV != Cannonical && IV->InductionType != InductionVariable::Unknown) { Instruction *Val = IterCount; if (!isa<ConstantInt>(IV->Step) || // If the step != 1 !cast<ConstantInt>(IV->Step)->equalsInt(1)) { @@ -183,6 +184,8 @@ static bool TransformLoop(cfg::LoopInfo *Loops, cfg::Loop *Loop) { } bool InductionVariableSimplify::doit(Method *M) { + if (M->isExternal()) return false; + // Figure out the loop structure of the method... cfg::LoopInfo Loops(M); |