[cfe-dev] Declaration name qualifiers.

Enea Zaffanella zaffanella at cs.unipr.it
Sat Mar 13 06:50:08 PST 2010


Douglas Gregor wrote:
> On Mar 12, 2010, at 2:41 PM, John McCall wrote:
> 
>> On Mar 12, 2010, at 1:38 AM, Enea Zaffanella wrote:
>>> <Qualifier.patch>
>> I'm not okay with adding 2-3 pointers to every DeclaratorDecl for
>> what's an uncommon case(*) even in C++.  Please use a QualType-like
>> hack here;  that is to say, please make the DeclInfo field a
>> PointerUnion<TypeSourceInfo*,UncommonData*> where UncommonData is a
>> private struct holding the qualifier information (and the
>> TypeSourceInfo*, of course).
> 
> I agree.
 >
>> I'm pretty sure you don't need this in TagDecl;  I don't think
>> enums can be declared out-of-line, so it could be pushed down to
>> CXXRecordDecl at least.
> 
> C++0x allows forward declarations (and, therefore, out-of-line
> definitions) of enums, and it's also a GNU extension. So we do need
> this in TagDecl.
> 
> - Doug
> 

Please find attached the patch revised as suggested.

We now use internal ExtInfo structures in both DeclaratorDecl and in 
TagDecl nodes. In the latter, the ExtInfo structure only contains info 
about the name qualifier; it is stored in a PointerUnion with the old 
TypedefForAnonDecl* field, since they could not occur together.

Cheers,
Enea Zaffanella.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Qualifier-2.patch
Type: text/x-patch
Size: 22037 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100313/5befc205/attachment.bin>


More information about the cfe-dev mailing list