r264597 - Windows: Shrink sizeof(MacroInfo) from 256 to 248, MacroDirective 24 to 16

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 28 10:28:06 PDT 2016


Author: nico
Date: Mon Mar 28 12:28:06 2016
New Revision: 264597

URL: http://llvm.org/viewvc/llvm-project?rev=264597&view=rev
Log:
Windows: Shrink sizeof(MacroInfo) from 256 to 248, MacroDirective 24 to 16

In the Microsoft ABI, only bitfields with identical types get packed together,
so use consistently use one of the two instead of a mix.
Saves 457kB when parsing windows.h.

No intended behavior change.

Modified:
    cfe/trunk/include/clang/Lex/MacroInfo.h

Modified: cfe/trunk/include/clang/Lex/MacroInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/MacroInfo.h?rev=264597&r1=264596&r2=264597&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/MacroInfo.h (original)
+++ cfe/trunk/include/clang/Lex/MacroInfo.h Mon Mar 28 12:28:06 2016
@@ -106,7 +106,7 @@ class MacroInfo {
   bool IsWarnIfUnused : 1;
 
   /// \brief Whether this macro info was loaded from an AST file.
-  unsigned FromASTFile : 1;
+  bool FromASTFile : 1;
 
   /// \brief Whether this macro was used as header guard.
   bool UsedForHeaderGuard : 1;
@@ -318,13 +318,13 @@ protected:
   unsigned MDKind : 2;
 
   /// \brief True if the macro directive was loaded from a PCH file.
-  bool IsFromPCH : 1;
+  unsigned IsFromPCH : 1;
 
   // Used by VisibilityMacroDirective ----------------------------------------//
 
   /// \brief Whether the macro has public visibility (when described in a
   /// module).
-  bool IsPublic : 1;
+  unsigned IsPublic : 1;
 
   MacroDirective(Kind K, SourceLocation Loc)
       : Previous(nullptr), Loc(Loc), MDKind(K), IsFromPCH(false),




More information about the cfe-commits mailing list