15 #ifndef CIRCT_TARGET_EXPORTSYSTEMC_EMISSIONPRINTER_H
16 #define CIRCT_TARGET_EXPORTSYSTEMC_EMISSIONPRINTER_H
19 #include "mlir/Support/IndentedOstream.h"
22 namespace ExportSystemC {
55 void emitOp(Operation *op);
94 mlir::raw_indented_ostream::DelimitedScope &scope);
99 InFlightDiagnostic
emitError(Operation *op,
const Twine &message);
103 InFlightDiagnostic
emitError(
const Twine &message);
119 mlir::raw_indented_ostream &
os;
136 StringRef rParen =
")")
const;
This class collects a set of emission patterns with base type 'PatternTy'.
This is intended to be the driving class for all pattern-based IR emission.
EmissionPrinter(mlir::raw_indented_ostream &os, OpEmissionPatternSet &opPatterns, TypeEmissionPatternSet &typePatterns, AttrEmissionPatternSet &attrPatterns, Location loc)
void emitRegion(Region ®ion)
Emit the given region to the ostream associated with this printer.
void emitOp(Operation *op)
Emit the given operation as a statement to the ostream associated with this printer according to the ...
EmissionPrinter(mlir::raw_indented_ostream &os, const FrozenOpEmissionPatternSet &opPatterns, const FrozenTypeEmissionPatternSet &typePatterns, const FrozenAttrEmissionPatternSet &attrPatterns, Location loc)
FrozenAttrEmissionPatternSet attrPatterns
InlineEmitter getInlinable(Value value)
Emit the expression represented by the given value to the ostream associated with this printer accord...
void emitAttr(Attribute attr)
Emit the given attribute to the ostream associated with this printer according to the emission patter...
LogicalResult exitState() const
Returns whether everything was printed successfully or some error occurred (e.g., there was an operat...
EmissionPrinter & operator<<(StringRef str)
FrozenTypeEmissionPatternSet typePatterns
void emitType(Type type)
Emit the given type to the ostream associated with this printer according to the emission patterns re...
mlir::raw_indented_ostream & getOstream() const
InFlightDiagnostic emitError(Operation *op, const Twine &message)
Emit an error on the operation and fail emission.
mlir::raw_indented_ostream & os
FrozenOpEmissionPatternSet opPatterns
This class is returned to a pattern that requested inlined emission of a value.
InlineEmitter(std::function< void()> emitter, Precedence precedence, EmissionPrinter &printer)
EmissionPrinter & printer
std::function< void()> emitter
Precedence getPrecedence() const
void emitWithParensOnLowerPrecedence(Precedence prec, StringRef lParen="(", StringRef rParen=")") const
Precedence
This enum encodes the precedence of C++ expressions.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.