llvm-project
8d6b2416 - [mlir] Make `TypedStrAttr` actually enforce the string type. (#124770)

Commit
248 days ago
[mlir] Make `TypedStrAttr` actually enforce the string type. (#124770) The tablgen definition `TypedStrAttr` is an attribute constraints that is meant to restrict the type of a `StringAttr` to the type given as parameter. However, the definition did not previously restrict the type; any `StringAttr` was accepted. This PR makes the definition actually enforce the type. To test the constraints, the PR also changes the test op that was previously used to test this constraint such that the enforced type is `AnyInteger` instead of `AnyType`. The latter allowed any type, so not enforcing that constraint had no observable effect. The PR then adds a test case with a wrong type and ensures that diagnostics are produced. Signed-off-by: Ingo Müller <ingomueller@google.com>
Parents
Loading