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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 10 07:31:13 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");
----------------
erichkeane wrote:

This should probably use the `cgm.errorNYI`, then just come up with a way to recover.  That said, this is exactly why having `isSized` assert is awkward here.

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


More information about the cfe-commits mailing list