summaryrefslogtreecommitdiff
path: root/gcc/varpool.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-16 14:34:22 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-16 14:34:22 +0000
commit0704fb2e43031c1e7f22b09268fdfe63460de5a4 (patch)
tree5faa94b4b722d5a4697b6faeb99c4c72e121c4ff /gcc/varpool.c
parent93f2ac0b94df4e45f5a6f99f5165fe36a4dc412f (diff)
downloadgcc-0704fb2e43031c1e7f22b09268fdfe63460de5a4.tar.gz
* cgraph.h (symtab_node_base): Add next and previous pointers.
(cgraph_node): Remove next and preivous pointers. (varpool_node): Likewise; remove next/previous GTY marker; it is not type safe. (symtab_node_def): Update GTY marker (x_cgraph_nodes, cgraph_nodes): Remove. (symtab_nodes): New function. (cgraph_order): Rename to ... (symtab_order): ... this one. (symtab_register_node, symtab_unregister_node, symtab_remove_node): Declare. (x_varpool_nodes, varpool_nodes): Remove. (FOR_EACH_STATIC_VARIABLE): Update. (symtab_function_p, symtab_variable_p): New function. (FOR_EACH_VARIABLE): Update. (varpool_first_variable, varpool_next_variable): New functions. (FOR_EACH_VARIABLE): Update. (cgraph_first_defined_function): Update. (cgraph_next_defined_function, cgraph_next_defined_function): Update. (FOR_EACH_DEFINED_FUNCTION, FOR_EACH_FUNCTION): Update. (cgraph_first_function, cgraph_next_function): New. (FOR_EACH_FUNCTION): Update. (cgraph_first_function_with_gimple_body, cgraph_next_function_with_gimple_body): Update. * symtab.c: New file. * cgraph.c: Update copyright dates. (x_cgraph_nodes, cgraph_order): Remove. (NEXT_FREE_NODE): Update. (SET_NEXT_FREE_NODE): New. (cgraph_create_node_1): Remove common code. (cgraph_create_node); Remove common code; call symtab_register_node. (cgraph_remove_node): Remove common code; call symtab_unregister-node. (cgraph_add_asm_node); update. (cgraph_clone_node): Register new node. * cgraphunit.c (process_function_and_variable_attributes): Update. (cgraph_analyze_functions): Update. (cgraph_analyze_functions): Update. (cgraph_output_in_order): Update. * lto-cgraph.c (input_node, input_varpool_node, input_cgraph_1): Update. * ipa-inline.c (recursive_inlining); update. * lto-streamer-in.c (lto_input_toplevel_asms); Update. * ipa.c (cgraph_remove_unreachable_nodes): Update. * Makefile.in: Add symtab.o * varpool.c (x_varpool_nodes): Remove (varpool_node): Remove common code; call symtab_register_node. (varpool_remove_node); Remove common code; call symtab_unregister_node. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186496 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varpool.c')
-rw-r--r--gcc/varpool.c36
1 files changed, 2 insertions, 34 deletions
diff --git a/gcc/varpool.c b/gcc/varpool.c
index 42acc58be60..8fd9e8ad16d 100644
--- a/gcc/varpool.c
+++ b/gcc/varpool.c
@@ -51,10 +51,6 @@ along with GCC; see the file COPYING3. If not see
/* Hash table used to convert declarations into nodes. */
static GTY((param_is (union symtab_node_def))) htab_t varpool_hash;
-/* The linked list of cgraph varpool nodes.
- Linked via node->next pointer. */
-symtab_node x_varpool_nodes;
-
/* Queue of cgraph nodes scheduled to be lowered and output.
The queue is maintained via mark_needed_node, linked via node->next_needed
pointer.
@@ -146,12 +142,7 @@ varpool_node (tree decl)
node = ggc_alloc_cleared_varpool_node ();
node->symbol.type = SYMTAB_VARIABLE;
node->symbol.decl = decl;
- node->symbol.order = cgraph_order++;
- node->next = varpool_nodes;
- ipa_empty_ref_list (&node->symbol.ref_list);
- if (varpool_nodes)
- varpool (x_varpool_nodes)->prev = node;
- x_varpool_nodes = (symtab_node)node;
+ symtab_register_node ((symtab_node)node);
*slot = node;
return node;
}
@@ -165,15 +156,7 @@ varpool_remove_node (struct varpool_node *node)
gcc_assert (*slot == node);
htab_clear_slot (varpool_hash, slot);
gcc_assert (!varpool_assembled_nodes_queue);
- if (node->next)
- node->next->prev = node->prev;
- if (node->prev)
- node->prev->next = node->next;
- else
- {
- gcc_assert (varpool_nodes == node);
- x_varpool_nodes = (symtab_node)node->next;
- }
+ symtab_unregister_node ((symtab_node)node);
if (varpool_first_unanalyzed_node == node)
x_varpool_first_unanalyzed_node = (symtab_node)node->next_needed;
if (node->next_needed)
@@ -190,21 +173,6 @@ varpool_remove_node (struct varpool_node *node)
gcc_assert (varpool_nodes_queue == node);
x_varpool_nodes_queue = (symtab_node)node->next_needed;
}
- if (node->symbol.same_comdat_group)
- {
- symtab_node prev;
- for (prev = node->symbol.same_comdat_group;
- prev->symbol.same_comdat_group != (symtab_node)node;
- prev = prev->symbol.same_comdat_group)
- ;
- if (node->symbol.same_comdat_group == prev)
- prev->symbol.same_comdat_group = NULL;
- else
- prev->symbol.same_comdat_group = (symtab_node)node->symbol.same_comdat_group;
- node->symbol.same_comdat_group = NULL;
- }
- ipa_remove_all_references (&node->symbol.ref_list);
- ipa_remove_all_refering (&node->symbol.ref_list);
ggc_free (node);
}