16#include <mlir/TableGen/Argument.h>
17#include <mlir/TableGen/Operator.h>
26 std::string
gen(
const mlir::tblgen::Operator &op);
34 llvm::raw_ostream &os,
const mlir::tblgen::NamedTypeConstraint &result,
35 const std::string &resultName
43 genOperand(llvm::raw_ostream &os,
const mlir::tblgen::NamedTypeConstraint &operand) = 0;
49 virtual void genAttribute(llvm::raw_ostream &os,
const mlir::tblgen::NamedAttribute &attr) = 0;
55 virtual void genRegionsPrefix(llvm::raw_ostream &os,
const mlir::tblgen::Operator &op) {}
58 virtual void genRegion(llvm::raw_ostream &os,
const mlir::tblgen::NamedRegion ®ion) = 0;
61 virtual void genRegionsSuffix(llvm::raw_ostream &os,
const mlir::tblgen::Operator &op) {}
Helper struct to generate a string from operation operand, attribute, and result pieces.
virtual void genRegionsSuffix(llvm::raw_ostream &os, const mlir::tblgen::Operator &op)
Generate region section suffix code to os. Default does nothing.
virtual void genOperand(llvm::raw_ostream &os, const mlir::tblgen::NamedTypeConstraint &operand)=0
Generate code for operand to os.
std::string gen(const mlir::tblgen::Operator &op)
Generate string from the operation pieces.
virtual void genAttributesSuffix(llvm::raw_ostream &os, const mlir::tblgen::Operator &op)
Generate attribute section suffix code to os. Default does nothing.
virtual void genResultInferred(llvm::raw_ostream &os)
Generate code to os when result type is inferred. Default does nothing.
virtual void genHeader(llvm::raw_ostream &os)
Generate header code to os. Default does nothing.
virtual void genRegion(llvm::raw_ostream &os, const mlir::tblgen::NamedRegion ®ion)=0
Generate code for region to os.
virtual ~GenStringFromOpPieces()=default
virtual void genAttributesPrefix(llvm::raw_ostream &os, const mlir::tblgen::Operator &op)
Generate attribute section prefix code to os. Default does nothing.
virtual void genResult(llvm::raw_ostream &os, const mlir::tblgen::NamedTypeConstraint &result, const std::string &resultName)=0
Generate code for result to os.
virtual void genAttribute(llvm::raw_ostream &os, const mlir::tblgen::NamedAttribute &attr)=0
Generate code for attr to os.
virtual void genRegionsPrefix(llvm::raw_ostream &os, const mlir::tblgen::Operator &op)
Generate region section prefix code to os. Default does nothing.