From: Daniel Dunbar Date: Wed, 4 Mar 2009 02:26:41 +0000 (+0000) Subject: Woot, save 8 bytes in Decl on 64-bit by reordering fields. This X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39d7650656fdd1be879ed7d0c722cfeae95e56d5;p=clang Woot, save 8 bytes in Decl on 64-bit by reordering fields. This reduces allocated Decl size by ~8% on Cocoa.h (~700k). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66002 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index ff8a1c1323..7dee2a6561 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -80,9 +80,6 @@ public: }; private: - /// Loc - The location that this decl. - SourceLocation Loc; - /// NextDeclarator - If this decl was part of a multi-declarator declaration, /// such as "int X, Y, *Z;" this indicates Decl for the next declarator. Decl *NextDeclarator; @@ -123,6 +120,9 @@ private: return reinterpret_cast(DeclCtx & ~0x1); } + /// Loc - The location that this decl. + SourceLocation Loc; + /// DeclKind - This indicates which class this is. Kind DeclKind : 8; @@ -143,8 +143,9 @@ protected: friend class CXXClassMemberWrapper; Decl(Kind DK, DeclContext *DC, SourceLocation L) - : Loc(L), NextDeclarator(0), NextDeclInScope(0), - DeclCtx(reinterpret_cast(DC)), DeclKind(DK), InvalidDecl(0), + : NextDeclarator(0), NextDeclInScope(0), + DeclCtx(reinterpret_cast(DC)), + Loc(L), DeclKind(DK), InvalidDecl(0), HasAttrs(false), Implicit(false) { if (Decl::CollectingStats()) addDeclKind(DK); }