[clang] [CIR] Add x86_64 aggregate calling-convention lowering (PR #210528)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 20 08:03:56 PDT 2026


================
@@ -107,15 +159,28 @@ static mlir::Type abiTypeToCIR(const llvm::abi::Type *ty, MLIRContext *ctx) {
       .Case([&](const llvm::abi::PointerType *) {
         return cir::PointerType::get(cir::VoidType::get(ctx));
       })
+      .Case([&](const llvm::abi::RecordType *recTy) -> mlir::Type {
+        SmallVector<mlir::Type> fieldTypes;
+        fieldTypes.reserve(recTy->getFields().size());
+        for (const auto &field : recTy->getFields()) {
+          mlir::Type fieldCIR = abiTypeToCIR(field.FieldType, ctx);
+          if (!fieldCIR)
+            return nullptr;
+          fieldTypes.push_back(fieldCIR);
+        }
+        return cir::StructType::get(ctx, fieldTypes, /*packed=*/false,
+                                    /*padded=*/false, /*is_class=*/false);
----------------
adams381 wrote:

That's the coercion type, a register-sized tuple, not the original record, so packed/padded/class don't apply.  Added a comment to make that clear.


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


More information about the cfe-commits mailing list