[PATCH] Rename DynTypedNode to ASTNode

Alp Toker alp at nuanti.com
Tue May 20 10:37:18 PDT 2014


On 20/05/2014 20:34, Manuel Klimek wrote:
> On Tue, May 20, 2014 at 7:19 PM, Sean Silva <chisophugis at gmail.com 
> <mailto:chisophugis at gmail.com>> wrote:
>
>     Manuel, do you remember why this name was chosen? I seem to recall
>     thinking that the name was well-chosen.
>
>
> It's a DynTypedNode, because the type information is kept / available 
> dynamically. ASTNode would suggest that there is a common interface 
> for AST nodes, which there is not.

Well, QualType is a wrapper around Type structures that works similarly 
and we don't make the distinction there.

> What doesn't work for me is saying "DynTypedNode is an AST node". This 
> feels wrong. DynTypedNode is more like a "smart reference".

How about ASTNodeRef? I don't have a strong feeling about ASTNode / 
ASTNodeRef or something along those lines, but DynTypedNode specifically 
doesn't feel right.

The current name doesn't mean much outside ASTMatchers lingo whereas the 
functionality is fairly general and could be useful elsewhere.

Alp.



>
> Cheers,
> /Manuel
>
>
>     -- Sean Silva
>
>
>     On Sun, May 18, 2014 at 11:18 PM, Alp Toker <alp at nuanti.com
>     <mailto:alp at nuanti.com>> wrote:
>
>         This is always referred to as an AST node in documentation. By
>         wrapping Decls, Stmts and QualTypes it provides a generalised
>         way to reference AST nodes. And despite the name, DynTypedNode
>         doesn't have anything to do with dynamic types in the AST.
>
>         The attached patch renames the class and implementation to
>         ASTNode.
>
>         (Indeed the namespace "ast_type_traits" is equally confusing.
>         Presumably both are cases where implementation details have
>         leaked into the naming scheme?)
>
>         Alp.
>
>         -- 
>         http://www.nuanti.com
>         the browser experts
>
>
>         _______________________________________________
>         cfe-commits mailing list
>         cfe-commits at cs.uiuc.edu <mailto:cfe-commits at cs.uiuc.edu>
>         http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
>

-- 
http://www.nuanti.com
the browser experts




More information about the cfe-commits mailing list