Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Python] Ensure attribute_to_var only accesses value when legal. (llv…
…m#5612) This codepath assumes when the input attribute is not an Attribute, it has a value member. This is the case for things like StringAttr, but not for ArrayAttr. This popped up because upstream MLIR has been working to return downcasted concrete Attribute subclasses in more situations, so APIs that previously returned an Attribute might now return an ArrayAttr. A simpler testcase also reveals the issue. I've updated this path to also ensure that a value member exists before using it, and otherwise fall back to the generic code path.
- Loading branch information