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/Target/TargetData.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/Target/TargetData.cpp')
-rw-r--r-- | llvm/lib/Target/TargetData.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Target/TargetData.cpp b/llvm/lib/Target/TargetData.cpp index 4e95abad8f8..5ef932ffc8c 100644 --- a/llvm/lib/Target/TargetData.cpp +++ b/llvm/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()) && |