[clang] [CIR] Add support for array constructors (PR #149142)

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 17 12:05:29 PDT 2025


================
@@ -2219,6 +2219,50 @@ def CIR_TrapOp : CIR_Op<"trap", [Terminator]> {
   let assemblyFormat = "attr-dict";
 }
 
+//===----------------------------------------------------------------------===//
+// ArrayCtor
+//===----------------------------------------------------------------------===//
+
+class CIR_ArrayInitDestroy<string mnemonic> : CIR_Op<mnemonic> {
+  let arguments = (ins
+    Arg<CIR_PtrToArray, "array address", [MemWrite, MemRead]>:$addr
+  );
+
+  let regions = (region SizedRegion<1>:$body);
+  let assemblyFormat = [{
+    `(` $addr `:` qualified(type($addr)) `)` $body attr-dict
----------------
bcardosolopes wrote:

While here, can we get rid of parens? https://llvm.github.io/clangir/Dialect/cir-style-guide.html

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


More information about the cfe-commits mailing list