[Mlir-commits] [mlir] [mlir] add optional type functor to call and function interfaces (PR #146979)
River Riddle
llvmlistbot at llvm.org
Wed Jul 9 09:32:26 PDT 2025
================
@@ -783,9 +783,10 @@ class DummyAliasOperationPrinter : private OpAsmPrinter {
print(&b);
}
- void printRegionArgument(BlockArgument arg, ArrayRef<NamedAttribute> argAttrs,
- bool omitType) override {
- printType(arg.getType());
+ void printRegionArgument(
+ BlockArgument arg, ArrayRef<NamedAttribute> argAttrs, bool omitType,
+ function_ref<void(OpAsmPrinter &, Type)> typePrinter = nullptr) override {
+ typePrinter ? typePrinter(*this, arg.getType()) : printType(arg.getType());
----------------
River707 wrote:
Can you use proper if (...) ... else .... here instead? These functions don't return anything, so using an expression here is a tad magical. Same below.
https://github.com/llvm/llvm-project/pull/146979
More information about the Mlir-commits
mailing list