Is your feature request related to a problem? Please describe.
I have multiple times accidentally used build_*_gep with the wrong pointee type thinking it would the result type in llvm15+
Describe the solution you'd like
Add a new trait potentially called IndexableType or GEPable that would restrict what types can be used in a gep instruction. it would be implemented on PointerType, VectorType, ArrayType, and StructType
Describe possible drawbacks to your solution
potentially breaks backwards compat.
Describe alternatives you've considered
paying more attention when writing gep instructions.
Is your feature request related to a problem? Please describe. I have multiple times accidentally used build_*_gep with the wrong pointee type thinking it would the result type in llvm15+
Describe the solution you'd like Add a new trait potentially called
IndexableType
orGEPable
that would restrict what types can be used in a gep instruction. it would be implemented onPointerType
,VectorType
,ArrayType
, andStructType
Describe possible drawbacks to your solution potentially breaks backwards compat.
Describe alternatives you've considered paying more attention when writing gep instructions.