[cfe-dev] Proposal to simplify ObjC Type AST's
Chris Lattner
clattner at apple.com
Sun May 24 16:10:41 PDT 2009
On May 24, 2009, at 1:48 PM, steve naroff wrote:
>>> I think having a common base class (abstract or not) makes either
>>> of these more appealing than what we have now.
>>
>> This composition enables the "protocol-qualified" concept to be
>> abstract too.
>>
>
> Hey Chris,
>
> Sounds good to me. I'd simply call it ObjCQualifiedType (or
> ObjCProtocolQualifiedType).
>
I don't see that this adds any value, what problem does it solve? Why
add another set of multiple inheritance? To me, we should have
exactly one class for all of this. The space efficiency issue can be
easily addressed by tail allocating the array of protocol qualifiers
(as a second step).
If there is a specific reason that lots of clients want to use
dyn_cast to determine if an interface pointer has protocol qualifiers
(instead of using ->getNumQualifiers() != 0), we can definitely add
helper classes for that. I just don't think we should make a big
class hierarchy for no reason.
-Chris
More information about the cfe-dev
mailing list