The existence of the class is more confusing than helpful, I think; the commonality is mostly just "GEP is legal", which can be queried using APIs on GetElementPtrInst.
Thanks for working on this @efriedma!
Please add some comments/documentation for these methods.
Is there a reason you didn't just call this getTypeAtIndex ?
Maybe I'm misunderstanding this method, but checking that the indexed type is of type integer, does that exclude the case:
getelementptr float, float* %ptr, i64 0
nit: can this use const IndexTy &?
I guess I could call it that; didn't really think much about the name. (I originally thought of it as splitting out each "step" of getIndexedType into a separate method.)
The point of the isIntOrIntVectorTy() check is to exclude something silly like a float index into an array. It has nothing to do with the type of the pointer.
Yes, but it wouldn't really matter; IndexTy is cheap to copy.