This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 3/3] Convert symtab, cgraph and varpool nodes into a real class hierarchy
- 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: Fri, 20 Sep 2013 17:33:37 +0200
- Subject: Re: [PATCH 3/3] Convert symtab, cgraph and varpool nodes into a real class hierarchy
- Authentication-results: sourceware.org; auth=none
- References: <1379685919-9437-1-git-send-email-dmalcolm at redhat dot com> <1379685919-9437-4-git-send-email-dmalcolm at redhat dot com>
> This patch is the handwritten part of the conversion of these types
> to C++; it requires the followup patch, which is autogenerated.
>
> It converts:
> struct symtab_node_base
> to:
> class symtab_node_base
>
> and converts:
> struct cgraph_node
> to:
> struct cgraph_node : public symtab_node_base
> and:
> struct varpool_node
> to:
> class varpool_node : public symtab_node_base
>
> dropping the symtab_node_def union.
Yep, incrementally we should continue with the grand renaming
retiring symtab_node_base and getting things symmetric.
>
> * cgraph.h (symtab_node_base): Convert to a class;
> add GTY((desc ("%h.type"), tag ("SYMTAB_SYMBOL"))).
> (cgraph_node): Inherit from symtab_node; add GTY option
> tag ("SYMTAB_FUNCTION").
> (varpool_node): Inherit from symtab_node; add GTY option
> tag ("SYMTAB_VARIABLE").
> (symtab_node_def): Remove.
> (is_a_helper <cgraph_node>::test (symtab_node_def *)): Convert to...
> (is_a_helper <cgraph_node>::test (symtab_node_base *)): ...this.
> (is_a_helper <varpool_node>::test (symtab_node_def *)): Convert to...
> (is_a_helper <varpool_node>::test (symtab_node_base *)): ...this.
>
> * ipa-ref.h (symtab_node_def): Drop.
> (symtab_node): Change underlying type from symtab_node_def to
> symtab_node_base.
> (const_symtab_node): Likwise.
>
> * is-a.h: Update examples in comment.
>
> * symtab.c (symtab_hash): Change symtab_node_def to symtab_node_base.
> (assembler_name_hash): Likewise.
This patch is OK. Thanks for working on this!
Honza