[clang] [CIR] Upstream basic support for ArrayType (PR #130502)

Amr Hesham via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 10 09:53:51 PDT 2025


================
@@ -202,6 +202,18 @@ mlir::Type CIRGenTypes::convertType(QualType type) {
     break;
   }
 
+  case Type::ConstantArray: {
+    const ConstantArrayType *arrTy = cast<ConstantArrayType>(ty);
+    mlir::Type elemTy = convertTypeForMem(arrTy->getElementType());
+
+    // FIXME: In LLVM, "lower arrays of undefined struct type to arrays of
+    // i8 just to have a concrete type". Not sure this makes sense in CIR yet.
+    assert(builder.isSized(elemTy) && "not implemented");
----------------
AmrDeveloper wrote:

Okey, thats make sense and i will try to recover with 0 size 

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


More information about the cfe-commits mailing list