summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-08-19 18:20:44 +0000
committerDan Gohman <gohman@apple.com>2009-08-19 18:20:44 +0000
commit5d5bc6d000c1a23cae7c12575aeba27653f34921 (patch)
tree599220daf19f9bad75216568f43026ec6f50a5ca /llvm/lib/Analysis/ScalarEvolution.cpp
parent81ce842ecf7fcf59c4791c21c6f7a5124b5fd206 (diff)
downloadbcm5719-llvm-5d5bc6d000c1a23cae7c12575aeba27653f34921.tar.gz
bcm5719-llvm-5d5bc6d000c1a23cae7c12575aeba27653f34921.zip
Use hasDefinitiveInitializer() instead of testing the same thing
by hand, and fix a few places that were using hasInitializer() that appear to depend on the initializer value. llvm-svn: 79441
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 11feee7faca..efd2450ea7c 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -3638,7 +3638,7 @@ ScalarEvolution::ComputeLoadConstantCompareBackedgeTakenCount(
// Make sure that it is really a constant global we are gepping, with an
// initializer, and make sure the first IDX is really 0.
GlobalVariable *GV = dyn_cast<GlobalVariable>(GEP->getOperand(0));
- if (!GV || !GV->isConstant() || !GV->hasInitializer() ||
+ if (!GV || !GV->isConstant() || !GV->hasDefinitiveInitializer() ||
GEP->getNumOperands() < 3 || !isa<Constant>(GEP->getOperand(1)) ||
!cast<Constant>(GEP->getOperand(1))->isNullValue())
return getCouldNotCompute();
OpenPOWER on IntegriCloud