[cfe-dev] PATCH: Cleanup function redeclaration representations

Chris Lattner clattner at apple.com
Sun May 4 16:30:44 PDT 2008

On May 4, 2008, at 4:23 PM, Doug Gregor wrote:

> On Sun, May 4, 2008 at 12:42 PM, Doug Gregor <doug.gregor at gmail.com>  
> wrote:
>> One
>> could imagine that each function only has a single FunctionDecl,  
>> which
>> represents the aggregate declaration. That FunctionDecl contains a
>> SmallVector<FunctionRedecl*, 2>, where each FunctionRedecl contains
>> minimal information about a redeclaration...
> The poster child for this kind of approach is RecordDecl. Right now,
> we completely ignore re-declarations of tag types, e.g., "class foo;"
> However, if we're to represent the source accurately, we should have
> redeclaration chains for these, too. Unfortunately, RecordDecl is
> pretty large, and most of that information only applies to the
> definition---not to the redeclarations. This could be addressed in a
> few different ways, e.g., by moving the definition into a separate
> structure or by making redeclarations use a smaller decl node.

Yep, this is also an issue we'll have to solve someday.  I'm happy to  
defer fighting that battle until when it comes up though :)


More information about the cfe-dev mailing list