[cfe-dev] Again on Elaborated, QualifiedName and DependentName type nodes.
Douglas Gregor
dgregor at apple.com
Mon May 10 11:17:24 PDT 2010
On May 10, 2010, at 10:45 AM, Enea Zaffanella wrote:
> Hello.
>
> We were reconsidering the design of C++ AST nodes
> ElaboratedType
> QualifiedNameType
> DependentNameType
> In our opinion, the design of class DependentNameType, bringing
> together the elaborated keyword and the name qualification, is actually
> good. In contrast, the distinction between ElaboratedType and
> QualifiedNameType seems somewhat artificial.
> Would it be acceptable to collapse these two nodes in a single one,
> bringing together the corresponding info, similarly to DependentNameType?
Yes, I think that's a great idea. DependentNameType ended up much cleaner than what we had previously, and I'd love to see this same approach applied to ElaboratedType/QualifiedNameType.
> If so, then we would try and propose an alternative patch wrt the one
> submitted here:
> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100503/030031.html
>
> After that is put straight, we would like to consider the addition of
> appropriate typeloc info to the corresponding classes
> ElaboartedTypeLoc
> QualifiedNameTypeLoc
> DependentNameTypeLoc
> Again, we conjecture that collapsing Elaborated and QualifiedName would
> allow for a cleaner design.
I think so, too.
> However, in this case we have another doubt.
> An elaborated typeloc should contain syntactic info for the underlying
> tag type node. Should we add a TypeSourceInfo* to the corresponding
> LocInfo class (as done for TypeOfTypeLoc), or should we have the
> ElaboratedTypeLoc have an _inner_ typeloc (as done for pointer and array
> typelocs)?
I'd prefer an inner typeloc, as with pointers and arrays.
- Doug
More information about the cfe-dev
mailing list