[clang] [CIR] Fix union layout calculations- remove getLargestMember (PR #199292)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Fri May 22 16:09:05 PDT 2026
================
@@ -322,36 +322,26 @@ void RecordType::complete(ArrayRef<Type> members, bool packed, bool padded) {
llvm_unreachable("failed to complete record");
}
-/// Return the largest member of in the type.
-///
-/// Recurses into union members never returning a union as the largest member.
-Type RecordType::getLargestMember(const ::mlir::DataLayout &dataLayout) const {
- assert(isUnion() && "Only call getLargestMember on unions");
+/// Return the 'storage' type of the union, that is, without padding,
----------------
andykaylor wrote:
I find this confusing because I expected the storage type to be the type that we will eventually generate in LLVM IR, that is, the structure with the padding included. I see that the AST and classic codegen's `RecordLayoutBuilder` both have functions called `getStorageType`. Does this correspond to what any of those do?
https://github.com/llvm/llvm-project/pull/199292
More information about the cfe-commits
mailing list