This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 0/6] Port symtab/cgraph/varpool nodes to use C++ inheritance; rename types.


> Here's version 2 of this patch series.
> 
> This is now 6 patches.
> 
> The first two patches correspond to the two patches from the original
> patch series (and must both be applied together to make sense).  They
> convert cgraph_node and varpool_node to inherit from symtab_node_base,
> eliminating union symtab_node_def, and the "symbol" fields at the
> top of the two subclasses.
> 
> Specifically:
> 
>   * Patch 1 of 6 is the hand-written part of the conversion to a C++
>     inheritance hierarchy, plus various workarounds for dealing with
>     issues in how gengtype handles GTY((user)).  It corresponds to
>     "patch 1/2" in the original patch series.  It is largely unchanged
>     from the previous submission.
> 
>   * Patch 2 of 6 is the automated part of the conversion to C++
>     inheritance, corresponding to "patch 2/2" in the original series.
>     The main improvement is that the script now removes casts to
>     (symtab_node) where these are unnecessary i.e. almost all of them,
>     apart from a few that I whitelisted.  See refactor_symtab.py
>     within https://github.com/davidmalcolm/gcc-refactoring-scripts for
>     details.
> 
> The remaining 4 patches rename some types:
> 
> "symtab_node_base" becomes "symtab_node" (Honza's preferred name, AIUI).
> 
> This would clash with the pre-existing "symtab_node", which was a
> typedef for:
>   union symtab_node_def *
> before patch 1, and for:
>   symtab_node_base *
> after it.
> 
> So we eliminate this typedef, and all uses become simply a
> "symtab_node *", which is the bulk of the renaming.  There is also
> a "const_symtab_node" typedef, which is eliminated; all uses become
> simply a "const symtab_node *".

yes, having symtab_node * and then cgraph_node */varpool_node * that will
later renamed to something like function_node/variable_node seems fine.
We can also drop _node and make it symbol that would be more descriptive.

Honza


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]