This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v2 0/6] Port symtab/cgraph/varpool nodes to use C++ inheritance; rename types.
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: David Malcolm <dmalcolm at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Jan Hubicka <hubicka at ucw dot cz>
- Date: Tue, 10 Sep 2013 14:52:42 +0200
- Subject: Re: [PATCH v2 0/6] Port symtab/cgraph/varpool nodes to use C++ inheritance; rename types.
- Authentication-results: sourceware.org; auth=none
- References: <20130820210104 dot GC16244 at atrey dot karlin dot mff dot cuni dot cz> <1378755140-5555-1-git-send-email-dmalcolm at redhat dot com>
> 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