My Project
|
#include <FunctionSupport.h>
Public Types | |
using | BlockListType = Region::BlockListType |
This is the list of blocks in the function. More... | |
using | iterator = BlockListType::iterator |
using | reverse_iterator = BlockListType::reverse_iterator |
using | args_iterator = Block::args_iterator |
Public Member Functions | |
bool | isExternal () |
Returns true if this function is external, i.e. it has no body. More... | |
Region & | getBody () |
void | eraseBody () |
Delete all blocks from this function. More... | |
BlockListType & | getBlocks () |
iterator | begin () |
iterator | end () |
reverse_iterator | rbegin () |
reverse_iterator | rend () |
bool | empty () |
void | push_back (Block *block) |
void | push_front (Block *block) |
Block & | back () |
Block & | front () |
LogicalResult | verifyBody () |
TypeAttr | getTypeAttr () |
bool | isTypeAttrValid () |
unsigned | getNumArguments () |
unsigned | getNumResults () |
BlockArgument | getArgument (unsigned idx) |
Gets argument. More... | |
args_iterator | args_begin () |
args_iterator | args_end () |
iterator_range< args_iterator > | getArguments () |
ArrayRef< NamedAttribute > | getArgAttrs (unsigned index) |
Return all of the attributes for the argument at 'index'. More... | |
void | getAllArgAttrs (SmallVectorImpl< NamedAttributeList > &result) |
Return all argument attributes of this function. More... | |
Attribute | getArgAttr (unsigned index, Identifier name) |
Attribute | getArgAttr (unsigned index, StringRef name) |
template<typename AttrClass > | |
AttrClass | getArgAttrOfType (unsigned index, Identifier name) |
template<typename AttrClass > | |
AttrClass | getArgAttrOfType (unsigned index, StringRef name) |
void | setArgAttrs (unsigned index, ArrayRef< NamedAttribute > attributes) |
Set the attributes held by the argument at 'index'. More... | |
void | setArgAttrs (unsigned index, NamedAttributeList attributes) |
void | setAllArgAttrs (ArrayRef< NamedAttributeList > attributes) |
void | setArgAttr (unsigned index, Identifier name, Attribute value) |
void | setArgAttr (unsigned index, StringRef name, Attribute value) |
NamedAttributeList::RemoveResult | removeArgAttr (unsigned index, Identifier name) |
Remove the attribute 'name' from the argument at 'index'. More... | |
ArrayRef< NamedAttribute > | getResultAttrs (unsigned index) |
Return all of the attributes for the result at 'index'. More... | |
void | getAllResultAttrs (SmallVectorImpl< NamedAttributeList > &result) |
Return all result attributes of this function. More... | |
Attribute | getResultAttr (unsigned index, Identifier name) |
Attribute | getResultAttr (unsigned index, StringRef name) |
template<typename AttrClass > | |
AttrClass | getResultAttrOfType (unsigned index, Identifier name) |
template<typename AttrClass > | |
AttrClass | getResultAttrOfType (unsigned index, StringRef name) |
void | setResultAttrs (unsigned index, ArrayRef< NamedAttribute > attributes) |
Set the attributes held by the result at 'index'. More... | |
void | setResultAttrs (unsigned index, NamedAttributeList attributes) |
void | setAllResultAttrs (ArrayRef< NamedAttributeList > attributes) |
void | setResultAttr (unsigned index, Identifier name, Attribute value) |
void | setResultAttr (unsigned index, StringRef name, Attribute value) |
NamedAttributeList::RemoveResult | removeResultAttr (unsigned index, Identifier name) |
Remove the attribute 'name' from the result at 'index'. More... | |
Static Public Member Functions | |
static LogicalResult | verifyTrait (Operation *op) |
Verify that all of the argument attributes are dialect attributes. More... | |
static StringRef | getTypeAttrName () |
Return the name of the attribute used for function types. More... | |
Protected Member Functions | |
DictionaryAttr | getArgAttrDict (unsigned index) |
DictionaryAttr | getResultAttrDict (unsigned index) |
LogicalResult | verifyType () |
![]() | |
Operation * | getOperation () |
Return the ultimate Operation being worked on. More... | |
Static Protected Member Functions | |
static StringRef | getArgAttrName (unsigned index, SmallVectorImpl< char > &out) |
static StringRef | getResultAttrName (unsigned index, SmallVectorImpl< char > &out) |
![]() | |
static LogicalResult | verifyTrait (Operation *op) |
static AbstractOperation::OperationProperties | getTraitProperties () |
This trait provides APIs for Ops that behave like functions. In particular:
Symbol
trait;getTypeAttrName()
is a convenience function that returns the name of the attribute that can be used to store the function type, but the trait makes no assumption based on it.getNumFuncArguments()
that returns the number of function arguments based exclusively on type (so that it can be called on function declarations).getNumFuncResults()
that returns the number of function results based exclusively on type (so that it can be called on function declarations).verifyType()
hook that will be called after verifying the presence of the type
attribute and before any call to getNumFuncArguments
/getNumFuncResults
from the verifier.verifyBody()
hook that will be called after verifying the function type and the presence of the (potentially empty) body region. using mlir::OpTrait::FunctionLike< ConcreteType >::args_iterator = Block::args_iterator |
using mlir::OpTrait::FunctionLike< ConcreteType >::BlockListType = Region::BlockListType |
This is the list of blocks in the function.
using mlir::OpTrait::FunctionLike< ConcreteType >::iterator = BlockListType::iterator |
using mlir::OpTrait::FunctionLike< ConcreteType >::reverse_iterator = BlockListType::reverse_iterator |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Delete all blocks from this function.
|
inline |
|
inline |
Return all argument attributes of this function.
|
inline |
Return all result attributes of this function.
|
inline |
Return the specified attribute, if present, for the argument at 'index', null otherwise.
|
inline |
|
inlineprotected |
Returns the dictionary attribute corresponding to the argument at 'index'. If there are no argument attributes at 'index', a null attribute is returned.
|
inlinestaticprotected |
Returns the attribute entry name for the set of argument attributes at 'index'.
|
inline |
|
inline |
|
inline |
Return all of the attributes for the argument at 'index'.
FunctionLike operations allow for attaching attributes to each of the respective function arguments. These argument attributes are stored as DictionaryAttrs in the main operation attribute dictionary. The name of these entries is arg
followed by the index of the argument. These argument attribute dictionaries are optional, and will generally only exist if they are non-empty.
|
inline |
Gets argument.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return the specified attribute, if present, for the result at 'index', null otherwise.
|
inline |
|
inlineprotected |
Returns the dictionary attribute corresponding to the result at 'index'. If there are no result attributes at 'index', a null attribute is returned.
|
inlinestaticprotected |
Returns the attribute entry name for the set of result attributes at 'index'.
|
inline |
|
inline |
|
inline |
Return all of the attributes for the result at 'index'.
FunctionLike operations allow for attaching attributes to each of the respective function results. These result attributes are stored as DictionaryAttrs in the main operation attribute dictionary. The name of these entries is result
followed by the index of the result. These result attribute dictionaries are optional, and will generally only exist if they are non-empty.
|
inline |
|
inlinestatic |
Return the name of the attribute used for function types.
|
inline |
Returns true if this function is external, i.e. it has no body.
|
inline |
|
inline |
|
inline |
|
inline |
NamedAttributeList::RemoveResult mlir::OpTrait::FunctionLike< ConcreteType >::removeArgAttr | ( | unsigned | index, |
Identifier | name | ||
) |
Remove the attribute 'name' from the argument at 'index'.
NamedAttributeList::RemoveResult mlir::OpTrait::FunctionLike< ConcreteType >::removeResultAttr | ( | unsigned | index, |
Identifier | name | ||
) |
Remove the attribute 'name' from the result at 'index'.
|
inline |
|
inline |
|
inline |
void mlir::OpTrait::FunctionLike< ConcreteType >::setArgAttr | ( | unsigned | index, |
Identifier | name, | ||
Attribute | value | ||
) |
If the an attribute exists with the specified name, change it to the new value. Otherwise, add a new attribute with the specified name/value.
|
inline |
void mlir::OpTrait::FunctionLike< ConcreteType >::setArgAttrs | ( | unsigned | index, |
ArrayRef< NamedAttribute > | attributes | ||
) |
Set the attributes held by the argument at 'index'.
void mlir::OpTrait::FunctionLike< ConcreteType >::setArgAttrs | ( | unsigned | index, |
NamedAttributeList | attributes | ||
) |
void mlir::OpTrait::FunctionLike< ConcreteType >::setResultAttr | ( | unsigned | index, |
Identifier | name, | ||
Attribute | value | ||
) |
If the an attribute exists with the specified name, change it to the new value. Otherwise, add a new attribute with the specified name/value.
|
inline |
void mlir::OpTrait::FunctionLike< ConcreteType >::setResultAttrs | ( | unsigned | index, |
ArrayRef< NamedAttribute > | attributes | ||
) |
Set the attributes held by the result at 'index'.
void mlir::OpTrait::FunctionLike< ConcreteType >::setResultAttrs | ( | unsigned | index, |
NamedAttributeList | attributes | ||
) |
LogicalResult mlir::OpTrait::FunctionLike< ConcreteType >::verifyBody | ( | ) |
Hook for concrete ops to verify the contents of the body. Called as a part of trait verification, after type verification and ensuring that a region exists.
Default verifier checks that if the entry block exists, it has the same number of arguments as the function-like operation.
|
static |
Verify that all of the argument attributes are dialect attributes.
|
inlineprotected |
Hook for concrete classes to verify that the type attribute respects op-specific invariants. Default implementation always succeeds.