forked from OSchip/llvm-project
[clang][NFC] Reorder CXXCtorInitializer members
Swapping the order of Init and MemberOrEllipsisLocation removes 8 bytes (20%) of padding on 64bit builds. Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D97191
This commit is contained in:
parent
b02bc0224a
commit
daeb70be0b
|
@ -2166,6 +2166,10 @@ class CXXCtorInitializer final {
|
|||
llvm::PointerUnion<TypeSourceInfo *, FieldDecl *, IndirectFieldDecl *>
|
||||
Initializee;
|
||||
|
||||
/// The argument used to initialize the base or member, which may
|
||||
/// end up constructing an object (when multiple arguments are involved).
|
||||
Stmt *Init;
|
||||
|
||||
/// The source location for the field name or, for a base initializer
|
||||
/// pack expansion, the location of the ellipsis.
|
||||
///
|
||||
|
@ -2174,10 +2178,6 @@ class CXXCtorInitializer final {
|
|||
/// Initializee points to the CXXConstructorDecl (to allow loop detection).
|
||||
SourceLocation MemberOrEllipsisLocation;
|
||||
|
||||
/// The argument used to initialize the base or member, which may
|
||||
/// end up constructing an object (when multiple arguments are involved).
|
||||
Stmt *Init;
|
||||
|
||||
/// Location of the left paren of the ctor-initializer.
|
||||
SourceLocation LParenLoc;
|
||||
|
||||
|
|
|
@ -2506,16 +2506,15 @@ CXXCtorInitializer::CXXCtorInitializer(ASTContext &Context,
|
|||
SourceLocation L, Expr *Init,
|
||||
SourceLocation R,
|
||||
SourceLocation EllipsisLoc)
|
||||
: Initializee(TInfo), MemberOrEllipsisLocation(EllipsisLoc), Init(Init),
|
||||
: Initializee(TInfo), Init(Init), MemberOrEllipsisLocation(EllipsisLoc),
|
||||
LParenLoc(L), RParenLoc(R), IsDelegating(false), IsVirtual(IsVirtual),
|
||||
IsWritten(false), SourceOrder(0) {}
|
||||
|
||||
CXXCtorInitializer::CXXCtorInitializer(ASTContext &Context,
|
||||
FieldDecl *Member,
|
||||
CXXCtorInitializer::CXXCtorInitializer(ASTContext &Context, FieldDecl *Member,
|
||||
SourceLocation MemberLoc,
|
||||
SourceLocation L, Expr *Init,
|
||||
SourceLocation R)
|
||||
: Initializee(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init),
|
||||
: Initializee(Member), Init(Init), MemberOrEllipsisLocation(MemberLoc),
|
||||
LParenLoc(L), RParenLoc(R), IsDelegating(false), IsVirtual(false),
|
||||
IsWritten(false), SourceOrder(0) {}
|
||||
|
||||
|
@ -2524,7 +2523,7 @@ CXXCtorInitializer::CXXCtorInitializer(ASTContext &Context,
|
|||
SourceLocation MemberLoc,
|
||||
SourceLocation L, Expr *Init,
|
||||
SourceLocation R)
|
||||
: Initializee(Member), MemberOrEllipsisLocation(MemberLoc), Init(Init),
|
||||
: Initializee(Member), Init(Init), MemberOrEllipsisLocation(MemberLoc),
|
||||
LParenLoc(L), RParenLoc(R), IsDelegating(false), IsVirtual(false),
|
||||
IsWritten(false), SourceOrder(0) {}
|
||||
|
||||
|
|
Loading…
Reference in New Issue