[llvm-commits] [llvm] r135481 - in /llvm/trunk: docs/ReleaseNotes.html include/llvm/Support/GetElementPtrTypeIterator.h lib/Target/TargetData.cpp

Jay Foad jay.foad at gmail.com
Tue Jul 19 07:42:50 PDT 2011


Author: foad
Date: Tue Jul 19 09:42:50 2011
New Revision: 135481

URL: http://llvm.org/viewvc/llvm-project?rev=135481&view=rev
Log:
Convert gep_type_begin and gep_type_end to use ArrayRef.

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

Modified: llvm/trunk/docs/ReleaseNotes.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=135481&r1=135480&r2=135481&view=diff
==============================================================================
--- llvm/trunk/docs/ReleaseNotes.html (original)
+++ llvm/trunk/docs/ReleaseNotes.html Tue Jul 19 09:42:50 2011
@@ -635,6 +635,8 @@
 <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>

Modified: llvm/trunk/include/llvm/Support/GetElementPtrTypeIterator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/GetElementPtrTypeIterator.h?rev=135481&r1=135480&r2=135481&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/GetElementPtrTypeIterator.h (original)
+++ llvm/trunk/include/llvm/Support/GetElementPtrTypeIterator.h Tue Jul 19 09:42:50 2011
@@ -97,16 +97,16 @@
     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
 

Modified: llvm/trunk/lib/Target/TargetData.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetData.cpp?rev=135481&r1=135480&r2=135481&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetData.cpp (original)
+++ llvm/trunk/lib/Target/TargetData.cpp Tue Jul 19 09:42:50 2011
@@ -528,7 +528,7 @@
   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)) {





More information about the llvm-commits mailing list