[cfe-commits] r66002 - /cfe/trunk/include/clang/AST/DeclBase.h

Daniel Dunbar daniel at zuster.org
Tue Mar 3 18:26:42 PST 2009


Author: ddunbar
Date: Tue Mar  3 20:26:41 2009
New Revision: 66002

URL: http://llvm.org/viewvc/llvm-project?rev=66002&view=rev
Log:
Woot, save 8 bytes in Decl on 64-bit by reordering fields. This
reduces allocated Decl size by ~8% on Cocoa.h (~700k).

Modified:
    cfe/trunk/include/clang/AST/DeclBase.h

Modified: cfe/trunk/include/clang/AST/DeclBase.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclBase.h?rev=66002&r1=66001&r2=66002&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclBase.h (original)
+++ cfe/trunk/include/clang/AST/DeclBase.h Tue Mar  3 20:26:41 2009
@@ -80,9 +80,6 @@
   };
     
 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 @@
     return reinterpret_cast<MultipleDC*>(DeclCtx & ~0x1);
   }
 
+  /// Loc - The location that this decl.
+  SourceLocation Loc;
+  
   /// DeclKind - This indicates which class this is.
   Kind DeclKind   :  8;
   
@@ -143,8 +143,9 @@
   friend class CXXClassMemberWrapper;
 
   Decl(Kind DK, DeclContext *DC, SourceLocation L) 
-    : Loc(L), NextDeclarator(0), NextDeclInScope(0), 
-      DeclCtx(reinterpret_cast<uintptr_t>(DC)), DeclKind(DK), InvalidDecl(0),
+    : NextDeclarator(0), NextDeclInScope(0), 
+      DeclCtx(reinterpret_cast<uintptr_t>(DC)), 
+      Loc(L), DeclKind(DK), InvalidDecl(0),
       HasAttrs(false), Implicit(false) {
     if (Decl::CollectingStats()) addDeclKind(DK);
   }





More information about the cfe-commits mailing list