[PATCH] D50630: [AST] Update/correct the static_asserts for the bit-fields in Type

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 13 12:51:37 PDT 2018


riccibruno added a comment.

@rjmccall

I would argue that we should make these bit-fields take 8 bytes for the following reasons:

1. On 64 bits archs, this is free since we have already 8 bytes of padding here.
2. On 32 bits archs, this a priori increase the size of each Type by 4 bytes. However, types are aligned to 16 bytes because of the fast CVR qualifiers. Doing an fsyntax-only on all of Boost with -print-stats I get that by far the most commonly used Types have size 40 or 48 (on a 64 bits arch). That is 5 or 6 pointers. This would be 20 or 24 bytes on 32 bits archs if we assume that every member of the most commonly used types are pointers and that we shrink the bitfields to 32 bits. But since Types are aligned to 16 bytes we do not gain anything.


Repository:
  rC Clang

https://reviews.llvm.org/D50630





More information about the cfe-commits mailing list