================
@@ -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,
+/// the type that is used to convert to the 'storage' for LLVM-IR.
+Type RecordType::getUnionStorageType(
+ const ::mlir::DataLayout &dataLayout) const {
+ assert(isUnion() && "Only call getUnionStorageType on unions");
llvm::ArrayRef<Type> members = getMembers();
- if (members.empty())
+ if (members.empty() || (getPadded() && members.size() == 1))
----------------
andykaylor wrote:
This is in conflict with https://github.com/llvm/llvm-project/pull/198423
https://github.com/llvm/llvm-project/pull/199292
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits