My Project
|
#include <OpDefinition.h>
Classes | |
struct | Trait |
Public Types | |
using | Concept = typename Traits::Concept |
template<typename T > | |
using | Model = typename Traits::template Model< T > |
![]() | |
using | ConcreteOpType = ConcreteType |
![]() | |
using | dialect_attr_iterator = Operation::dialect_attr_iterator |
A utility iterator that filters out non-dialect attributes. More... | |
using | dialect_attr_range = Operation::dialect_attr_range |
Public Member Functions | |
OpInterface (Operation *op=nullptr) | |
![]() | |
Operation * | getOperation () |
Return the operation that this refers to. More... | |
ConcreteType | clone () |
Create a deep copy of this operation. More... | |
ConcreteType | cloneWithoutRegions () |
Dialect * | getDialect () |
Return the dialect that this refers to. More... | |
Region * | getParentRegion () |
Return the parent Region of this operation. More... | |
Op () | |
This is a public constructor. Any op can be initialized to null. More... | |
Op (std::nullptr_t) | |
Op (Operation *state) | |
const void * | getAsOpaquePointer () const |
Methods for supporting PointerLikeTypeTraits. More... | |
![]() | |
operator bool () | |
Ops are pointer-like, so we allow implicit conversion to bool. More... | |
operator Operation * () const | |
This implicitly converts to Operation*. More... | |
Operation * | getOperation () |
Return the operation that this refers to. More... | |
Operation * | getParentOp () |
template<typename OpTy > | |
OpTy | getParentOfType () |
Return the closest surrounding parent operation that is of type 'OpTy'. More... | |
MLIRContext * | getContext () |
Return the context this operation belongs to. More... | |
void | print (raw_ostream &os, OpPrintingFlags flags=llvm::None) |
Print the operation to the given stream. More... | |
void | dump () |
Dump this operation. More... | |
Location | getLoc () |
The source location the operation was defined or derived from. More... | |
void | setLoc (Location loc) |
ArrayRef< NamedAttribute > | getAttrs () |
Return all of the attributes on this operation. More... | |
dialect_attr_range | getDialectAttrs () |
Return a range corresponding to the dialect attributes for this operation. More... | |
dialect_attr_iterator | dialect_attr_begin () |
dialect_attr_iterator | dialect_attr_end () |
Attribute | getAttr (StringRef name) |
Return an attribute with the specified name. More... | |
template<typename AttrClass > | |
AttrClass | getAttrOfType (StringRef name) |
If the operation has an attribute of the specified type, return it. More... | |
void | setAttr (Identifier name, Attribute value) |
void | setAttr (StringRef name, Attribute value) |
void | setAttrs (ArrayRef< NamedAttribute > attributes) |
Set the attributes held by this operation. More... | |
void | setAttrs (NamedAttributeList newAttrs) |
template<typename DialectAttrs > | |
void | setDialectAttrs (DialectAttrs &&attrs) |
Set the dialect attributes for this operation, and preserve all dependent. More... | |
NamedAttributeList::RemoveResult | removeAttr (Identifier name) |
NamedAttributeList::RemoveResult | removeAttr (StringRef name) |
bool | use_empty () |
Return true if there are no users of any results of this operation. More... | |
void | erase () |
Remove this operation from its parent block and delete it. More... | |
InFlightDiagnostic | emitOpError (const Twine &message={}) |
InFlightDiagnostic | emitError (const Twine &message={}) |
InFlightDiagnostic | emitWarning (const Twine &message={}) |
InFlightDiagnostic | emitRemark (const Twine &message={}) |
template<typename FnT , typename RetT = detail::walkResultType<FnT>> | |
RetT | walk (FnT &&callback) |
![]() | |
LogicalResult | fold (ArrayRef< Attribute > operands, SmallVectorImpl< OpFoldResult > &results) |
Static Public Member Functions | |
static bool | classof (Operation *op) |
static ClassID * | getInterfaceID () |
Define an accessor for the ID of this interface. More... | |
![]() | |
static constexpr bool | hasTrait () |
Return if this operation contains the provided trait. More... | |
static bool | classof (Operation *op) |
Return true if this "op class" can match against the specified operation. More... | |
static ParseResult | parseAssembly (OpAsmParser &parser, OperationState &result) |
static void | printAssembly (Operation *op, OpAsmPrinter &p) |
static LogicalResult | verifyInvariants (Operation *op) |
static AbstractOperation::OperationProperties | getOperationProperties () |
static ConcreteOpType | getFromOpaquePointer (const void *pointer) |
![]() | |
static void | getCanonicalizationPatterns (OwningRewritePatternList &results, MLIRContext *context) |
![]() | |
static LogicalResult | foldHook (Operation *op, ArrayRef< Attribute > operands, SmallVectorImpl< OpFoldResult > &results) |
Protected Member Functions | |
Concept * | getImpl () |
Get the raw concept in the correct derived concept type. More... | |
![]() | |
LogicalResult | verify () |
void | print (OpAsmPrinter &p) |
OpState (Operation *state) | |
Additional Inherited Members | |
![]() | |
static ParseResult | parse (OpAsmParser &parser, OperationState &result) |
This class represents the base of an operation interface. Operation interfaces provide access to derived Op properties through an opaquely Operation instance. Derived interfaces must also provide a 'Traits' class that defines a 'Concept' and a 'Model' class. The 'Concept' class defines an abstract virtual interface, where as the 'Model' class implements this interface for a specific derived *Op type. Both of these classes *must not contain non-static data. A simple example is shown below:
struct ExampleOpInterfaceTraits { struct Concept { virtual unsigned getNumInputs(Operation *op) = 0; }; template <typename opt>=""> class Model { unsigned getNumInputs(Operation *op) final { return cast<OpT>(op).getNumInputs(); } }; };
using mlir::OpInterface< ConcreteType, Traits >::Concept = typename Traits::Concept |
using mlir::OpInterface< ConcreteType, Traits >::Model = typename Traits::template Model<T> |
|
inline |
|
inlinestatic |
Support 'classof' by checking if the given operation defines the concrete interface.
|
inlineprotected |
Get the raw concept in the correct derived concept type.
|
inlinestatic |
Define an accessor for the ID of this interface.