[clang] [CIR] Add constant record ILE support (PR #155663)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 28 16:20:35 PDT 2025


================
@@ -30,7 +30,8 @@ llvm::Align CIRDataLayout::getAlignment(mlir::Type ty, bool useABIAlign) const {
       return llvm::Align(1);
 
     // Get the layout annotation... which is lazily created on demand.
-    llvm_unreachable("getAlignment()) for record type is not implemented");
+    assert(!cir::MissingFeatures::alignCXXRecordDecl());
+    return llvm::Align(1);
----------------
andykaylor wrote:

In https://github.com/llvm/llvm-project/pull/155721 I'm proposing to delete the special handling here for record types entirely because I think the call to `layout.getTypeABIAlignment()` or `layout.getTypePreferredAlignment()` should handle record types correctly (and if it doesn't we should be able to fix that by providing a handler in `CIRTypes.cpp`.

Can you try that and see if it works (i.e. produces the same alignment as OGCG) for your change?

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


More information about the cfe-commits mailing list