From: Chris Lattner Date: Sun, 7 Oct 2007 06:29:32 +0000 (+0000) Subject: Shrink the builtinID down by 3 bits, allowing all the bitfields to X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=adb83b41cb00acac7a9c035996318d88ecf2e6c8;p=clang Shrink the builtinID down by 3 bits, allowing all the bitfields to 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 --- diff --git a/include/clang/Lex/IdentifierTable.h b/include/clang/Lex/IdentifierTable.h index ed0e7312da..132f71551a 100644 --- a/include/clang/Lex/IdentifierTable.h +++ b/include/clang/Lex/IdentifierTable.h @@ -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