[Mlir-commits] [mlir] [mlir][pybind] export more options on enable_ir_printing() api (PR #65854)

Mehdi Amini llvmlistbot at llvm.org
Sat Sep 9 13:54:58 PDT 2023


================
@@ -75,8 +75,10 @@ MLIR_CAPI_EXPORTED MlirLogicalResult
 mlirPassManagerRunOnOp(MlirPassManager passManager, MlirOperation op);
 
 /// Enable mlir-print-ir-after-all.
-MLIR_CAPI_EXPORTED void
-mlirPassManagerEnableIRPrinting(MlirPassManager passManager);
+MLIR_CAPI_EXPORTED void mlirPassManagerEnableIRPrinting(
+    MlirPassManager passManager, bool printBeforePass, bool printAfterPass,
+    bool printModuleScope, bool printAfterOnlyOnChange,
+    bool printAfterOnlyOnFailure, MlirOpPrintingFlags flags);
----------------
joker-eph wrote:

A list of bool isn't ideal as an API here (for C, it kind of works in Python because arguments can be named instead of being positional. Can you create config instead of setters for each flags?
Basically mimic how `MlirOpPrintingFlags` is setup here.

https://github.com/llvm/llvm-project/pull/65854


More information about the Mlir-commits mailing list