Convert gep_type_begin and gep_type_end to use ArrayRef.
authorJay Foad <jay.foad@gmail.com>
Tue, 19 Jul 2011 14:42:50 +0000 (14:42 +0000)
committerJay Foad <jay.foad@gmail.com>
Tue, 19 Jul 2011 14:42:50 +0000 (14:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135481 91177308-0d34-0410-b5e6-96231b3b80d8

docs/ReleaseNotes.html
include/llvm/Support/GetElementPtrTypeIterator.h
lib/Target/TargetData.cpp

index c7d4b48af2d44110e97c9c3e3f40917844cd76b5..ccfe2edcbcc1a262abe0be19eefc560dd30e184a 100644 (file)
@@ -635,6 +635,8 @@ from the previous release.</p>
 <li><code>ExtractValueInst::getIndexedType</code></li>
 <li><code>ExtractValueInst::getIndices</code></li>
 <li><code>FindInsertedValue</code> (in <code>llvm/Analysis/ValueTracking.h</code>)</li>
+<li><code>gep_type_begin</code> (in <code>llvm/Support/GetElementPtrTypeIterator.h</code>)</li>
+<li><code>gep_type_end</code> (in <code>llvm/Support/GetElementPtrTypeIterator.h</code>)</li>
 <li><code>IRBuilder::CreateCall</code></li>
 <li><code>IRBuilder::CreateExtractValue</code></li>
 <li><code>IRBuilder::CreateInsertValue</code></li>
index 526afd40c6f5d3bcdcee36882d08ccfe777fbc7a..ef92c95ee7e0833ed814c5dfeb954f5dd3d7e102 100644 (file)
@@ -97,16 +97,16 @@ namespace llvm {
     return gep_type_iterator::end(GEP.op_end());
   }
 
-  template<typename ItTy>
-  inline generic_gep_type_iterator<ItTy>
-  gep_type_begin(Type *Op0, ItTy I, ItTy E) {
-    return generic_gep_type_iterator<ItTy>::begin(Op0, I);
+  template<typename T>
+  inline generic_gep_type_iterator<const T *>
+  gep_type_begin(Type *Op0, ArrayRef<T> A) {
+    return generic_gep_type_iterator<const T *>::begin(Op0, A.begin());
   }
 
-  template<typename ItTy>
-  inline generic_gep_type_iterator<ItTy>
-  gep_type_end(Type *Op0, ItTy I, ItTy E) {
-    return generic_gep_type_iterator<ItTy>::end(E);
+  template<typename T>
+  inline generic_gep_type_iterator<const T *>
+  gep_type_end(Type *Op0, ArrayRef<T> A) {
+    return generic_gep_type_iterator<const T *>::end(A.end());
   }
 } // end namespace llvm
 
index 5ef932ffc8c918bafcb8c38825b9d8d65107ddc2..1dfd9a83dafb3d4dbf1aeecfe5607992a81f8b33 100644 (file)
@@ -528,7 +528,7 @@ uint64_t TargetData::getIndexedOffset(Type *ptrTy,
   uint64_t Result = 0;
 
   generic_gep_type_iterator<Value* const*>
-    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<StructType>(*TI)) {