[cfe-dev] Canonical representation of declaration names

Chris Lattner clattner at apple.com
Sat Nov 15 11:55:38 PST 2008


On Nov 15, 2008, at 11:43 AM, Doug Gregor wrote:

> On Sat, Nov 15, 2008 at 1:09 PM, Chris Lattner <clattner at apple.com>  
> wrote:
>>
>> On Nov 14, 2008, at 12:15 PM, Doug Gregor wrote:
>>> One option would be to move DeclarationName to Basic and use it to
>>> completely replace Selector. Then everything that can name a
>>> declaration will use a single class type, across all languages.
>>
>> Is that the right thing to do independently of the layering issue?   
>> If so,
>> then it's interesting.
>
> I know I'd feel more comfortable if we had just one notion of names
> for the various declarations in Clang. On the other hand, Selectors
> are only used in the (relatively small) subset of Clang that deals
> with Objective-C, so it would be somewhat unfortunate to use
> DeclarationNames there.

Is there a perf/memory cost to ObjC to do this? If not, I think the  
"conceptual overhead" is just fine.

> Actually, I think I know what we should do: move all of the logic of
> Selector into DeclarationName. Then, make Selector a subclass of
> DeclarationName that can only be constructed from Objective-C
> selectors. So we'll still have a single, unified notion of a
> "declaration name" in Clang, and the Objective-C parts of the code can
> still traffic in Selectors where it makes sense (Selector will, of
> course, not add any overhead to DeclarationName).

I'm not sure how this will pan out.  Are you ok with committing this  
patch first, and doing these changes as a follow on?

> Thanks for the review! Unless I hear howls of protest, I'll be making
> the Selector change and committing all of this on Monday or Tuesday.

Awesome, thanks again for tackling this Doug!

-Chris



More information about the cfe-dev mailing list