[cfe-dev] PATCH: Cleanup function redeclaration representations
doug.gregor at gmail.com
Sun May 4 16:23:42 PDT 2008
On Sun, May 4, 2008 at 12:42 PM, Doug Gregor <doug.gregor at gmail.com> wrote:
> 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.
More information about the cfe-dev