================
@@ -661,8 +661,17 @@ def CIR_RecordType : CIR_Type<"Record", "record", [
         !rec_p1 = !cir.record<struct "p1" packed {!u8i, !u8i}>
         !rec_p2 = !cir.record<struct "p2" padded {!u8i, !u8i}>
         !rec_p3 = !cir.record<struct "p3" packed padded {!s32i, !u8i, !u8i}>
+        !rec_u = !cir.record<union "u" padded {!s8i, !u64i},
+            padding = {!cir.array<!u8i x 8>}>
     ```
 
+    Tail padding is represented differently by record kind.  For structs and
+    classes, `padded` still appends the tail-padding byte array as the last
+    entry in `members` (see `!rec_p2` / `!rec_p3` above).  For unions,
----------------
erichkeane wrote:

I don't know how I feel about these being different.  I realize Unions and 
structs are DIFFERENT enough already, but having this much special casing in 
the type seems wrong.

It DOES make me think that perhaps we've diverged enough that the two should 
have their own types though, rather than the `RecordType` differentiator.  We 
should perhaps consider a `StructType` and a `UnionType`.

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

Reply via email to