From 8fbbb3980755d74539a0aed02bc18842ed2bd18d Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Tue, 19 Jul 2011 14:01:37 +0000 Subject: Convert TargetData::getIndexedOffset to use ArrayRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135478 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/TargetData.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/Target/TargetData.cpp') diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp index 4e95abad8f..5ef932ffc8 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 Indices) const { Type *Ty = ptrTy; assert(Ty->isPointerTy() && "Illegal argument for getIndexedOffset()"); uint64_t Result = 0; generic_gep_type_iterator - 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(*TI)) { assert(Indices[CurIDX]->getType() == Type::getInt32Ty(ptrTy->getContext()) && -- cgit v1.2.3-70-g09d2