[all-commits] [llvm/llvm-project] 8d6b24: [mlir] Make `TypedStrAttr` actually enforce the st...
Ingo Müller via All-commits
all-commits at lists.llvm.org
Wed Jan 29 04:32:58 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8d6b24167b7bdc7ac9c969abe73be857bbcf2b5a
https://github.com/llvm/llvm-project/commit/8d6b24167b7bdc7ac9c969abe73be857bbcf2b5a
Author: Ingo Müller <ingomueller at google.com>
Date: 2025-01-29 (Wed, 29 Jan 2025)
Changed paths:
M mlir/include/mlir/IR/CommonAttrConstraints.td
M mlir/test/IR/attribute.mlir
M mlir/test/lib/Dialect/Test/TestOps.td
Log Message:
-----------
[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 at google.com>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list