MLIR  19.0.0git
Functions
mlir::emitc Namespace Reference

Functions

void buildTerminatedBody (OpBuilder &builder, Location loc)
 Default callback for builders of ops carrying a region. More...
 
std::unique_ptr< PasscreateFormExpressionsPass ()
 Creates an instance of the C-style expressions forming pass. More...
 
ExpressionOp createExpression (Operation *op, OpBuilder &builder)
 
void populateExpressionPatterns (RewritePatternSet &patterns)
 Populates patterns with expression-related patterns. More...
 
LogicalResult translateToCpp (Operation *op, raw_ostream &os, bool declareVariablesAtTop=false)
 Translates the given operation to C++ code. More...
 

Function Documentation

◆ buildTerminatedBody()

void mlir::emitc::buildTerminatedBody ( OpBuilder builder,
Location  loc 
)

Default callback for builders of ops carrying a region.

Inserts a yield without arguments.

Definition at line 52 of file EmitC.cpp.

References mlir::OpBuilder::create().

◆ createExpression()

ExpressionOp mlir::emitc::createExpression ( Operation op,
OpBuilder builder 
)

Definition at line 18 of file Transforms.cpp.

◆ createFormExpressionsPass()

std::unique_ptr< Pass > mlir::emitc::createFormExpressionsPass ( )

Creates an instance of the C-style expressions forming pass.

Definition at line 58 of file FormExpressions.cpp.

◆ populateExpressionPatterns()

void mlir::emitc::populateExpressionPatterns ( RewritePatternSet patterns)

Populates patterns with expression-related patterns.

Definition at line 109 of file Transforms.cpp.

References mlir::RewritePatternSet::add(), and mlir::RewritePatternSet::getContext().

◆ translateToCpp()

LogicalResult mlir::emitc::translateToCpp ( Operation op,
raw_ostream &  os,
bool  declareVariablesAtTop = false 
)

Translates the given operation to C++ code.

The operation or operations in the region of 'op' need almost all be in EmitC dialect. The parameter 'declareVariablesAtTop' enforces that all variables for op results and block arguments are declared at the beginning of the function.

Definition at line 1398 of file TranslateToCpp.cpp.