================ @@ -230,17 +230,41 @@ 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"); + Type largestMember; + unsigned largestMemberSize = 0; + unsigned numElements = getNumElements(); + auto members = getMembers(); ---------------- andykaylor wrote:
Don't use auto here. https://github.com/llvm/llvm-project/pull/137501 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits