[PATCH] D16282: [opaque pointer types] [breaking-change] [NFC] Refactor gep_type_iterator and getIndexedOffset not to touch PointerType::getElementType.

Manuel Jacob via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 16:25:06 PST 2016


mjacob added a comment.

The title of this revision seems to be wrong. I don't see any changes to the API of `gep_type_iterator`.


================
Comment at: include/llvm/IR/DataLayout.h:446
@@ -444,3 +445,3 @@
   /// This is used to implement getelementptr.
-  uint64_t getIndexedOffset(Type *Ty, ArrayRef<Value *> Indices) const;
+  uint64_t getIndexedOffsetInType(Type *ElemTy, ArrayRef<Value *> Indices) const;
 
----------------
I'd like to hear another comment on the name before you commit this.

================
Comment at: lib/IR/DataLayout.cpp:730-732
@@ -731,2 +729,5 @@
 
+  // We can use 0 as the address space as we don't need
+  // to get pointer types back from gep_type_iterator.
+  unsigned AS = 0;
   generic_gep_type_iterator<Value* const*>
----------------
I don't really like this. If this is required, we should consider changing the generic_gep_type_iterator API first.


http://reviews.llvm.org/D16282





More information about the llvm-commits mailing list