Previously only accessing values for index and signless int types
would work; signed and unsigned ints would hit an assert in
IntegerAttr::getInt. This exposes IntegerAttr::get{S,U}Int to the C
API and calls the appropriate function from the python bindings.
Details
Details
- Reviewers
ftynse - Commits
- rGe9db306dcd53: [mlir][python] Support more types in IntegerAttr.value
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Bindings/Python/IRAttributes.cpp | ||
---|---|---|
262 | Is the type ever not an integer? This check feels more like assertion, especially given that the code inside the conditional does nothing for signless integers. |
mlir/lib/Bindings/Python/IRAttributes.cpp | ||
---|---|---|
262 | Yes, the index type would fail the "is integer" check and fall through to the signless case. I've updated the logic here to make the handling of index clearer. |
Is the type ever not an integer? This check feels more like assertion, especially given that the code inside the conditional does nothing for signless integers.