9 #ifndef MLIR_TOOLS_PDLL_ODS_CONTEXT_H_
10 #define MLIR_TOOLS_PDLL_ODS_CONTEXT_H_
15 #include "llvm/ADT/STLExtras.h"
16 #include "llvm/ADT/SmallVector.h"
17 #include "llvm/ADT/StringMap.h"
26 class AttributeConstraint;
58 return llvm::make_pointee_range(llvm::make_second_range(dialects));
64 std::pair<Operation *, bool>
66 StringRef nativeClassName,
bool supportsResultTypeInferrence,
74 void print(raw_ostream &os)
const;
77 llvm::StringMap<std::unique_ptr<AttributeConstraint>> attributeConstraints;
78 llvm::StringMap<std::unique_ptr<Dialect>> dialects;
79 llvm::StringMap<std::unique_ptr<TypeConstraint>> typeConstraints;
This class represents a generic ODS Attribute constraint.
This class contains all of the registered ODS operation classes.
std::pair< Operation *, bool > insertOperation(StringRef name, StringRef summary, StringRef desc, StringRef nativeClassName, bool supportsResultTypeInferrence, SMLoc loc)
Insert a new operation with the context.
const TypeConstraint & insertTypeConstraint(StringRef name, StringRef summary, StringRef cppClass)
Insert a new type constraint with the context.
auto getDialects() const
Return a range of all of the registered dialects.
Dialect & insertDialect(StringRef name)
Insert a new dialect with the context.
const Dialect * lookupDialect(StringRef name) const
Lookup a dialect registered with the given name, or null if no dialect with that name was inserted.
const AttributeConstraint & insertAttributeConstraint(StringRef name, StringRef summary, StringRef cppClass)
Insert a new attribute constraint with the context.
const Operation * lookupOperation(StringRef name) const
Lookup an operation registered with the given name, or null if no operation with that name is registe...
void print(raw_ostream &os) const
Print the contents of this context to the provided stream.
This class represents an ODS dialect, and contains information on the constructs held within the dial...
This class provides an ODS representation of a specific operation.
This class represents a generic ODS Type constraint.
The OpAsmOpInterface, see OpAsmInterface.td for more details.
Include the generated interface declarations.