aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/SCCP.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/SCCP.cpp')
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 3557cad..1c39160 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -753,13 +753,13 @@ static Constant *GetGEPGlobalInitializer(Constant *C, ConstantExpr *CE) {
if (ConstantUInt *CU = dyn_cast<ConstantUInt>(CE->getOperand(i))) {
ConstantStruct *CS = dyn_cast<ConstantStruct>(C);
if (CS == 0) return 0;
- if (CU->getValue() >= CS->getValues().size()) return 0;
- C = cast<Constant>(CS->getValues()[CU->getValue()]);
+ if (CU->getValue() >= CS->getNumOperands()) return 0;
+ C = CS->getOperand(CU->getValue());
} else if (ConstantSInt *CS = dyn_cast<ConstantSInt>(CE->getOperand(i))) {
ConstantArray *CA = dyn_cast<ConstantArray>(C);
if (CA == 0) return 0;
- if ((uint64_t)CS->getValue() >= CA->getValues().size()) return 0;
- C = cast<Constant>(CA->getValues()[CS->getValue()]);
+ if ((uint64_t)CS->getValue() >= CA->getNumOperands()) return 0;
+ C = CA->getOperand(CS->getValue());
} else
return 0;
return C;