================
@@ -417,11 +436,11 @@ RecordType::getTypeSizeInBits(const mlir::DataLayout 
&dataLayout,
 uint64_t
 RecordType::getABIAlignment(const ::mlir::DataLayout &dataLayout,
                             ::mlir::DataLayoutEntryListRef params) const {
-  if (isUnion()) {
-    mlir::Type largest = getLargestMember(dataLayout);
-    if (!largest)
+  if (auto u = mlir::dyn_cast<cir::UnionType>(*this)) {
----------------
adams381 wrote:

`DataLayoutTypeInterface` is declared separately on `StructType` and 
`UnionType`, giving each its own `getTypeSizeInBits` and `getABIAlignment`.

https://github.com/llvm/llvm-project/pull/199790
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to