diff --git a/mlir/include/mlir/IR/FunctionSupport.h b/mlir/include/mlir/IR/FunctionSupport.h --- a/mlir/include/mlir/IR/FunctionSupport.h +++ b/mlir/include/mlir/IR/FunctionSupport.h @@ -206,6 +206,7 @@ //===--------------------------------------------------------------------===// // Argument Handling //===--------------------------------------------------------------------===// + using BlockArgListType = Region::BlockArgListType; unsigned getNumArguments() { return static_cast(this)->getNumFuncArguments(); @@ -218,12 +219,19 @@ /// Gets argument. BlockArgument getArgument(unsigned idx) { return getBody().getArgument(idx); } + /// Add one value to the argument list. + BlockArgument addArgument(Type type) { return getBody().addArgument(type); } + /// Support argument iteration. using args_iterator = Region::args_iterator; args_iterator args_begin() { return getBody().args_begin(); } args_iterator args_end() { return getBody().args_end(); } Block::BlockArgListType getArguments() { return getBody().getArguments(); } + ValueTypeRange getArgumentTypes() { + return getBody().getArgumentTypes(); + } + //===--------------------------------------------------------------------===// // Argument Attributes //===--------------------------------------------------------------------===//