[cfe-commits] [patch] Qualifiers refactor

Chris Lattner clattner at apple.com
Fri Sep 25 18:50:20 PDT 2009


On Sep 24, 2009, at 8:58 AM, Douglas Gregor wrote:
On Sep 23, 2009, at 2:04 AM, John McCall wrote:
>> The attached patch refactors how qualifiers are represented in clang.
>>
>> Currently, QualType uses the bottom three bits of a type pointer to
>> represent the const, volatile, and restrict qualifiers.  Extended
>> qualifiers are represented using an ExtQualType object, which is an
>> ordinary node in the type hierarchy --- except that it isn't.  Most
>> common operations on types have to explicitly check for these
>> special qualifier nodes and handle them differently.
>
> ... except that most common operations end up forgetting that
> ExtQualType exists. One of the big benefits of this change is that all
> of the qualifiers are kept together, so it's easier to reason about
> them as a whole. Plus, ExtQualType didn't fit well into the type
> system; this does.

I also really like this change.  However, 4% is a really big  
slowdown.  Where is the time going?

-Chris




More information about the cfe-commits mailing list