My Project
Public Types | Public Member Functions | Static Public Member Functions | List of all members
mlir::ModuleOp Class Reference

#include <Module.h>

Inheritance diagram for mlir::ModuleOp:
Inheritance graph
[legend]
Collaboration diagram for mlir::ModuleOp:
Collaboration graph
[legend]

Public Types

using iterator = Block::iterator
 Iteration over the operations in the module. More...
 
- Public Types inherited from mlir::Op< ModuleOp, OpTrait::ZeroOperands, OpTrait::ZeroResult, OpTrait::IsIsolatedFromAbove, OpTrait::SymbolTable, OpTrait::SingleBlockImplicitTerminator< ModuleTerminatorOp >::Impl >
using ConcreteOpType = ModuleOp
 
- Public Types inherited from mlir::OpState
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

void print (OpAsmPrinter &p)
 
LogicalResult verify ()
 
RegiongetBodyRegion ()
 Return body of this module. More...
 
BlockgetBody ()
 
Optional< StringRef > getName ()
 Return the name of this module if present. More...
 
void print (raw_ostream &os, OpPrintingFlags flags=llvm::None)
 Print the this module in the custom top-level form. More...
 
void dump ()
 
iterator begin ()
 
iterator end ()
 
Operationfront ()
 
template<typename T >
iterator_range< Block::op_iterator< T > > getOps ()
 
void push_back (Operation *op)
 Insert the operation into the back of the body, before the terminator. More...
 
void insert (Operation *insertPt, Operation *op)
 
void insert (Block::iterator insertPt, Operation *op)
 
- Public Member Functions inherited from mlir::Op< ModuleOp, OpTrait::ZeroOperands, OpTrait::ZeroResult, OpTrait::IsIsolatedFromAbove, OpTrait::SymbolTable, OpTrait::SingleBlockImplicitTerminator< ModuleTerminatorOp >::Impl >
OperationgetOperation ()
 Return the operation that this refers to. More...
 
ModuleOp clone ()
 Create a deep copy of this operation. More...
 
ModuleOp cloneWithoutRegions ()
 
DialectgetDialect ()
 Return the dialect that this refers to. More...
 
RegiongetParentRegion ()
 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...
 
- Public Member Functions inherited from mlir::OpState
 operator bool ()
 Ops are pointer-like, so we allow implicit conversion to bool. More...
 
 operator Operation * () const
 This implicitly converts to Operation*. More...
 
OperationgetOperation ()
 Return the operation that this refers to. More...
 
OperationgetParentOp ()
 
template<typename OpTy >
OpTy getParentOfType ()
 Return the closest surrounding parent operation that is of type 'OpTy'. More...
 
MLIRContextgetContext ()
 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< NamedAttributegetAttrs ()
 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)
 
- Public Member Functions inherited from mlir::FoldingHook< ModuleOp, llvm::is_one_of< OpTrait::OneResult< ModuleOp >, OpTrait::ZeroOperands< ModuleOp >... >::value >
LogicalResult fold (ArrayRef< Attribute > operands, SmallVectorImpl< OpFoldResult > &results)
 

Static Public Member Functions

static StringRef getOperationName ()
 
static void build (Builder *builder, OperationState &result, Optional< StringRef > name=llvm::None)
 
static ModuleOp create (Location loc, Optional< StringRef > name=llvm::None)
 Construct a module from the given location with an optional name. More...
 
static ParseResult parse (OpAsmParser &parser, OperationState &result)
 Operation hooks. More...
 
- Static Public Member Functions inherited from mlir::Op< ModuleOp, OpTrait::ZeroOperands, OpTrait::ZeroResult, OpTrait::IsIsolatedFromAbove, OpTrait::SymbolTable, OpTrait::SingleBlockImplicitTerminator< ModuleTerminatorOp >::Impl >
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 Public Member Functions inherited from mlir::OpState
static void getCanonicalizationPatterns (OwningRewritePatternList &results, MLIRContext *context)
 
- Static Public Member Functions inherited from mlir::OpTrait::ZeroOperands< ModuleOp >
static LogicalResult verifyTrait (Operation *op)
 
- Static Public Member Functions inherited from mlir::FoldingHook< ModuleOp, llvm::is_one_of< OpTrait::OneResult< ModuleOp >, OpTrait::ZeroOperands< ModuleOp >... >::value >
static LogicalResult foldHook (Operation *op, ArrayRef< Attribute > operands, SmallVectorImpl< OpFoldResult > &results)
 

Additional Inherited Members

- Protected Member Functions inherited from mlir::OpState
LogicalResult verify ()
 
void print (OpAsmPrinter &p)
 
 OpState (Operation *state)
 
- Protected Member Functions inherited from mlir::OpTrait::TraitBase< ModuleOp, ZeroOperands >
OperationgetOperation ()
 Return the ultimate Operation being worked on. More...
 
- Static Protected Member Functions inherited from mlir::OpState
static ParseResult parse (OpAsmParser &parser, OperationState &result)
 
- Static Protected Member Functions inherited from mlir::OpTrait::TraitBase< ModuleOp, ZeroOperands >
static LogicalResult verifyTrait (Operation *op)
 
static AbstractOperation::OperationProperties getTraitProperties ()
 

Detailed Description

ModuleOp represents a module, or an operation containing one region with a single block containing opaque operations. The region of a module is not allowed to implicitly capture global values, and all external references must use symbolic references via attributes(e.g. via a string name).

Member Typedef Documentation

◆ iterator

Iteration over the operations in the module.

Member Function Documentation

◆ begin()

iterator mlir::ModuleOp::begin ( )
inline

◆ build()

void ModuleOp::build ( Builder builder,
OperationState result,
Optional< StringRef >  name = llvm::None 
)
static

◆ create()

ModuleOp ModuleOp::create ( Location  loc,
Optional< StringRef >  name = llvm::None 
)
static

Construct a module from the given location with an optional name.

Construct a module from the given context.

◆ dump()

void ModuleOp::dump ( )

◆ end()

iterator mlir::ModuleOp::end ( )
inline

◆ front()

Operation& mlir::ModuleOp::front ( )
inline

◆ getBody()

Block * ModuleOp::getBody ( )

◆ getBodyRegion()

Region & ModuleOp::getBodyRegion ( )

Return body of this module.

◆ getName()

Optional< StringRef > ModuleOp::getName ( )

Return the name of this module if present.

◆ getOperationName()

static StringRef mlir::ModuleOp::getOperationName ( )
inlinestatic

◆ getOps()

template<typename T >
iterator_range<Block::op_iterator<T> > mlir::ModuleOp::getOps ( )
inline

This returns a range of operations of the given type 'T' held within the module.

◆ insert() [1/2]

void mlir::ModuleOp::insert ( Operation insertPt,
Operation op 
)
inline

Insert the operation at the given insertion point. Note: The operation is never inserted after the terminator, even if the insertion point is end().

◆ insert() [2/2]

void mlir::ModuleOp::insert ( Block::iterator  insertPt,
Operation op 
)
inline

◆ parse()

ParseResult ModuleOp::parse ( OpAsmParser parser,
OperationState result 
)
static

Operation hooks.

◆ print() [1/2]

void ModuleOp::print ( OpAsmPrinter p)

◆ print() [2/2]

void ModuleOp::print ( raw_ostream &  os,
OpPrintingFlags  flags = llvm::None 
)

Print the this module in the custom top-level form.

◆ push_back()

void mlir::ModuleOp::push_back ( Operation op)
inline

Insert the operation into the back of the body, before the terminator.

◆ verify()

LogicalResult ModuleOp::verify ( )

The documentation for this class was generated from the following files: