Lines Matching defs:attribute
31 /// Parse an arbitrary attribute.
33 /// attribute-value ::= `unit`
40 /// | `[` (attribute-value (`,` attribute-value)*)? `]`
41 /// | `{` (attribute-entry (`,` attribute-entry)*)? `}`
45 /// | `sparse` `<` attribute-value `,` attribute-value `>`
49 /// | distinct-attribute
50 /// | extended-attribute
54 // Parse an AffineMap or IntegerSet attribute.
76 // Parse an array attribute.
90 // Parse a boolean attribute.
98 // Parse a dense elements attribute.
102 // Parse a dense resource elements attribute.
106 // Parse a dense array attribute.
110 // Parse a dictionary attribute.
118 // Parse an extended attribute, i.e. alias or dialect attribute.
139 // Parse a location attribute.
151 // Parse a sparse elements attribute.
155 // Parse a strided layout attribute.
159 // Parse a distinct attribute.
163 // Parse a string attribute.
175 // Parse a symbol reference attribute.
225 // Parse a 'unit' attribute.
230 // Handle completion of an attribute.
237 // Parse a type attribute. We parse `Optional` here to allow for providing a
242 return emitWrongTokenError("expected attribute value"), Attribute();
247 /// Parse an optional attribute with the provided type.
248 OptionalParseResult Parser::parseOptionalAttribute(Attribute &attribute,
268 attribute = parseAttribute(type);
269 return success(attribute != nullptr);
272 // Parse an optional type attribute.
276 attribute = TypeAttr::get(type);
280 OptionalParseResult Parser::parseOptionalAttribute(ArrayAttr &attribute,
282 return parseOptionalAttributeWithToken(Token::l_square, attribute, type);
284 OptionalParseResult Parser::parseOptionalAttribute(StringAttr &attribute,
286 return parseOptionalAttributeWithToken(Token::string, attribute, type);
295 /// attribute-dict ::= `{` `}`
296 /// | `{` attribute-entry (`,` attribute-entry)* `}`
297 /// attribute-entry ::= (bare-id | string-literal) `=` attribute-value
302 // The name of an attribute can either be a bare identifier, or a string.
310 return emitWrongTokenError("expected attribute name");
313 return emitError("expected valid attribute name");
317 << nameId->getValue() << "' in dictionary attribute";
325 // Try to parse the '=' for the attribute value.
327 // If there is no '=', we treat this as a unit attribute.
340 " in attribute dictionary");
343 /// Parse a float attribute.
347 return (emitError("floating point value too large for attribute"), nullptr);
362 /// Construct an APint from a parsed value, a known attribute type and
409 /// or a float attribute.
444 return emitError(loc, "integer constant out of range for attribute"),
477 /// Build a dense attribute instance with the parsed elements and the given
484 /// Get the parsed elements for an integer attribute.
488 /// Get the parsed elements for a float attribute.
492 /// Build a Dense String attribute for the given type.
495 /// Build a Dense attribute with hex data for the given type.
543 /// Build a dense attribute instance with the parsed elements and the given
608 /// Build a Dense Integer attribute for the given type.
652 /// Build a Dense Float attribute for the given type.
669 /// Build a Dense String attribute for the given type.
690 /// Build a Dense attribute with hex data for the given type.
714 // little-endian(LE) because HEX in raw data of dense element attribute
893 /// Parse a dense array attribute.
934 if (parseToken(Token::greater, "expected '>' to close an array attribute"))
939 /// Parse a dense elements attribute.
955 // Use the attribute location as the location for error reporting in that
980 // Parse the type of the attribute if the user didn't provide one.
997 /// Shaped type for elements attribute.
1023 /// Parse a sparse elements attribute.
1096 // Build the sparse elements attribute by the indices and values.
1178 /// Parse a distinct attribute.
1180 /// distinct-attribute ::= `distinct`
1181 /// `[` integer-literal `]<` attribute-value `>`
1199 // Parse the referenced attribute.
1211 emitError("expected attribute");
1215 if (parseToken(Token::greater, "expected '>' to close distinct attribute"))
1219 // Add the distinct attribute to the parser state, if it has not been parsed
1220 // before. Otherwise, check if the parsed reference attribute matches the one
1229 emitError(loc, "referenced attribute does not match previous definition: ")