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

Ted Kremenek kremenek at apple.com
Tue Sep 16 20:21:09 PDT 2008

On Sep 16, 2008, at 6:52 PM, Argiris Kirtzidis wrote:

> 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.

Hi Argiris,

My understanding was that with the combination of TypeSpecifiers and  
DeclGroups, TranslationUnit would no longer have any direct reference  
to a RecordDecl (and thus never own it).  Isn't this true?


More information about the cfe-dev mailing list