[cfe-dev] Cleaning up the representation of Decls in the AST

Chris Lattner clattner at apple.com
Mon Aug 25 19:25:10 PDT 2008

On Aug 25, 2008, at 4:45 PM, Daniel Dunbar wrote:

> > Presumably this means that "typedef struct x foo, bar" would be a
> > DeclGroup with no "TypeDecl" but with two typedef decls?
> The "TypeDecl" would be 'struct x'.
> The DeclGroup would contain two TypedefDecls, one for the typedef of
> foo and the other for the typedef of bar.
> I think this requires some elaboration: The representation here  
> depends on how we
> are handling multiple RecordDecls. If the 'struct x' in the typedef  
> generates a new
> RecordDecl for a forward reference then it would own this Decl, and  
> the DeclGroup
> would point to it. If the 'struct x' in the typedef does not  
> generate a new RecordDecl
> then it would be NULL.
> In either situation the contained list of Decls would include two  
> TypedefDecls.

Ok, makes sense.

More information about the cfe-dev mailing list