<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 20, 2014 at 11:50 AM, Alp Toker <span dir="ltr"><<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On 20/05/2014 20:42, Sean Silva wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">
<br>
<br>
<br>
On Tue, May 20, 2014 at 11:37 AM, Alp Toker <<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a> <mailto:<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>>> wrote:<br>
<br>
<br>
    On 20/05/2014 20:34, Manuel Klimek wrote:<br>
<br>
        On Tue, May 20, 2014 at 7:19 PM, Sean Silva<br>
        <<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@gmail.com</a> <mailto:<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@gmail.com</a>><br></div>
        <mailto:<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@gmail.com</a> <mailto:<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@gmail.com</a>><u></u>>><div class="">
<br>
        wrote:<br>
<br>
            Manuel, do you remember why this name was chosen? I seem<br>
        to recall<br>
            thinking that the name was well-chosen.<br>
<br>
<br>
        It's a DynTypedNode, because the type information is kept /<br>
        available dynamically. ASTNode would suggest that there is a<br>
        common interface for AST nodes, which there is not.<br>
<br>
<br>
    Well, QualType is a wrapper around Type structures that works<br>
    similarly and we don't make the distinction there.<br>
<br>
<br>
        What doesn't work for me is saying "DynTypedNode is an AST<br>
        node". This feels wrong. DynTypedNode is more like a "smart<br>
        reference".<br>
<br>
<br>
    How about ASTNodeRef? I don't have a strong feeling about ASTNode<br>
    / ASTNodeRef or something along those lines, but DynTypedNode<br>
    specifically doesn't feel right.<br>
<br>
    The current name doesn't mean much outside ASTMatchers lingo<br>
    whereas the functionality is fairly general and could be useful<br>
    elsewhere.<br>
<br>
<br>
There was some speculation about extending use of DynTypedNode outside the ASTMatchers library <a href="http://reviews.llvm.org/D33?id=85#inline-386" target="_blank">http://reviews.llvm.org/D33?<u></u>id=85#inline-386</a>; is there something in particular that you have in mind that you are trying to work towards?<br>

</div></blockquote>
<br>
Yes, it became apparent during the RecursiveASTVisitor / DataRecursiveASTVisitor that we have two data recursion techniques and this showed up as a possible way forward while investigating whether it's feasible to unify them. That kind of unification would be far off but the associated cleanup makes sense to make this class more discoverable outside of ASTMatchers.<br>

<br>
DynTypedNode, along with the parent map in ASTContext is fairly useful with the caveat that the code reads rather silly with the name "DynTypedNode" where what you have and what you want is an AST node reference.<br>
</blockquote><div><br></div><div>Makes sense; I agree that DynTypedNode doesn't work too well in that context.</div><div><br></div><div>I'm still not a fan of anything that would suggest that there is a unified AST hierarchy (IMO even ASTNodeRef suggests that there is some sort of underlying unified "ASTNode" being "Ref"erenced). Maybe ASTVariant?</div>
<div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Alp.<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">
<br>
-- Sean Silva<br>
<br>
<br>
    Alp.<br>
<br>
<br>
<br>
<br>
        Cheers,<br>
        /Manuel<br>
<br>
<br>
            -- Sean Silva<br>
<br>
<br>
            On Sun, May 18, 2014 at 11:18 PM, Alp Toker<br>
        <<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a> <mailto:<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>><br></div><div class="">
            <mailto:<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a> <mailto:<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>>>> wrote:<br>
<br>
                This is always referred to as an AST node in<br>
        documentation. By<br>
                wrapping Decls, Stmts and QualTypes it provides a<br>
        generalised<br>
                way to reference AST nodes. And despite the name,<br>
        DynTypedNode<br>
                doesn't have anything to do with dynamic types in the AST.<br>
<br>
                The attached patch renames the class and implementation to<br>
                ASTNode.<br>
<br>
                (Indeed the namespace "ast_type_traits" is equally<br>
        confusing.<br>
                Presumably both are cases where implementation details<br>
        have<br>
                leaked into the naming scheme?)<br>
<br>
                Alp.<br>
<br>
                -- <a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a><br>
                the browser experts<br>
<br>
<br>
                ______________________________<u></u>_________________<br>
                cfe-commits mailing list<br>
        <a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a> <mailto:<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.<u></u>edu</a>><br></div>
        <mailto:<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.<u></u>edu</a> <mailto:<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.<u></u>edu</a>>><div class="">
<br>
        <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-commits</a><br>
<br>
<br>
<br>
<br>
    --     <a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a><br>
    the browser experts<br>
<br>
<br>
</div></blockquote><div class="HOEnZb"><div class="h5">
<br>
-- <br>
<a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a><br>
the browser experts<br>
<br>
</div></div></blockquote></div><br></div></div>