|
MLIR 22.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. | |
| 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. | |
| void | printAttributeImpl (Attribute attr, AttrTypeElision typeElision=AttrTypeElision::Never) |
| Print the given attribute without considering an alias. | |
| void | printNamedAttribute (NamedAttribute attr) |
| LogicalResult | printAlias (Attribute attr) |
| Print the alias for the given attribute, return failure if no alias could be printed. | |
| void | printType (Type type) |
| Print the given type or an alias. | |
| void | printTypeImpl (Type type) |
| Print the given type. | |
| LogicalResult | printAlias (Type type) |
| Print the alias for the given type, return failure if no alias could be printed. | |
| void | printLocation (LocationAttr loc, bool allowAlias=false) |
| Print the given location to the stream. | |
| void | printResourceHandle (const AsmDialectResourceHandle &resource) |
| Print a reference to the given resource that is owned by the given dialect. | |
| 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 | 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. | |
| void | printDenseStringElementsAttr (DenseStringElementsAttr attr) |
| Print a dense string elements attribute. | |
| void | printDenseIntOrFPElementsAttr (DenseIntOrFPElementsAttr attr, bool allowHex) |
| Print a dense elements attribute. | |
| void | printDenseArrayAttr (DenseArrayAttr attr) |
| Print a dense array attribute. | |
| void | printDialectAttribute (Attribute attr) |
| void | printDialectType (Type type) |
| void | printEscapedString (StringRef str) |
| Print an escaped string, wrapped with "". | |
| void | printHexString (StringRef str) |
| Print a hex string, wrapped with "". | |
| 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. | |
| AsmStateImpl & | state |
| An underlying assembly printer state. | |
| OpPrintingFlags | printerFlags |
| A set of flags to control the printer's behavior. | |
| NewLineCounter | newLine |
| A tracker for the number of new lines emitted during printing. | |
Definition at line 413 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 428 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 516 of file AsmPrinter.cpp.
| AsmPrinter::Impl::Impl | ( | raw_ostream & | os, |
| AsmStateImpl & | state ) |
Definition at line 2114 of file AsmPrinter.cpp.
References os, printerFlags, and state.
Referenced by Impl(), printDialectAttribute(), and printDialectType().
|
inlineexplicit |
Definition at line 416 of file AsmPrinter.cpp.
|
inline |
Returns the output stream of the printer.
Definition at line 419 of file AsmPrinter.cpp.
References os.
Referenced by printDenseArrayAttr().
|
inline |
Definition at line 422 of file AsmPrinter.cpp.
References os.
Referenced by printAffineMap(), printAttributeImpl(), printLocationInternal(), printOptionalAttrDict(), and printTypeImpl().
| void AsmPrinter::Impl::popCyclicPrinting | ( | ) |
Definition at line 2944 of file AsmPrinter.cpp.
References state.
| void AsmPrinter::Impl::printAffineConstraint | ( | AffineExpr | expr, |
| bool | isEq ) |
Definition at line 3172 of file AsmPrinter.cpp.
References os, printAffineExprInternal(), and Weak.
Referenced by printIntegerSet().
| void AsmPrinter::Impl::printAffineExpr | ( | AffineExpr | expr, |
| function_ref< void(unsigned, bool)> | printValueName = nullptr ) |
Definition at line 3034 of file AsmPrinter.cpp.
References printAffineExprInternal(), and Weak.
Referenced by mlir::AffineExpr::print().
|
protected |
Definition at line 3039 of file AsmPrinter.cpp.
References mlir::Add, mlir::CeilDiv, mlir::Constant, mlir::DimId, mlir::FloorDiv, mlir::AffineExpr::getKind(), mlir::Mod, mlir::Mul, os, printAffineExprInternal(), rhs, Strong, mlir::SymbolId, and Weak.
Referenced by printAffineConstraint(), printAffineExpr(), and printAffineExprInternal().
Definition at line 3177 of file AsmPrinter.cpp.
References mlir::AffineMap::getNumDims(), mlir::AffineMap::getNumSymbols(), mlir::AffineMap::getResults(), interleaveComma(), and os.
Referenced by mlir::AffineMap::print().
| LogicalResult AsmPrinter::Impl::printAlias | ( | Attribute | attr | ) |
Print the alias for the given attribute, return failure if no alias could be printed.
Definition at line 2369 of file AsmPrinter.cpp.
Referenced by mlir::Attribute::printStripped().
| LogicalResult AsmPrinter::Impl::printAlias | ( | Type | type | ) |
Print the alias for the given type, return failure if no alias could be printed.
Definition at line 2373 of file AsmPrinter.cpp.
| void AsmPrinter::Impl::printAttribute | ( | Attribute | attr, |
| AttrTypeElision | typeElision = AttrTypeElision::Never ) |
Print the given attribute or an alias.
Definition at line 2377 of file AsmPrinter.cpp.
References os, mlir::AsmPrinter::printAlias(), and printAttributeImpl().
Referenced by mlir::Attribute::print().
| void AsmPrinter::Impl::printAttributeImpl | ( | Attribute | attr, |
| AttrTypeElision | typeElision = AttrTypeElision::Never ) |
Print the given attribute without considering an alias.
Definition at line 2389 of file AsmPrinter.cpp.
References mlir::Attribute::getDialect(), mlir::DistinctAttr::getReferencedAttr(), indices, interleaveComma(), mlir::Type::isSignlessInteger(), mlir::Type::isUnsignedInteger(), May, Must, os, mlir::AsmPrinter::printAttribute(), printDenseArrayAttr(), printDenseElementsAttr(), printDenseIntOrFPElementsAttr(), printDenseStringElementsAttr(), printDialectAttribute(), printDialectSymbol(), printElidedElementsAttr(), printerFlags, printEscapedString(), printFloatValue(), printLocation(), mlir::AsmPrinter::printResourceHandle(), printSymbolReference(), mlir::AsmPrinter::printType(), and state.
Referenced by printAttribute().
|
protected |
Print a dense array attribute.
Definition at line 2681 of file AsmPrinter.cpp.
References mlir::Type::getIntOrFloatBitWidth(), mlir::AsmPrinter::getStream(), getStream(), mlir::Type::isInteger(), mlir::Type::isIntOrIndex(), printDenseIntElement(), and printFloatValue().
Referenced by printAttributeImpl().
|
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 2602 of file AsmPrinter.cpp.
References printDenseIntOrFPElementsAttr(), and printDenseStringElementsAttr().
Referenced by printAttributeImpl().
|
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 2611 of file AsmPrinter.cpp.
References os, printDenseElementsAttrImpl(), printerFlags, and printHexString().
Referenced by printAttributeImpl(), and printDenseElementsAttr().
|
protected |
Print a dense string elements attribute.
Definition at line 2674 of file AsmPrinter.cpp.
References os, printDenseElementsAttrImpl(), and printEscapedString().
Referenced by printAttributeImpl(), and printDenseElementsAttr().
Definition at line 2899 of file AsmPrinter.cpp.
References mlir::Attribute::getDialect(), Impl(), os, printDialectSymbol(), and state.
Referenced by printAttributeImpl().
Definition at line 2913 of file AsmPrinter.cpp.
References mlir::Type::getDialect(), Impl(), os, printDialectSymbol(), and state.
Referenced by printTypeImpl().
Definition at line 2946 of file AsmPrinter.cpp.
References os, and mlir::detail::printDimensionList().
|
protected |
Print an escaped string, wrapped with "".
Definition at line 2927 of file AsmPrinter.cpp.
References os.
Referenced by printAttributeImpl(), printDenseStringElementsAttr(), and printLocationInternal().
Definition at line 2936 of file AsmPrinter.cpp.
References printHexString().
|
protected |
Print a hex string, wrapped with "".
Definition at line 2933 of file AsmPrinter.cpp.
References os.
Referenced by printDenseIntOrFPElementsAttr(), and printHexString().
| void AsmPrinter::Impl::printIntegerSet | ( | IntegerSet | set | ) |
Definition at line 3203 of file AsmPrinter.cpp.
References mlir::IntegerSet::getConstraint(), mlir::IntegerSet::getNumConstraints(), mlir::IntegerSet::getNumDims(), mlir::IntegerSet::getNumSymbols(), mlir::IntegerSet::isEq(), os, and printAffineConstraint().
Referenced by mlir::IntegerSet::print().
| 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 2268 of file AsmPrinter.cpp.
References os, mlir::AsmPrinter::printAlias(), printerFlags, and printLocationInternal().
Referenced by printAttributeImpl(), and printTrailingLocation().
|
protected |
Definition at line 2126 of file AsmPrinter.cpp.
References interleaveComma(), newLine, os, mlir::AsmPrinter::printAttribute(), printEscapedString(), printLocationInternal(), and state.
Referenced by printLocation(), and printLocationInternal().
| void AsmPrinter::Impl::printNamedAttribute | ( | NamedAttribute | attr | ) |
Definition at line 2887 of file AsmPrinter.cpp.
References mlir::NamedAttribute::getName(), mlir::NamedAttribute::getValue(), os, mlir::AsmPrinter::printAttribute(), and mlir::AsmPrinter::printKeywordOrString().
|
protected |
Definition at line 2854 of file AsmPrinter.cpp.
References mlir::NamedAttribute::getName(), interleaveComma(), os, and mlir::AsmPrinter::printNamedAttribute().
| void AsmPrinter::Impl::printResourceHandle | ( | const AsmDialectResourceHandle & | resource | ) |
Print a reference to the given resource that is owned by the given dialect.
Definition at line 2362 of file AsmPrinter.cpp.
References mlir::AsmDialectResourceHandle::getDialect(), os, mlir::AsmPrinter::printKeywordOrString(), and state.
Definition at line 2117 of file AsmPrinter.cpp.
References os, printerFlags, and printLocation().
Print the given type or an alias.
Definition at line 2706 of file AsmPrinter.cpp.
References os, mlir::AsmPrinter::printAlias(), and printTypeImpl().
Referenced by mlir::Type::print().
Print the given type.
Definition at line 2718 of file AsmPrinter.cpp.
References interleaveComma(), May, os, mlir::AsmPrinter::printAttribute(), printDialectSymbol(), printDialectType(), mlir::AsmPrinter::printDimensionList(), and mlir::AsmPrinter::printType().
Referenced by printType().
| LogicalResult AsmPrinter::Impl::pushCyclicPrinting | ( | const void * | opaquePointer | ) |
Definition at line 2940 of file AsmPrinter.cpp.
References state.
|
protected |
A tracker for the number of new lines emitted during printing.
Definition at line 534 of file AsmPrinter.cpp.
Referenced by printLocationInternal().
|
protected |
The output stream for the printer.
Definition at line 525 of file AsmPrinter.cpp.
Referenced by getStream(), Impl(), Impl(), interleaveComma(), printAffineConstraint(), printAffineExprInternal(), printAffineMap(), printAlias(), printAlias(), printAttribute(), printAttributeImpl(), printDenseIntOrFPElementsAttr(), printDenseStringElementsAttr(), printDialectAttribute(), printDialectType(), printDimensionList(), printEscapedString(), printHexString(), printIntegerSet(), printLocation(), printLocationInternal(), printNamedAttribute(), printOptionalAttrDict(), printResourceHandle(), printTrailingLocation(), printType(), and printTypeImpl().
|
protected |
A set of flags to control the printer's behavior.
Definition at line 531 of file AsmPrinter.cpp.
Referenced by Impl(), printAttributeImpl(), printDenseIntOrFPElementsAttr(), printLocation(), and printTrailingLocation().
|
protected |
An underlying assembly printer state.
Definition at line 528 of file AsmPrinter.cpp.
Referenced by Impl(), Impl(), popCyclicPrinting(), printAlias(), printAlias(), printAttributeImpl(), printDialectAttribute(), printDialectType(), printLocationInternal(), printResourceHandle(), and pushCyclicPrinting().