[cfe-dev] Decls are not synonyms for the symbols they represent

Argiris Kirtzidis akyrtzi at gmail.com
Tue Sep 16 18:52:36 PDT 2008

Argiris Kirtzidis wrote:
> What do you think about the idea of going back to single RecordDecls 
> and using DeclGroups to represent the above example ?
> struct s; -> typespecifier ';' -> DeclGroup with TypeSpecifier 
> referencing 's' and empty declaration list
> struct s { int a; }; -> typespecifier ';' -> DeclGroup with 
> TypeSpecifier defining 's' and empty declaration list
> And only one RecordDecl will be created for 's'.
> Or maybe make it more explicit by introducing a TypeSpecDecl for these 
> constructs.

Also, by having only TypeSpecifiers own RecordDecls, the ownership model 
for RecordDecls is more consistent that an ownership model where 
sometimes a TypeSpecifier owns a RecordDecl and other times it's the 
translation unit.


More information about the cfe-dev mailing list