[flang-commits] [flang] [flang][rfc] Add represention of volatile references (PR #132486)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Tue Mar 25 02:43:59 PDT 2025


================
@@ -363,18 +363,22 @@ def fir_ReferenceType : FIR_Type<"Reference", "ref"> {
     The type of a reference to an entity in memory.
   }];
 
-  let parameters = (ins "mlir::Type":$eleTy);
+  let parameters = (ins
+    "mlir::Type":$eleTy,
+    DefaultValuedParameter<"bool", "false">:$isVol);
 
   let skipDefaultBuilders = 1;
 
----------------
kiranchandramohan wrote:

>  I'd like to keep the , volatile part without printing true/false/1/0 in the IR.

Agree.

Note that you can use `custom` to print/parse part of the assembly format as well. Have not thought fully whether it is applicable here.
https://mlir.llvm.org/docs/DefiningDialects/AttributesAndTypes/#custom-and-ref-directive

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


More information about the flang-commits mailing list