================
@@ -66,6 +66,16 @@ struct CIRGenTypeCache {
     unsigned char PointerSizeInBytes;
   };
 
+  /// The size and alignment of size_t.
+  union {
+    unsigned char SizeSizeInBytes; // sizeof(size_t)
----------------
andykaylor wrote:

It will eventually be used by the array cookie implementation.

The fact that these are unions is a detail inherited from classic codegen that 
dates back to a [massive 
change](https://github.com/llvm/llvm-project/commit/7f416cc426384ad1f891addb61d93e7ca1ffa0f2#diff-34b07c79fb949b0d227d01937bf32a06c0bbfa2ca904b4ecf85a787d0edf62d7)
 @rjmccall made in 2015 to fix many alignment handling problems. I'll admit 
that my treatment of the alignment details is based on not trusting my own 
understanding of what should be happening enough to change any of it, so I've 
reproduced a few things like this without fully understanding why they are the 
way they are. If I had to speculate I'd say that as of the time of 
implementation 'size' and 'align' were always equal but we wanted to keep the 
implementation flexible enough to report them separately if an ABI came along 
that required them not to be equal?

https://github.com/llvm/llvm-project/pull/145802
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to