[cfe-dev] Adding memory spaces to types

Neil Booth neil at daikokuya.co.uk
Sun Nov 11 00:32:11 PST 2007


Chris Lattner wrote:-

> Yep, I think this is a very reasonable way to go.  QualType itself is  
> just an optimization for representing types.  Instead of having  
> Type*'s everywhere, and having a "ConstType" type and "RestrictType"  
> type (that wrapped some other type), the information is encoded into  
> QualType.
> 
> However,  this optimization for CVR qualifiers doesn't impact other  
> "qualifiers".  It would be very reasonable to have an  
> AddressSpaceQualifiedType class, which takes an address space ID and a  
> QualType.   This combines the space/time efficiency niceties of  
> QualType with the generality of having explicit classes for all of  
> these.

Having qualifiers in multiple places will make "qualifier calculus" like

o is A unqualified?
o does A have all the qualifiers of B?
o what is the unqualified form of A?

etc., awkward, no?

Neil.



More information about the cfe-dev mailing list