15 #include "llvm/ADT/StringExtras.h"
30 spirv::MemoryAccess memoryAccessAttr;
31 if (spirv::parseEnumStrAttr<spirv::MemoryAccessAttr>(memoryAccessAttr, parser,
35 if (spirv::bitEnumContainsAll(memoryAccessAttr,
36 spirv::MemoryAccess::Aligned)) {
52 auto builtInName = llvm::convertToSnakeFromCamelCase(
53 stringifyDecoration(spirv::Decoration::BuiltIn));
58 stringifyDecoration(spirv::Decoration::DescriptorSet));
59 auto bindingName = llvm::convertToSnakeFromCamelCase(
60 stringifyDecoration(spirv::Decoration::Binding));
static std::string bindingName()
Returns the string name of the Binding decoration.
static std::string descriptorSetName()
Returns the string name of the DescriptorSet decoration.
virtual Builder & getBuilder() const =0
Return a builder which provides useful access to MLIRContext, global objects like types and attribute...
virtual ParseResult parseOptionalAttrDict(NamedAttrList &result)=0
Parse a named dictionary into 'result' if it is present.
virtual ParseResult parseOptionalKeyword(StringRef keyword)=0
Parse the given keyword if present.
virtual ParseResult parseRParen()=0
Parse a ) token.
virtual ParseResult parseRSquare()=0
Parse a ] token.
virtual ParseResult parseLParen()=0
Parse a ( token.
virtual ParseResult parseComma()=0
Parse a , token.
virtual ParseResult parseOptionalLSquare()=0
Parse a [ token if present.
virtual ParseResult parseAttribute(Attribute &result, Type type={})=0
Parse an arbitrary attribute of a given type and return it in result.
Attributes are known-constant values of operations.
IntegerType getIntegerType(unsigned width)
The OpAsmParser has methods for interacting with the asm parser: parsing things from it,...
This class represents success/failure for parsing-like operations that find it important to chain tog...
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
constexpr char kAlignmentAttrName[]
ParseResult parseMemoryAccessAttributes(OpAsmParser &parser, OperationState &state, StringRef attrName)
Parses optional memory access (a.k.a.
ParseResult parseVariableDecorations(OpAsmParser &parser, OperationState &state)
LogicalResult failure(bool isFailure=true)
Utility function to generate a LogicalResult.
bool succeeded(LogicalResult result)
Utility function that returns true if the provided LogicalResult corresponds to a success value.
LogicalResult success(bool isSuccess=true)
Utility function to generate a LogicalResult.
This represents an operation in an abstracted form, suitable for use with the builder APIs.