func::FuncOp

I am new to MLIR!

mlir::FunctionType funcType =
      builder.getFunctionType(argTypes, resultType);
mlir::func::FuncOp f =
      builder.create<mlir::func::FuncOp>(location, sig.getName(), funcType);
assert(f.getArgumentTypes().size() == 1);
assert(f.getResultTypes().size() == 1);

The func dialect talks about external function definitions and functions with body. How can I create either one? I have feeling that f has no body.

The function has an empty region after creation, you can just push a new block there to build a body.

THANKS for the quick answer on Saturday night!!!