From 2043dfcce183f27ffe84a339da8b75aec20d3c33 Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Tue, 29 Oct 2013 18:25:17 +0000 Subject: Convert symtab, cgraph and varpool nodes into a real class hierarchy This is the handwritten part of the patch; automated part to follow. * cgraph.h (symtab_node_base): Convert to a class; add GTY((desc ("%h.type"), tag ("SYMTAB_SYMBOL"))), and take chain_next/prev from symtab_node_def. (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 ::test (symtab_node_def *)): Convert to... (is_a_helper ::test (symtab_node_base *)): ...this. (is_a_helper ::test (symtab_node_def *)): Convert to... (is_a_helper ::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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204170 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/symtab.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/symtab.c') diff --git a/gcc/symtab.c b/gcc/symtab.c index acffbdd6f65..7232291e1cb 100644 --- a/gcc/symtab.c +++ b/gcc/symtab.c @@ -49,9 +49,9 @@ const char * const ld_plugin_symbol_resolution_names[]= }; /* Hash table used to convert declarations into nodes. */ -static GTY((param_is (union symtab_node_def))) htab_t symtab_hash; +static GTY((param_is (symtab_node_base))) htab_t symtab_hash; /* Hash table used to convert assembler names into nodes. */ -static GTY((param_is (union symtab_node_def))) htab_t assembler_name_hash; +static GTY((param_is (symtab_node_base))) htab_t assembler_name_hash; /* Linked list of symbol table nodes. */ symtab_node symtab_nodes; -- cgit v1.2.1