[clang] [CIR] Upstream support for record packing and padding (PR #136036)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 17 14:02:08 PDT 2025
================
@@ -502,6 +502,15 @@ def CIR_RecordType : CIR_Type<"Record", "record",
void complete(llvm::ArrayRef<mlir::Type> members, bool packed,
bool isPadded);
+
+ // Utilities for lazily computing and cacheing data layout info.
+ // FIXME: currently opaque because there's a cycle if CIRTypes.types include
+ // from CIRAttrs.h. The implementation operates in terms of RecordLayoutAttr
+ // instead.
+ private:
+ mutable mlir::Attribute layoutInfo;
----------------
andykaylor wrote:
Given that this isn't actually caching anything at the moment, I propose to remove RecordLayoutAttr from this PR and upstream an implementation that recomputes what it needs on each call, with a comment saying that we would like to cache the information. Then, as @bcardosolopes suggested, we can rework it in the incubator (though maybe not right away).
https://github.com/llvm/llvm-project/pull/136036
More information about the cfe-commits
mailing list