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.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for working on this @efriedma!
llvm/include/llvm/IR/Instructions.h | ||
---|---|---|
1020 | Please add some comments/documentation for these methods. | |
llvm/lib/IR/Instructions.cpp | ||
1661–1662 | Is there a reason you didn't just call this getTypeAtIndex ? | |
1667 | 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 ? | |
1681 | nit: can this use const IndexTy &? |
llvm/lib/IR/Instructions.cpp | ||
---|---|---|
1661–1662 | 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.) | |
1667 | 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. | |
1681 | Yes, but it wouldn't really matter; IndexTy is cheap to copy. |
llvm/lib/IR/Instructions.cpp | ||
---|---|---|
1667 | Right, it's calling isIntOrIntVectorTy on the Idx, not Ty, I misread that. |
Please add some comments/documentation for these methods.