diff --git a/mlir/docs/LangRef.md b/mlir/docs/LangRef.md --- a/mlir/docs/LangRef.md +++ b/mlir/docs/LangRef.md @@ -1369,39 +1369,39 @@ Similarly to operations, dialects may define custom attribute values. The syntactic structure of these values is identical to custom dialect type values, -except that dialect attributes values are distinguished with a leading '#', -while dialect types are distinguished with a leading '!'. +except that dialect attribute values are distinguished with a leading '#', while +dialect types are distinguished with a leading '!'. ``` -dialect-attribute ::= '#' opaque-dialect-item -dialect-attribute ::= '#' pretty-dialect-item +dialect-attribute-value ::= '#' opaque-dialect-item +dialect-attribute-value ::= '#' pretty-dialect-item ``` -Dialect attributes can be specified in a verbose form, e.g. like this: +Dialect attribute values can be specified in a verbose form, e.g. like this: ```mlir -// Complex attribute +// Complex attribute value. #foo<"something"> -// Even more complex attribute +// Even more complex attribute value. #foo<"something>>"> ``` -Dialect attributes that are simple enough can use the pretty format, which is a -lighter weight syntax that is equivalent to the above forms: +Dialect attribute values that are simple enough can use the pretty format, which +is a lighter weight syntax that is equivalent to the above forms: ```mlir // Complex attribute #foo.something ``` -Sufficiently complex dialect attributes are required to use the verbose form for -generality. For example, the more complex type shown above wouldn't be valid in -the lighter syntax: `#foo.something>>` because it contains characters -that are not allowed in the lighter syntax, as well as unbalanced `<>` -characters. +Sufficiently complex dialect attribute values are required to use the verbose +form for generality. For example, the more complex type shown above would not be +valid in the lighter syntax: `#foo.something>>` because it contains +characters that are not allowed in the lighter syntax, as well as unbalanced +`<>` characters. -See [here](Tutorials/DefiningAttributesAndTypes.md) to learn how to define dialect +See [here](Tutorials/DefiningAttributesAndTypes.md) on how to define dialect attribute values. ### Standard Attribute Values diff --git a/mlir/lib/IR/BuiltinDialect.cpp b/mlir/lib/IR/BuiltinDialect.cpp --- a/mlir/lib/IR/BuiltinDialect.cpp +++ b/mlir/lib/IR/BuiltinDialect.cpp @@ -228,9 +228,9 @@ ArrayRef{mlir::SymbolTable::getSymbolAttrName(), mlir::SymbolTable::getVisibilityAttrName()}, attr.first.strref())) - return op.emitOpError() - << "can only contain dialect-specific attributes, found: '" - << attr.first << "'"; + return op.emitOpError() << "can only contain attributes with " + "dialect-prefixed names, found: '" + << attr.first << "'"; } return success(); diff --git a/mlir/test/IR/invalid-module-op.mlir b/mlir/test/IR/invalid-module-op.mlir --- a/mlir/test/IR/invalid-module-op.mlir +++ b/mlir/test/IR/invalid-module-op.mlir @@ -44,7 +44,7 @@ // ----- -// expected-error@+1 {{can only contain dialect-specific attributes}} +// expected-error@+1 {{can only contain attributes with dialect-prefixed names}} module attributes {attr} { }