MLIR
20.0.0git
|
Public Types | |
enum class | AttrTypeElision { Never , May , Must } |
This enum describes the different kinds of elision for the type of an attribute when printing it. More... | |
Public Member Functions | |
Impl (raw_ostream &os, AsmStateImpl &state) | |
Impl (Impl &other) | |
raw_ostream & | getStream () |
Returns the output stream of the printer. More... | |
template<typename Container , typename UnaryFunctor > | |
void | interleaveComma (const Container &c, UnaryFunctor eachFn) const |
void | printAttribute (Attribute attr, AttrTypeElision typeElision=AttrTypeElision::Never) |
Print the given attribute or an alias. More... | |
void | printAttributeImpl (Attribute attr, AttrTypeElision typeElision=AttrTypeElision::Never) |
Print the given attribute without considering an alias. More... | |
LogicalResult | printAlias (Attribute attr) |
Print the alias for the given attribute, return failure if no alias could be printed. More... | |
void | printType (Type type) |
Print the given type or an alias. More... | |
void | printTypeImpl (Type type) |
Print the given type. More... | |
LogicalResult | printAlias (Type type) |
Print the alias for the given type, return failure if no alias could be printed. More... | |
void | printLocation (LocationAttr loc, bool allowAlias=false) |
Print the given location to the stream. More... | |
void | printResourceHandle (const AsmDialectResourceHandle &resource) |
Print a reference to the given resource that is owned by the given dialect. More... | |
void | printAffineMap (AffineMap map) |
void | printAffineExpr (AffineExpr expr, function_ref< void(unsigned, bool)> printValueName=nullptr) |
void | printAffineConstraint (AffineExpr expr, bool isEq) |
void | printIntegerSet (IntegerSet set) |
LogicalResult | pushCyclicPrinting (const void *opaquePointer) |
void | popCyclicPrinting () |
void | printDimensionList (ArrayRef< int64_t > shape) |
Protected Types | |
enum class | BindingStrength { Weak , Strong } |
This enum is used to represent the binding strength of the enclosing context that an AffineExprStorage is being printed in, so we can intelligently produce parens. More... | |
Protected Member Functions | |
void | printOptionalAttrDict (ArrayRef< NamedAttribute > attrs, ArrayRef< StringRef > elidedAttrs={}, bool withKeyword=false) |
void | printNamedAttribute (NamedAttribute attr) |
void | printTrailingLocation (Location loc, bool allowAlias=true) |
void | printLocationInternal (LocationAttr loc, bool pretty=false, bool isTopLevel=false) |
void | printDenseElementsAttr (DenseElementsAttr attr, bool allowHex) |
Print a dense elements attribute. More... | |
void | printDenseStringElementsAttr (DenseStringElementsAttr attr) |
Print a dense string elements attribute. More... | |
void | printDenseIntOrFPElementsAttr (DenseIntOrFPElementsAttr attr, bool allowHex) |
Print a dense elements attribute. More... | |
void | printDenseArrayAttr (DenseArrayAttr attr) |
Print a dense array attribute. More... | |
void | printDialectAttribute (Attribute attr) |
void | printDialectType (Type type) |
void | printEscapedString (StringRef str) |
Print an escaped string, wrapped with "". More... | |
void | printHexString (StringRef str) |
Print a hex string, wrapped with "". More... | |
void | printHexString (ArrayRef< char > data) |
void | printAffineExprInternal (AffineExpr expr, BindingStrength enclosingTightness, function_ref< void(unsigned, bool)> printValueName=nullptr) |
Protected Attributes | |
raw_ostream & | os |
The output stream for the printer. More... | |
AsmStateImpl & | state |
An underlying assembly printer state. More... | |
OpPrintingFlags | printerFlags |
A set of flags to control the printer's behavior. More... | |
NewLineCounter | newLine |
A tracker for the number of new lines emitted during printing. More... | |
Definition at line 400 of file AsmPrinter.cpp.
|
strong |
This enum describes the different kinds of elision for the type of an attribute when printing it.
Definition at line 415 of file AsmPrinter.cpp.
|
strongprotected |
This enum is used to represent the binding strength of the enclosing context that an AffineExprStorage is being printed in, so we can intelligently produce parens.
Enumerator | |
---|---|
Weak | |
Strong |
Definition at line 503 of file AsmPrinter.cpp.
AsmPrinter::Impl::Impl | ( | raw_ostream & | os, |
AsmStateImpl & | state | ||
) |
Definition at line 2018 of file AsmPrinter.cpp.
|
inlineexplicit |
Definition at line 403 of file AsmPrinter.cpp.
|
inline |
Returns the output stream of the printer.
Definition at line 406 of file AsmPrinter.cpp.
References os.
|
inline |
Definition at line 409 of file AsmPrinter.cpp.
References os.
void AsmPrinter::Impl::popCyclicPrinting | ( | ) |
Definition at line 2837 of file AsmPrinter.cpp.
void AsmPrinter::Impl::printAffineConstraint | ( | AffineExpr | expr, |
bool | isEq | ||
) |
Definition at line 3060 of file AsmPrinter.cpp.
void AsmPrinter::Impl::printAffineExpr | ( | AffineExpr | expr, |
function_ref< void(unsigned, bool)> | printValueName = nullptr |
||
) |
Definition at line 2922 of file AsmPrinter.cpp.
|
protected |
Definition at line 2927 of file AsmPrinter.cpp.
References mlir::Add, mlir::CeilDiv, mlir::Constant, mlir::DimId, mlir::FloorDiv, mlir::AffineExpr::getKind(), mlir::Mod, mlir::Mul, and mlir::SymbolId.
void AsmPrinter::Impl::printAffineMap | ( | AffineMap | map | ) |
Definition at line 3065 of file AsmPrinter.cpp.
References mlir::AffineMap::getNumDims(), mlir::AffineMap::getNumSymbols(), and mlir::AffineMap::getResults().
LogicalResult AsmPrinter::Impl::printAlias | ( | Attribute | attr | ) |
Print the alias for the given attribute, return failure if no alias could be printed.
Definition at line 2274 of file AsmPrinter.cpp.
LogicalResult AsmPrinter::Impl::printAlias | ( | Type | type | ) |
Print the alias for the given type, return failure if no alias could be printed.
Definition at line 2278 of file AsmPrinter.cpp.
void AsmPrinter::Impl::printAttribute | ( | Attribute | attr, |
AttrTypeElision | typeElision = AttrTypeElision::Never |
||
) |
Print the given attribute or an alias.
Definition at line 2282 of file AsmPrinter.cpp.
void AsmPrinter::Impl::printAttributeImpl | ( | Attribute | attr, |
AttrTypeElision | typeElision = AttrTypeElision::Never |
||
) |
Print the given attribute without considering an alias.
Definition at line 2295 of file AsmPrinter.cpp.
|
protected |
Print a dense array attribute.
Definition at line 2587 of file AsmPrinter.cpp.
|
protected |
Print a dense elements attribute.
If 'allowHex' is true, a hex string is used instead of individual elements when the elements attr is large.
Definition at line 2508 of file AsmPrinter.cpp.
|
protected |
Print a dense elements attribute.
If 'allowHex' is true, a hex string is used instead of individual elements when the elements attr is large.
Definition at line 2517 of file AsmPrinter.cpp.
|
protected |
Print a dense string elements attribute.
Definition at line 2580 of file AsmPrinter.cpp.
|
protected |
Definition at line 2792 of file AsmPrinter.cpp.
|
protected |
Definition at line 2806 of file AsmPrinter.cpp.
void AsmPrinter::Impl::printDimensionList | ( | ArrayRef< int64_t > | shape | ) |
Definition at line 2839 of file AsmPrinter.cpp.
References mlir::detail::printDimensionList().
|
protected |
Print an escaped string, wrapped with "".
Definition at line 2820 of file AsmPrinter.cpp.
|
protected |
Definition at line 2829 of file AsmPrinter.cpp.
|
protected |
Print a hex string, wrapped with "".
Definition at line 2826 of file AsmPrinter.cpp.
void AsmPrinter::Impl::printIntegerSet | ( | IntegerSet | set | ) |
Definition at line 3091 of file AsmPrinter.cpp.
References mlir::IntegerSet::getConstraint(), mlir::IntegerSet::getNumConstraints(), mlir::IntegerSet::getNumDims(), mlir::IntegerSet::getNumSymbols(), and mlir::IntegerSet::isEq().
void AsmPrinter::Impl::printLocation | ( | LocationAttr | loc, |
bool | allowAlias = false |
||
) |
Print the given location to the stream.
If allowAlias
is true, this allows for the internal location to use an attribute alias.
Definition at line 2173 of file AsmPrinter.cpp.
References mlir::AsmPrinter::printAlias(), and mlir::OpPrintingFlags::shouldPrintDebugInfoPrettyForm().
|
protected |
Definition at line 2030 of file AsmPrinter.cpp.
|
protected |
Definition at line 2780 of file AsmPrinter.cpp.
|
protected |
Definition at line 2747 of file AsmPrinter.cpp.
void AsmPrinter::Impl::printResourceHandle | ( | const AsmDialectResourceHandle & | resource | ) |
Print a reference to the given resource that is owned by the given dialect.
Definition at line 2183 of file AsmPrinter.cpp.
References mlir::OpAsmDialectInterface::getResourceKey().
|
protected |
Definition at line 2021 of file AsmPrinter.cpp.
References mlir::OpPrintingFlags::shouldPrintDebugInfo().
void AsmPrinter::Impl::printType | ( | Type | type | ) |
Print the given type or an alias.
Definition at line 2612 of file AsmPrinter.cpp.
void AsmPrinter::Impl::printTypeImpl | ( | Type | type | ) |
Print the given type.
Definition at line 2624 of file AsmPrinter.cpp.
LogicalResult AsmPrinter::Impl::pushCyclicPrinting | ( | const void * | opaquePointer | ) |
Definition at line 2833 of file AsmPrinter.cpp.
|
protected |
A tracker for the number of new lines emitted during printing.
Definition at line 521 of file AsmPrinter.cpp.
|
protected |
The output stream for the printer.
Definition at line 512 of file AsmPrinter.cpp.
Referenced by getStream(), and interleaveComma().
|
protected |
A set of flags to control the printer's behavior.
Definition at line 518 of file AsmPrinter.cpp.
|
protected |
An underlying assembly printer state.
Definition at line 515 of file AsmPrinter.cpp.