Author: Erich Keane Date: 2026-11-10T06:08:28-08:00 New Revision: 89f7d442e1c662570ec788884d5dc7a5469474fd
URL: https://github.com/llvm/llvm-project/commit/89f7d442e1c662570ec788884d5dc7a5469474fd DIFF: https://github.com/llvm/llvm-project/commit/89f7d442e1c662570ec788884d5dc7a5469474fd.diff LOG: [NFC] Clarify comment on initializer size history, per request. (#240395) As a followup to #239011, clarify the previous state of the initializer size in the bitfield so we aren't tempted to do it again. Added: Modified: clang/include/clang/AST/DeclCXX.h Removed: ################################################################################ diff --git a/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h index 99ae24a6956ec..ddb64fe0a40c3 100644 --- a/clang/include/clang/AST/DeclCXX.h +++ b/clang/include/clang/AST/DeclCXX.h @@ -2656,6 +2656,15 @@ class CXXConstructorDecl final /// to store this size. However, the downside to this is that querying whether /// this is a 'delegating' constructor would then become expensive. /// + /// While it might be tempting to move numCtorInitializers into the + /// CXXConstructorDeclBitfields, it DID live there for quite a while. However, + /// it was limited to 16 bits which was being hit repeatedly by generated + /// code. While there is MORE room there now (19 bits), it was both unclear + /// that 2^19 initializers would be sufficient, and it would be tempting to + /// shrink it if we ever need another bit, which would be unacceptable. So + /// it was determined that moving it into a full unsigned was the only + /// acceptable option. + /// /// An additional alternative we can do to negate that is to either store /// 'isDelegatingConstructor', or a 2 bit 'size' (where 0b11 means 'always /// check the Lazy Ptr array ref') in CXXConstructorDeclBitfields. _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
