[cfe-dev] RFC: Reclaiming some bits in IdentifierInfo
Chris Lattner
clattner at apple.com
Thu Nov 6 09:26:35 PST 2008
On Nov 6, 2008, at 7:25 AM, dgregor at apple.com wrote:
> The attached patch reclaims 5 bits in the IdentifierInfo structure by
> collapsing the 5-bit field for the Objective-C '@' keywords into the
> 10-bit field for builtin identifiers.
>
> The motivation for this change is simple: I need 6 bits in
> IdentifierInfo
> to represent the names of all of the overloaded operators in C++
> (operator+, operator[], operator new, etc.), but we only had 5 bits
> free.
> This patch makes room for a compact representation of overloaded
> operator
> names.
>
> The downside to this patch is that it makes
> IdentifierInfo::getObjCKeywordId and IdentifierInfo::getBuiltinID
> slightly
> slower--they each have a branch now--but these functions aren't
> called all
> that often (and are typically only called when we're already doing
> something expensive), I doubt it matters.
The patch looks great to me!
-Chris
More information about the cfe-dev
mailing list