[PATCH] D26594: IR: Change the gep_type_iterator API to avoid always exposing the "current" type.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 14:55:54 PST 2016


dblaikie added a comment.

I'm not quite following why this change is necessary - could you provide more detail?

What would happen/what doesn't work if we try to have generic_gep_type_iterator::operator* keep returning the Type* of the current type?



================
Comment at: llvm/include/llvm/IR/GetElementPtrTypeIterator.h:57-58
+    Type *getIndexedType() const {
+      if (CurTy.is<Type *>())
+        return CurTy.get<Type *>();
+      return CurTy.get<StructType *>()->getTypeAtIndex(getOperand());
----------------
presumably this'd be a bit better as a dyn_cast?


https://reviews.llvm.org/D26594





More information about the llvm-commits mailing list