[cfe-dev] PATCH: Cleanup function redeclaration representations
Argiris Kirtzidis
akyrtzi at gmail.com
Thu Apr 24 02:31:15 PDT 2008
Argiris Kirtzidis wrote:
>
>> There's some philosophy behind my approach to function redeclarations:
>> I want "normal" users of the AST to only see a single FunctionDecl for
>> each function, and that FunctionDecl should contain all of the
>> information that the AST contains about that function.
>
> I agree. The only difference is in case of
>
> void f(int x); // #1
> void f(int x = 2); // #2
>
>
> instead of merging to #2 and swaping contents with #1, thus pointer of
> #1 now points to #2,
> I suggest merging to #1.
> In both cases, every use of 'f' will point to the same FunctionDecl node.
The thing is, it seems to me that 'swaping contents' complicates things
(from the perspective of a ASTConsumer) without offering some benefit.
Could you explain why it's useful ?
More information about the cfe-dev
mailing list