[Mlir-commits] [mlir] [mlir][ptr] Add load and store ops. (PR #156093)

Fabian Mora llvmlistbot at llvm.org
Sun Aug 31 06:46:44 PDT 2025


================
@@ -773,9 +773,10 @@ class OptionalProp<Property p, bit canDelegateParsing = 1>
   }];
   let writeToMlirBytecode = [{
     $_writer.writeOwnedBool($_storage.has_value());
-    if (!$_storage.has_value())
-      return;
-  }] # !subst("$_storage", "(*($_storage))", p.writeToMlirBytecode);
+    if ($_storage.has_value()) {
+      }] # !subst("$_storage", "(*($_storage))", p.writeToMlirBytecode) # [{
----------------
fabianmcg wrote:

The code is:
```
   [{ ...
    if ($_storage.has_value()) {
      // See the `}]` escape and the concat operators here.
      }] # !subst("$_storage", "(*($_storage))", p.writeToMlirBytecode) # [{
    }
  ... }]
```
Which produces:
```C++
 if ($_storage.has_value()) {
    writer.writeVarInt((*(propStorage)));
 }
```

It's confusing because of the string pasting. I'll make it clearer.


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


More information about the Mlir-commits mailing list