From: Jay Foad
Date: Tue, 19 Jul 2011 14:42:50 +0000 (+0000)
Subject: Convert gep_type_begin and gep_type_end to use ArrayRef.
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ca12a2139e7ed8b5f30df9927494dd7aae929a7c;hp=8fbbb3980755d74539a0aed02bc18842ed2bd18d;p=oota-llvm.git
Convert gep_type_begin and gep_type_end to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135481 91177308-0d34-0410-b5e6-96231b3b80d8
---
diff --git a/docs/ReleaseNotes.html b/docs/ReleaseNotes.html
index c7d4b48af2d..ccfe2edcbcc 100644
--- a/docs/ReleaseNotes.html
+++ b/docs/ReleaseNotes.html
@@ -635,6 +635,8 @@ from the previous release.
ExtractValueInst::getIndexedType
ExtractValueInst::getIndices
FindInsertedValue
(in llvm/Analysis/ValueTracking.h
)
+gep_type_begin
(in llvm/Support/GetElementPtrTypeIterator.h
)
+gep_type_end
(in llvm/Support/GetElementPtrTypeIterator.h
)
IRBuilder::CreateCall
IRBuilder::CreateExtractValue
IRBuilder::CreateInsertValue
diff --git a/include/llvm/Support/GetElementPtrTypeIterator.h b/include/llvm/Support/GetElementPtrTypeIterator.h
index 526afd40c6f..ef92c95ee7e 100644
--- a/include/llvm/Support/GetElementPtrTypeIterator.h
+++ b/include/llvm/Support/GetElementPtrTypeIterator.h
@@ -97,16 +97,16 @@ namespace llvm {
return gep_type_iterator::end(GEP.op_end());
}
- template
- inline generic_gep_type_iterator
- gep_type_begin(Type *Op0, ItTy I, ItTy E) {
- return generic_gep_type_iterator::begin(Op0, I);
+ template
+ inline generic_gep_type_iterator
+ gep_type_begin(Type *Op0, ArrayRef A) {
+ return generic_gep_type_iterator::begin(Op0, A.begin());
}
- template
- inline generic_gep_type_iterator
- gep_type_end(Type *Op0, ItTy I, ItTy E) {
- return generic_gep_type_iterator::end(E);
+ template
+ inline generic_gep_type_iterator
+ gep_type_end(Type *Op0, ArrayRef A) {
+ return generic_gep_type_iterator::end(A.end());
}
} // end namespace llvm
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index 5ef932ffc8c..1dfd9a83daf 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -528,7 +528,7 @@ uint64_t TargetData::getIndexedOffset(Type *ptrTy,
uint64_t Result = 0;
generic_gep_type_iterator
- TI = gep_type_begin(ptrTy, Indices.begin(), Indices.end());
+ TI = gep_type_begin(ptrTy, Indices);
for (unsigned CurIDX = 0, EndIDX = Indices.size(); CurIDX != EndIDX;
++CurIDX, ++TI) {
if (StructType *STy = dyn_cast(*TI)) {