diff options
author | Jay Foad <jay.foad@gmail.com> | 2011-07-19 14:01:37 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2011-07-19 14:01:37 +0000 |
commit | bf904773bb917c7fee56ad103b611d50d3ef3bd9 (patch) | |
tree | 71f6b256e0370fab5f2c2fe215e91d797f63cea7 /llvm/lib/Analysis/ConstantFolding.cpp | |
parent | f4b14a2b0d0130e07944e59ac23c21578b62729e (diff) | |
download | bcm5719-llvm-bf904773bb917c7fee56ad103b611d50d3ef3bd9.tar.gz bcm5719-llvm-bf904773bb917c7fee56ad103b611d50d3ef3bd9.zip |
Convert TargetData::getIndexedOffset to use ArrayRef.
llvm-svn: 135478
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r-- | llvm/lib/Analysis/ConstantFolding.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp index 4af2ceca845..b60432be832 100644 --- a/llvm/lib/Analysis/ConstantFolding.cpp +++ b/llvm/lib/Analysis/ConstantFolding.cpp @@ -606,10 +606,10 @@ static Constant *SymbolicallyEvaluateGEP(ArrayRef<Constant *> Ops, } unsigned BitWidth = TD->getTypeSizeInBits(IntPtrTy); - APInt Offset = APInt(BitWidth, - TD->getIndexedOffset(Ptr->getType(), - (Value**)Ops.data() + 1, - Ops.size() - 1)); + APInt Offset = + APInt(BitWidth, TD->getIndexedOffset(Ptr->getType(), + makeArrayRef((Value **)Ops.data() + 1, + Ops.size() - 1))); Ptr = cast<Constant>(Ptr->stripPointerCasts()); // If this is a GEP of a GEP, fold it all into a single GEP. @@ -628,9 +628,7 @@ static Constant *SymbolicallyEvaluateGEP(ArrayRef<Constant *> Ops, Ptr = cast<Constant>(GEP->getOperand(0)); Offset += APInt(BitWidth, - TD->getIndexedOffset(Ptr->getType(), - (Value**)NestedOps.data(), - NestedOps.size())); + TD->getIndexedOffset(Ptr->getType(), NestedOps)); Ptr = cast<Constant>(Ptr->stripPointerCasts()); } |