aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/TargetData.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2011-07-19 14:01:37 +0000
committerJay Foad <jay.foad@gmail.com>2011-07-19 14:01:37 +0000
commit8fbbb3980755d74539a0aed02bc18842ed2bd18d (patch)
tree2fc3d8aa307866ae8c2e2ca38d196c87caa7a435 /lib/Target/TargetData.cpp
parent1d2f569c3428d70d0cf690c9adb459ad4a3ecff2 (diff)
downloadexternal_llvm-8fbbb3980755d74539a0aed02bc18842ed2bd18d.zip
external_llvm-8fbbb3980755d74539a0aed02bc18842ed2bd18d.tar.gz
external_llvm-8fbbb3980755d74539a0aed02bc18842ed2bd18d.tar.bz2
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/Target/TargetData.cpp')
-rw-r--r--lib/Target/TargetData.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index 4e95aba..5ef932f 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -521,15 +521,16 @@ IntegerType *TargetData::getIntPtrType(LLVMContext &C) const {
}
-uint64_t TargetData::getIndexedOffset(Type *ptrTy, Value* const* Indices,
- unsigned NumIndices) const {
+uint64_t TargetData::getIndexedOffset(Type *ptrTy,
+ ArrayRef<Value *> Indices) const {
Type *Ty = ptrTy;
assert(Ty->isPointerTy() && "Illegal argument for getIndexedOffset()");
uint64_t Result = 0;
generic_gep_type_iterator<Value* const*>
- TI = gep_type_begin(ptrTy, Indices, Indices+NumIndices);
- for (unsigned CurIDX = 0; CurIDX != NumIndices; ++CurIDX, ++TI) {
+ TI = gep_type_begin(ptrTy, Indices.begin(), Indices.end());
+ for (unsigned CurIDX = 0, EndIDX = Indices.size(); CurIDX != EndIDX;
+ ++CurIDX, ++TI) {
if (StructType *STy = dyn_cast<StructType>(*TI)) {
assert(Indices[CurIDX]->getType() ==
Type::getInt32Ty(ptrTy->getContext()) &&