[cfe-dev] PATCH: Cleanup function redeclaration representations

Chris Lattner clattner at apple.com
Sun May 4 17:25:23 PDT 2008


On May 4, 2008, at 5:10 PM, Doug Gregor wrote:

> On Sun, May 4, 2008 at 5:34 PM, Chris Lattner <clattner at apple.com>  
> wrote:
>> On May 4, 2008, at 11:42 AM, Doug Gregor wrote:
>> That is a great point, would it be reasonable to just always make the
>> aggregate version by the one returned by scope lookups?
>
> That would make me very, very happy

Ok :)

> , if that also implies that
> everything in the AST will refer to the aggregate version (except, of
> course, the list of redeclarations). Can we do this without always
> having an aggregate node? I'm not sure we can, because we run into
> trouble like this:
>
>  void foo(int); // #1: no aggregate
>  void bar(int i) { foo(i); }
>  void foo(int x) { ... } // #2: now we create the aggregate, but
> bar() points at #2.
>
> This is why I ended up with the swapping mess in the first place.  
> Argh!

I don't think there is a really easy way to do that.  Is there any  
harm in having the call to foo in bar pointing to the old decl?  What  
client would be affected by this, sema wouldn't be, right?

>> Great!  Incidentally, is there a better name than 'aggregate' for  
>> these? :)  How about
>> Accumulated or something else?
>
> Well, there's always "Canonical" :)

Good point, I like that better than 'aggregate' :)

-Chris



More information about the cfe-dev mailing list