diff --git a/mlir/docs/Dialects/emitc.md b/mlir/docs/Dialects/emitc.md --- a/mlir/docs/Dialects/emitc.md +++ b/mlir/docs/Dialects/emitc.md @@ -29,6 +29,7 @@ * 'func' Dialect * `func.call` * `func.constant` + * `func.func` * `func.return` * 'scf' Dialect * `scf.for` diff --git a/mlir/lib/Target/Cpp/TranslateToCpp.cpp b/mlir/lib/Target/Cpp/TranslateToCpp.cpp --- a/mlir/lib/Target/Cpp/TranslateToCpp.cpp +++ b/mlir/lib/Target/Cpp/TranslateToCpp.cpp @@ -574,7 +574,8 @@ return success(); } -static LogicalResult printOperation(CppEmitter &emitter, FuncOp functionOp) { +static LogicalResult printOperation(CppEmitter &emitter, + func::FuncOp functionOp) { // We need to declare variables at top if the function has multiple blocks. if (!emitter.shouldDeclareVariablesAtTop() && functionOp.getBlocks().size() > 1) { @@ -911,8 +912,7 @@ LogicalResult status = llvm::TypeSwitch(&op) // Builtin ops. - .Case( - [&](auto op) { return printOperation(*this, op); }) + .Case([&](auto op) { return printOperation(*this, op); }) // CF ops. .Case( [&](auto op) { return printOperation(*this, op); }) @@ -921,7 +921,7 @@ emitc::IncludeOp, emitc::VariableOp>( [&](auto op) { return printOperation(*this, op); }) // Func ops. - .Case( + .Case( [&](auto op) { return printOperation(*this, op); }) // SCF ops. .Case(