mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 07:24:25 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79441 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user