numba / llvmlite

A lightweight LLVM python binding for writing JIT compilers
https://llvmlite.pydata.org/
BSD 2-Clause "Simplified" License
1.94k stars 322 forks source link

Bindings: Query type kinds, derived types, and elements #978

Closed tbennun closed 11 months ago

tbennun commented 1 year ago

This PR refactors TypeRef bindings out of value.py and enables querying types and their attributes. This includes the type kinds, derived types (e.g., the members of a struct), and element counts in arrays and vectors. Without this PR, obtaining this information could only be done via error-prone string processing.

sklam commented 11 months ago

I pushed code to address my own review in https://github.com/numba/llvmlite/pull/978#pullrequestreview-1766002637 to move this PR along so it will be included in the upcoming release.

tbennun commented 11 months ago

Thank you! I was planning to get to it later this week.