================
@@ -653,13 +631,13 @@ def CIR_AllocaOp : CIR_Op<"alloca", [
   }];
 
   let assemblyFormat = [{
-    $allocaType `,` qualified(type($addr)) `,`
+    $name
+    `align` `(` $alignment `)`
+    oilist( `init`              $init
+          | `const`             $constant
+          | `cleanup_dest_slot` $cleanup_dest_slot)
     ($dynAllocSize^ `:` type($dynAllocSize) `,`)?
-    `[` $name
-       (`,` `init` $init^)?
-       (`,` `const` $constant^)?
-       (`,` `cleanup_dest_slot` $cleanup_dest_slot^)?
-    `]`
+    $allocaType `->` qualified(type($addr))
----------------
Andres-Salamanca wrote:


I personally think it's good to keep it explicit in LLVM IR it works the other 
way around, the allocated type is shown but returning a pointer is implicit. i 
think the same applies here, printing the allocated type improves readability 
since you can immediately see what's being allocated without having to inspect 
the pointer type, especially with nested types like:
 ```mlir
%0 = cir.alloca "f" align(4) init const !cir.ptr<!cir.func<() -> !s32i>> -> 
!cir.ptr<!cir.ptr<!cir.func<() -> !s32i>>>
```
but happy to go either way if you and the others feel strongly about dropping 
it.
@erichkeane @andykaylor 

https://github.com/llvm/llvm-project/pull/198962
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to