aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-05-18 16:03:58 +0000
committerDan Gohman <gohman@apple.com>2009-05-18 16:03:58 +0000
commit8ea94524ed4dee3238689f49f28e616fb183514c (patch)
tree62541c4f4d0aeaa916f18203a8aa91eeeaa3fce4 /lib/Analysis/ScalarEvolution.cpp
parent5183caebc199afcdd26f544862c7117c96c2f150 (diff)
Fix ScalarEvolution::isLoopGuardedByCond to accept a null Loop*, for
consistency with other routines that use a null Loop* to mean code not contained by any loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72008 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index 30d6e7088c..c53ec8a5f1 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -3328,6 +3328,10 @@ ScalarEvolution::getPredecessorWithUniqueSuccessorForBB(BasicBlock *BB) {
bool ScalarEvolution::isLoopGuardedByCond(const Loop *L,
ICmpInst::Predicate Pred,
const SCEV *LHS, const SCEV *RHS) {
+ // Interpret a null as meaning no loop, where there is obviously no guard
+ // (interprocedural conditions notwithstanding).
+ if (!L) return false;
+
BasicBlock *Predecessor = getLoopPredecessor(L);
BasicBlock *PredecessorDest = L->getHeader();