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 | 8fbbb3980755d74539a0aed02bc18842ed2bd18d (patch) | |
tree | 2fc3d8aa307866ae8c2e2ca38d196c87caa7a435 /lib/Analysis/ConstantFolding.cpp | |
parent | 1d2f569c3428d70d0cf690c9adb459ad4a3ecff2 (diff) |
Convert TargetData::getIndexedOffset to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135478 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ConstantFolding.cpp')
-rw-r--r-- | lib/Analysis/ConstantFolding.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp index 4af2ceca84..b60432be83 100644 --- a/lib/Analysis/ConstantFolding.cpp +++ b/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()); } |