r212426 - Update internals manual on how to add AST nodes.

Alp Toker alp at nuanti.com
Sun Jul 6 18:36:38 PDT 2014


On 07/07/2014 03:50, Nico Weber wrote:
> Author: nico
> Date: Sun Jul  6 19:50:39 2014
> New Revision: 212426
>
> URL: http://llvm.org/viewvc/llvm-project?rev=212426&view=rev
> Log:
> Update internals manual on how to add AST nodes.
>
> StmtDumper.cpp is called ASTDumper.cpp these days, and usually works well
> for new AST nodes without changes.  There's now DataRecursiveASTVisitor
> in addition to RecursiveASTVisitor, and serialization wasn't mentioned.
>
> Modified:
>      cfe/trunk/docs/InternalsManual.rst
>
> Modified: cfe/trunk/docs/InternalsManual.rst
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/InternalsManual.rst?rev=212426&r1=212425&r2=212426&view=diff
> ==============================================================================
> --- cfe/trunk/docs/InternalsManual.rst (original)
> +++ cfe/trunk/docs/InternalsManual.rst Sun Jul  6 19:50:39 2014
> @@ -1852,13 +1852,14 @@ are similar.
>      * Make sure that ``children()`` visits all of the subexpressions.  This is
>        important for a number of features (e.g., IDE support, C++ variadic
>        templates).  If you have sub-types, you'll also need to visit those
> -     sub-types in the ``RecursiveASTVisitor``.
> -   * Add printing support (``StmtPrinter.cpp``) and dumping support
> -     (``StmtDumper.cpp``) for your expression.
> +     sub-types in ``RecursiveASTVisitor`` and ``DataRecursiveASTVisitor``.

Thanks! :-)



> +   * Add printing support (``StmtPrinter.cpp``) for your expression.
>      * Add profiling support (``StmtProfile.cpp``) for your AST node, noting the
>        distinguishing (non-source location) characteristics of an instance of
>        your expression.  Omitting this step will lead to hard-to-diagnose
>        failures regarding matching of template declarations.
> +   * Add serialization support (``ASTReaderStmt.cpp``, ``ASTWriterStmt.cpp``)
> +     for your AST node.
>   
>   #. Teach semantic analysis to build your AST node.  At this point, you can wire
>      up your ``Sema::BuildXXX`` function to actually create your AST.  A few
>
>
> _______________________________________________
> cfe-commits mailing list
> 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