]> granicus.if.org Git - clang/commitdiff
Shrink the builtinID down by 3 bits, allowing all the bitfields to
authorChris Lattner <sabre@nondot.org>
Sun, 7 Oct 2007 06:29:32 +0000 (06:29 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 7 Oct 2007 06:29:32 +0000 (06:29 +0000)
fit in 32-bits, shrinking IdentifierInfo by a word.

This shrinks the total size of the identifier pool from
1817264 to 1634428 bytes (11%) on carbon.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42719 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Lex/IdentifierTable.h

index ed0e7312dad86d9450df4e8cd8db53796e99c693..132f71551a8f24717d09a2ec38102dc2c0a694ff 100644 (file)
@@ -41,7 +41,7 @@ class IdentifierInfo {
   tok::TokenKind TokenID      : 8; // Front-end token ID or tok::identifier.
   tok::PPKeywordKind PPID     : 5; // ID for preprocessor command like #'ifdef'.
   tok::ObjCKeywordKind ObjCID : 5; // ID for objc @ keyword like @'protocol'.
-  unsigned BuiltinID          :12; // ID if this is a builtin (__builtin_inf).
+  unsigned BuiltinID          : 9; // ID if this is a builtin (__builtin_inf).
   bool IsExtension            : 1; // True if identifier is a lang extension.
   bool IsPoisoned             : 1; // True if identifier is poisoned.
   bool IsOtherTargetMacro     : 1; // True if ident is macro on another target.
@@ -97,8 +97,8 @@ public:
   /// 2+ are specific builtin functions.
   unsigned getBuiltinID() const { return BuiltinID; }
   void setBuiltinID(unsigned ID) {
-    assert(ID < (1 << 12) && "ID too large for field!");
     BuiltinID = ID;
+    assert(BuiltinID == ID && "ID too large for field!");
   }
   
   /// isNonPortableBuiltin - Return true if this identifier corresponds to a