[Mlir-commits] [mlir] [mlir] Add the ability to override attribute parsing/printing in attr-dicts (PR #103304)

Andrzej WarzyƄski llvmlistbot at llvm.org
Wed Aug 14 00:44:03 PDT 2024


================
@@ -2729,6 +2737,10 @@ void AsmPrinter::Impl::printNamedAttribute(NamedAttribute attr) {
     return;
 
   os << " = ";
+  if (printNamedAttrFn && succeeded(printNamedAttrFn(attr))) {
+    /// If we print via the `printNamedAttrFn` callback skip printing.
----------------
banach-space wrote:

> /// If we print via the `printNamedAttrFn` callback **skip printing**.

Note that this isn't accurate - "printing" happens regardless. What changes is the method that's used for printing.

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


More information about the Mlir-commits mailing list