[cfe-dev] Canonical representation of declaration names

Doug Gregor doug.gregor at gmail.com
Sun Nov 16 04:30:18 PST 2008


On Sat, Nov 15, 2008 at 2:55 PM, Chris Lattner <clattner at apple.com> wrote:
>
> 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.

There shouldn't be any cost.

>> 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?

Sure.

  - Doug



More information about the cfe-dev mailing list