gcc/
Patch autogenerated by rename_symtab.py from
https://github.com/davidmalcolm/gcc-refactoring-scripts
revision
58bb219cc090b2f4516a9297d868c245495ee622
with ChangeLog entry fixed up by hand.
* cgraph.c (x_cgraph_nodes_queue): Rename symtab_node_base to
symtab_node.
(cgraph_node_for_asm): Likewise.
* cgraph.h (symtab_node_base): Likewise.
(cgraph_node): Likewise.
(varpool_node): Likewise.
(is_a_helper <cgraph_node>::test): Likewise.
(is_a_helper <varpool_node>::test): Likewise.
(symtab_nodes): Likewise.
(symtab_register_node): Likewise.
(symtab_unregister_node): Likewise.
(symtab_remove_node): Likewise.
(symtab_get_node): Likewise.
(symtab_node_for_asm): Likewise.
(symtab_node_asm_name): Likewise.
(symtab_node_name): Likewise.
(symtab_insert_node_to_hashtable): Likewise.
(symtab_add_to_same_comdat_group): Likewise.
(symtab_dissolve_same_comdat_group_list): Likewise.
(dump_symtab_node): Likewise.
(debug_symtab_node): Likewise.
(dump_symtab_base): Likewise.
(verify_symtab_node): Likewise.
(verify_symtab_base): Likewise.
(symtab_used_from_object_file_p): Likewise.
(symtab_alias_ultimate_target): Likewise.
(symtab_resolve_alias): Likewise.
(fixup_same_cpp_alias_visibility): Likewise.
(symtab_for_node_and_aliases): Likewise.
(symtab_nonoverwritable_alias): Likewise.
(availability symtab_node_availability): Likewise.
(symtab_semantically_equivalent_p): Likewise.
(fixup_same_cpp_alias_visibility): Likewise.
(symtab_prevail_in_asm_name_hash): Likewise.
(cgraph): Likewise.
(varpool): Likewise.
(varpool_first_variable): Likewise.
(varpool_next_variable): Likewise.
(varpool_first_static_initializer): Likewise.
(varpool_next_static_initializer): Likewise.
(varpool_first_defined_variable): Likewise.
(varpool_next_defined_variable): Likewise.
(cgraph_first_defined_function): Likewise.
(cgraph_next_defined_function): Likewise.
(cgraph_first_function): Likewise.
(cgraph_next_function): Likewise.
(cgraph_first_function_with_gimple_body): Likewise.
(cgraph_next_function_with_gimple_body): Likewise.
(symtab_alias_target): Likewise.
(symtab_real_symbol_p): Likewise.
(symtab_can_be_discarded): Likewise.
* cgraphbuild.c (mark_address): Likewise.
(mark_load): Likewise.
(mark_store): Likewise.
* cgraphunit.c (decide_is_symbol_needed): Likewise.
(first): Likewise.
(enqueue_node): Likewise.
(referred_to_p): Likewise.
(cgraph_process_same_body_aliases): Likewise.
(analyze_functions): Likewise.
(handle_alias_pairs): Likewise.
(output_weakrefs): Likewise.
(compile): Likewise.
* gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise.
* ipa-inline-analysis.c (inline_write_summary): Likewise.
* ipa-prop.c (remove_described_reference): Likewise.
(try_decrement_rdesc_refcount): Likewise.
(ipa_edge_duplication_hook): Likewise.
* ipa-ref.c (ipa_record_reference): Likewise.
(ipa_maybe_record_reference): Likewise.
(ipa_clone_ref): Likewise.
(ipa_clone_references): Likewise.
(ipa_clone_referring): Likewise.
(ipa_find_reference): Likewise.
(ipa_remove_stmt_references): Likewise.
(ipa_clear_stmts_in_references): Likewise.
* ipa-ref.h (symtab_node_base): Likewise.
(ipa_ref): Likewise.
(ipa_record_reference): Likewise.
(ipa_maybe_record_reference): Likewise.
(ipa_clone_references): Likewise.
(ipa_clone_referring): Likewise.
(ipa_clone_ref): Likewise.
(ipa_find_reference): Likewise.
(ipa_remove_stmt_references): Likewise.
(ipa_clear_stmts_in_references): Likewise.
* ipa-reference.c (ipa_reference_write_optimization_summary):
Likewise.
* ipa.c (enqueue_node): Likewise.
(process_references): Likewise.
(walk_polymorphic_call_targets): Likewise.
(symtab_remove_unreachable_nodes): Likewise.
(address_taken_from_non_vtable_p): Likewise.
(comdat_can_be_unshared_p_1): Likewise.
(comdat_can_be_unshared_p): Likewise.
(can_replace_by_local_alias): Likewise.
(function_and_variable_visibility): Likewise.
* is-a.h: Likewise (within example in comment).
* lto-cgraph.c (input_cgraph_opt_summary): Likewise.
(lto_symtab_encoder_encode): Likewise.
(lto_symtab_encoder_delete_node): Likewise.
(lto_symtab_encoder_in_partition_p): Likewise.
(lto_set_symtab_encoder_in_partition): Likewise.
(output_refs): Likewise.
(compute_ltrans_boundary): Likewise.
(output_symtab): Likewise.
(input_node): Likewise.
(input_ref): Likewise.
(input_edge): Likewise.
(input_cgraph_1): Likewise.
(input_refs): Likewise.
(output_cgraph_opt_summary): Likewise.
(input_node_opt_summary): Likewise.
(input_cgraph_opt_section): Likewise.
* lto-section-in.c (lto_free_function_in_decl_state_for_node):
Likewise.
* lto-streamer-out.c (lto_output): Likewise.
(output_symbol_p): Likewise.
(produce_symtab): Likewise.
* lto-streamer.h (lto_encoder_entry): Likewise.
(lto_free_function_in_decl_state_for_node): Likewise.
(lto_symtab_encoder_encode): Likewise.
(lto_symtab_encoder_delete_node): Likewise.
(lto_symtab_encoder_in_partition_p): Likewise.
(lto_set_symtab_encoder_in_partition): Likewise.
(lto_symtab_encoder_lookup): Likewise.
(lsei_node): Likewise.
(lto_symtab_encoder_deref): Likewise.
* symtab.c (symtab_hash): Likewise.
(assembler_name_hash): Likewise.
(symtab_nodes): Likewise.
(hash_node): Likewise.
(eq_node): Likewise.
(hash_node_by_assembler_name): Likewise.
(eq_assembler_name): Likewise.
(insert_to_assembler_name_hash): Likewise.
(unlink_from_assembler_name_hash): Likewise.
(symtab_prevail_in_asm_name_hash): Likewise.
(symtab_register_node): Likewise.
(symtab_insert_node_to_hashtable): Likewise.
(symtab_unregister_node): Likewise.
(symtab_get_node): Likewise.
(symtab_remove_node): Likewise.
(symtab_initialize_asm_name_hash): Likewise.
(symtab_node_for_asm): Likewise.
(symtab_add_to_same_comdat_group): Likewise.
(symtab_dissolve_same_comdat_group_list): Likewise.
(symtab_node_asm_name): Likewise.
(symtab_node_name): Likewise.
(dump_symtab_base): Likewise.
(dump_symtab_node): Likewise.
(dump_symtab): Likewise.
(debug_symtab_node): Likewise.
(verify_symtab_base): Likewise.
(verify_symtab_node): Likewise.
(verify_symtab): Likewise.
(symtab_used_from_object_file_p): Likewise.
(symtab_node_availability): Likewise.
(symtab_alias_ultimate_target): Likewise.
(fixup_same_cpp_alias_visibility): Likewise.
(symtab_resolve_alias): Likewise.
(symtab_for_node_and_aliases): Likewise.
(symtab_for_node_and_aliases): Likewise.
(symtab_nonoverwritable_alias_1): Likewise.
(symtab_nonoverwritable_alias): Likewise.
(symtab_semantically_equivalent_p): Likewise.
* value-prof.c (init_node_map): Likewise.
* varasm.c (find_decl): Likewise.
* varpool.c (varpool_node_for_asm): Likewise.
(varpool_remove_unreferenced_decls): Likewise.
gcc/c-family/
Patch autogenerated by rename_symtab.py from
https://github.com/davidmalcolm/gcc-refactoring-scripts
revision
58bb219cc090b2f4516a9297d868c245495ee622
* c-pragma.c (maybe_apply_pending_pragma_weaks): Rename
symtab_node_base to symtab_node.
gcc/lto/
Patch autogenerated by rename_symtab.py from
https://github.com/davidmalcolm/gcc-refactoring-scripts
revision
58bb219cc090b2f4516a9297d868c245495ee622
* lto-partition.c (add_symbol_to_partition): Rename
symtab_node_base to symtab_node.
(get_symbol_class): Likewise.
(symbol_partitioned_p): Likewise.
(add_references_to_partition): Likewise.
(add_symbol_to_partition_1): Likewise.
(contained_in_symbol): Likewise.
(add_symbol_to_partition): Likewise.
(lto_1_to_1_map): Likewise.
(lto_max_map): Likewise.
(lto_balanced_map): Likewise.
(privatize_symbol_name): Likewise.
(promote_symbol): Likewise.
(may_need_named_section_p): Likewise.
(rename_statics): Likewise.
(lto_promote_statics_nonwpa): Likewise.
* lto-symtab.c (lto_symtab_merge): Likewise.
(lto_symtab_resolve_replaceable_p): Likewise.
(lto_symtab_symbol_p): Likewise.
(lto_symtab_resolve_can_prevail_p): Likewise.
(lto_symtab_resolve_symbols): Likewise.
(lto_symtab_merge_decls_2): Likewise.
(lto_symtab_merge_decls_1): Likewise.
(lto_symtab_merge_decls): Likewise.
(lto_symtab_merge_symbols_1): Likewise.
(lto_symtab_merge_symbols): Likewise.
(lto_symtab_prevailing_decl): Likewise.
* lto.c (lto_wpa_write_files): Likewise.
(read_cgraph_and_symbols): Likewise.
(do_whole_program_analysis): Likewise.
From-SVN: r204279
+2013-10-31 David Malcolm <dmalcolm@redhat.com>
+
+ Automated part of renaming of symtab_node_base to symtab_node.
+
+ Patch autogenerated by rename_symtab.py from
+ https://github.com/davidmalcolm/gcc-refactoring-scripts
+ revision 58bb219cc090b2f4516a9297d868c245495ee622
+ with ChangeLog entry fixed up by hand.
+
+ * cgraph.c (x_cgraph_nodes_queue): Rename symtab_node_base to
+ symtab_node.
+ (cgraph_node_for_asm): Likewise.
+ * cgraph.h (symtab_node_base): Likewise.
+ (cgraph_node): Likewise.
+ (varpool_node): Likewise.
+ (is_a_helper <cgraph_node>::test): Likewise.
+ (is_a_helper <varpool_node>::test): Likewise.
+ (symtab_nodes): Likewise.
+ (symtab_register_node): Likewise.
+ (symtab_unregister_node): Likewise.
+ (symtab_remove_node): Likewise.
+ (symtab_get_node): Likewise.
+ (symtab_node_for_asm): Likewise.
+ (symtab_node_asm_name): Likewise.
+ (symtab_node_name): Likewise.
+ (symtab_insert_node_to_hashtable): Likewise.
+ (symtab_add_to_same_comdat_group): Likewise.
+ (symtab_dissolve_same_comdat_group_list): Likewise.
+ (dump_symtab_node): Likewise.
+ (debug_symtab_node): Likewise.
+ (dump_symtab_base): Likewise.
+ (verify_symtab_node): Likewise.
+ (verify_symtab_base): Likewise.
+ (symtab_used_from_object_file_p): Likewise.
+ (symtab_alias_ultimate_target): Likewise.
+ (symtab_resolve_alias): Likewise.
+ (fixup_same_cpp_alias_visibility): Likewise.
+ (symtab_for_node_and_aliases): Likewise.
+ (symtab_nonoverwritable_alias): Likewise.
+ (availability symtab_node_availability): Likewise.
+ (symtab_semantically_equivalent_p): Likewise.
+ (fixup_same_cpp_alias_visibility): Likewise.
+ (symtab_prevail_in_asm_name_hash): Likewise.
+ (cgraph): Likewise.
+ (varpool): Likewise.
+ (varpool_first_variable): Likewise.
+ (varpool_next_variable): Likewise.
+ (varpool_first_static_initializer): Likewise.
+ (varpool_next_static_initializer): Likewise.
+ (varpool_first_defined_variable): Likewise.
+ (varpool_next_defined_variable): Likewise.
+ (cgraph_first_defined_function): Likewise.
+ (cgraph_next_defined_function): Likewise.
+ (cgraph_first_function): Likewise.
+ (cgraph_next_function): Likewise.
+ (cgraph_first_function_with_gimple_body): Likewise.
+ (cgraph_next_function_with_gimple_body): Likewise.
+ (symtab_alias_target): Likewise.
+ (symtab_real_symbol_p): Likewise.
+ (symtab_can_be_discarded): Likewise.
+ * cgraphbuild.c (mark_address): Likewise.
+ (mark_load): Likewise.
+ (mark_store): Likewise.
+ * cgraphunit.c (decide_is_symbol_needed): Likewise.
+ (first): Likewise.
+ (enqueue_node): Likewise.
+ (referred_to_p): Likewise.
+ (cgraph_process_same_body_aliases): Likewise.
+ (analyze_functions): Likewise.
+ (handle_alias_pairs): Likewise.
+ (output_weakrefs): Likewise.
+ (compile): Likewise.
+ * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise.
+ * ipa-inline-analysis.c (inline_write_summary): Likewise.
+ * ipa-prop.c (remove_described_reference): Likewise.
+ (try_decrement_rdesc_refcount): Likewise.
+ (ipa_edge_duplication_hook): Likewise.
+ * ipa-ref.c (ipa_record_reference): Likewise.
+ (ipa_maybe_record_reference): Likewise.
+ (ipa_clone_ref): Likewise.
+ (ipa_clone_references): Likewise.
+ (ipa_clone_referring): Likewise.
+ (ipa_find_reference): Likewise.
+ (ipa_remove_stmt_references): Likewise.
+ (ipa_clear_stmts_in_references): Likewise.
+ * ipa-ref.h (symtab_node_base): Likewise.
+ (ipa_ref): Likewise.
+ (ipa_record_reference): Likewise.
+ (ipa_maybe_record_reference): Likewise.
+ (ipa_clone_references): Likewise.
+ (ipa_clone_referring): Likewise.
+ (ipa_clone_ref): Likewise.
+ (ipa_find_reference): Likewise.
+ (ipa_remove_stmt_references): Likewise.
+ (ipa_clear_stmts_in_references): Likewise.
+ * ipa-reference.c (ipa_reference_write_optimization_summary):
+ Likewise.
+ * ipa.c (enqueue_node): Likewise.
+ (process_references): Likewise.
+ (walk_polymorphic_call_targets): Likewise.
+ (symtab_remove_unreachable_nodes): Likewise.
+ (address_taken_from_non_vtable_p): Likewise.
+ (comdat_can_be_unshared_p_1): Likewise.
+ (comdat_can_be_unshared_p): Likewise.
+ (can_replace_by_local_alias): Likewise.
+ (function_and_variable_visibility): Likewise.
+ * is-a.h: Likewise (within example in comment).
+ * lto-cgraph.c (input_cgraph_opt_summary): Likewise.
+ (lto_symtab_encoder_encode): Likewise.
+ (lto_symtab_encoder_delete_node): Likewise.
+ (lto_symtab_encoder_in_partition_p): Likewise.
+ (lto_set_symtab_encoder_in_partition): Likewise.
+ (output_refs): Likewise.
+ (compute_ltrans_boundary): Likewise.
+ (output_symtab): Likewise.
+ (input_node): Likewise.
+ (input_ref): Likewise.
+ (input_edge): Likewise.
+ (input_cgraph_1): Likewise.
+ (input_refs): Likewise.
+ (output_cgraph_opt_summary): Likewise.
+ (input_node_opt_summary): Likewise.
+ (input_cgraph_opt_section): Likewise.
+ * lto-section-in.c (lto_free_function_in_decl_state_for_node):
+ Likewise.
+ * lto-streamer-out.c (lto_output): Likewise.
+ (output_symbol_p): Likewise.
+ (produce_symtab): Likewise.
+ * lto-streamer.h (lto_encoder_entry): Likewise.
+ (lto_free_function_in_decl_state_for_node): Likewise.
+ (lto_symtab_encoder_encode): Likewise.
+ (lto_symtab_encoder_delete_node): Likewise.
+ (lto_symtab_encoder_in_partition_p): Likewise.
+ (lto_set_symtab_encoder_in_partition): Likewise.
+ (lto_symtab_encoder_lookup): Likewise.
+ (lsei_node): Likewise.
+ (lto_symtab_encoder_deref): Likewise.
+ * symtab.c (symtab_hash): Likewise.
+ (assembler_name_hash): Likewise.
+ (symtab_nodes): Likewise.
+ (hash_node): Likewise.
+ (eq_node): Likewise.
+ (hash_node_by_assembler_name): Likewise.
+ (eq_assembler_name): Likewise.
+ (insert_to_assembler_name_hash): Likewise.
+ (unlink_from_assembler_name_hash): Likewise.
+ (symtab_prevail_in_asm_name_hash): Likewise.
+ (symtab_register_node): Likewise.
+ (symtab_insert_node_to_hashtable): Likewise.
+ (symtab_unregister_node): Likewise.
+ (symtab_get_node): Likewise.
+ (symtab_remove_node): Likewise.
+ (symtab_initialize_asm_name_hash): Likewise.
+ (symtab_node_for_asm): Likewise.
+ (symtab_add_to_same_comdat_group): Likewise.
+ (symtab_dissolve_same_comdat_group_list): Likewise.
+ (symtab_node_asm_name): Likewise.
+ (symtab_node_name): Likewise.
+ (dump_symtab_base): Likewise.
+ (dump_symtab_node): Likewise.
+ (dump_symtab): Likewise.
+ (debug_symtab_node): Likewise.
+ (verify_symtab_base): Likewise.
+ (verify_symtab_node): Likewise.
+ (verify_symtab): Likewise.
+ (symtab_used_from_object_file_p): Likewise.
+ (symtab_node_availability): Likewise.
+ (symtab_alias_ultimate_target): Likewise.
+ (fixup_same_cpp_alias_visibility): Likewise.
+ (symtab_resolve_alias): Likewise.
+ (symtab_for_node_and_aliases): Likewise.
+ (symtab_for_node_and_aliases): Likewise.
+ (symtab_nonoverwritable_alias_1): Likewise.
+ (symtab_nonoverwritable_alias): Likewise.
+ (symtab_semantically_equivalent_p): Likewise.
+ * value-prof.c (init_node_map): Likewise.
+ * varasm.c (find_decl): Likewise.
+ * varpool.c (varpool_node_for_asm): Likewise.
+ (varpool_remove_unreferenced_decls): Likewise.
+
2013-10-31 David Malcolm <dmalcolm@redhat.com>
Manual part of renaming of symtab_node_base to symtab_node.
+2013-10-31 David Malcolm <dmalcolm@redhat.com>
+
+ Automated part of renaming of symtab_node_base to symtab_node.
+
+ Patch autogenerated by rename_symtab.py from
+ https://github.com/davidmalcolm/gcc-refactoring-scripts
+ revision 58bb219cc090b2f4516a9297d868c245495ee622
+
+ * c-pragma.c (maybe_apply_pending_pragma_weaks): Rename
+ symtab_node_base to symtab_node.
+
2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement C++14 digit separators.
tree alias_id, id, decl;
int i;
pending_weak *pe;
- symtab_node target;
+ symtab_node *target;
if (!pending_weaks)
return;
static inline void cgraph_edge_remove_callee (struct cgraph_edge *e);
/* Queue of cgraph nodes scheduled to be lowered. */
-symtab_node x_cgraph_nodes_queue;
+symtab_node *x_cgraph_nodes_queue;
#define cgraph_nodes_queue ((struct cgraph_node *)x_cgraph_nodes_queue)
/* Number of nodes in existence. */
cgraph_node_for_asm (tree asmname)
{
/* We do not want to look at inline clones. */
- for (symtab_node node = symtab_node_for_asm (asmname);
+ for (symtab_node *node = symtab_node_for_asm (asmname);
node;
node = node->next_sharing_asm_name)
{
The symtab_node is inherited by cgraph and varpol nodes. */
class GTY((desc ("%h.type"), tag ("SYMTAB_SYMBOL"),
chain_next ("%h.next"), chain_prev ("%h.previous")))
- symtab_node_base
+ symtab_node
{
public:
/* Type of the symbol. */
tree decl;
/* Linked list of symbol table entries starting with symtab_nodes. */
- symtab_node next;
- symtab_node previous;
+ symtab_node *next;
+ symtab_node *previous;
/* Linked list of symbols with the same asm name. There may be multiple
entries for single symbol name during LTO, because symbols are renamed
There are also several long standing bugs where frontends and builtin
code produce duplicated decls. */
- symtab_node next_sharing_asm_name;
- symtab_node previous_sharing_asm_name;
+ symtab_node *next_sharing_asm_name;
+ symtab_node *previous_sharing_asm_name;
/* Circular list of nodes in the same comdat group if non-NULL. */
- symtab_node same_comdat_group;
+ symtab_node *same_comdat_group;
/* Vectors of referring and referenced entities. */
struct ipa_ref_list ref_list;
/* The cgraph data structure.
Each function decl has assigned cgraph_node listing callees and callers. */
-struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node_base {
+struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node {
public:
struct cgraph_edge *callees;
struct cgraph_edge *callers;
/* The varpool data structure.
Each static variable decl has assigned varpool_node. */
-class GTY((tag ("SYMTAB_VARIABLE"))) varpool_node : public symtab_node_base {
+class GTY((tag ("SYMTAB_VARIABLE"))) varpool_node : public symtab_node {
public:
/* Set when variable is scheduled to be assembled. */
unsigned output : 1;
template <>
template <>
inline bool
-is_a_helper <cgraph_node>::test (symtab_node_base *p)
+is_a_helper <cgraph_node>::test (symtab_node *p)
{
return p->type == SYMTAB_FUNCTION;
}
template <>
template <>
inline bool
-is_a_helper <varpool_node>::test (symtab_node_base *p)
+is_a_helper <varpool_node>::test (symtab_node *p)
{
return p->type == SYMTAB_VARIABLE;
}
-extern GTY(()) symtab_node symtab_nodes;
+extern GTY(()) symtab_node *symtab_nodes;
extern GTY(()) int cgraph_n_nodes;
extern GTY(()) int cgraph_max_uid;
extern GTY(()) int cgraph_edge_max_uid;
extern bool cpp_implicit_aliases_done;
/* In symtab.c */
-void symtab_register_node (symtab_node);
-void symtab_unregister_node (symtab_node);
-void symtab_remove_node (symtab_node);
-symtab_node symtab_get_node (const_tree);
-symtab_node symtab_node_for_asm (const_tree asmname);
-const char * symtab_node_asm_name (symtab_node);
-const char * symtab_node_name (symtab_node);
-void symtab_insert_node_to_hashtable (symtab_node);
-void symtab_add_to_same_comdat_group (symtab_node, symtab_node);
-void symtab_dissolve_same_comdat_group_list (symtab_node node);
+void symtab_register_node (symtab_node *);
+void symtab_unregister_node (symtab_node *);
+void symtab_remove_node (symtab_node *);
+symtab_node *symtab_get_node (const_tree);
+symtab_node *symtab_node_for_asm (const_tree asmname);
+const char * symtab_node_asm_name (symtab_node *);
+const char * symtab_node_name (symtab_node *);
+void symtab_insert_node_to_hashtable (symtab_node *);
+void symtab_add_to_same_comdat_group (symtab_node *, symtab_node *);
+void symtab_dissolve_same_comdat_group_list (symtab_node *node);
void dump_symtab (FILE *);
void debug_symtab (void);
-void dump_symtab_node (FILE *, symtab_node);
-void debug_symtab_node (symtab_node);
-void dump_symtab_base (FILE *, symtab_node);
+void dump_symtab_node (FILE *, symtab_node *);
+void debug_symtab_node (symtab_node *);
+void dump_symtab_base (FILE *, symtab_node *);
void verify_symtab (void);
-void verify_symtab_node (symtab_node);
-bool verify_symtab_base (symtab_node);
-bool symtab_used_from_object_file_p (symtab_node);
+void verify_symtab_node (symtab_node *);
+bool verify_symtab_base (symtab_node *);
+bool symtab_used_from_object_file_p (symtab_node *);
void symtab_make_decl_local (tree);
-symtab_node symtab_alias_ultimate_target (symtab_node,
+symtab_node *symtab_alias_ultimate_target (symtab_node *,
enum availability *avail = NULL);
-bool symtab_resolve_alias (symtab_node node, symtab_node target);
-void fixup_same_cpp_alias_visibility (symtab_node node, symtab_node target);
-bool symtab_for_node_and_aliases (symtab_node,
- bool (*) (symtab_node, void *),
+bool symtab_resolve_alias (symtab_node *node, symtab_node *target);
+void fixup_same_cpp_alias_visibility (symtab_node *node, symtab_node *target);
+bool symtab_for_node_and_aliases (symtab_node *,
+ bool (*) (symtab_node *, void *),
void *,
bool);
-symtab_node symtab_nonoverwritable_alias (symtab_node);
-enum availability symtab_node_availability (symtab_node);
-bool symtab_semantically_equivalent_p (symtab_node, symtab_node);
+symtab_node *symtab_nonoverwritable_alias (symtab_node *);
+enum availability symtab_node_availability (symtab_node *);
+bool symtab_semantically_equivalent_p (symtab_node *, symtab_node *);
/* In cgraph.c */
void dump_cgraph (FILE *);
void init_cgraph (void);
bool cgraph_process_new_functions (void);
void cgraph_process_same_body_aliases (void);
-void fixup_same_cpp_alias_visibility (symtab_node, symtab_node target, tree);
+void fixup_same_cpp_alias_visibility (symtab_node *, symtab_node *target, tree);
/* Initialize datastructures so DECL is a function in lowered gimple form.
IN_SSA is true if the gimple is in SSA. */
basic_block init_lowered_empty_function (tree, bool);
void *, bool);
void varpool_add_new_variable (tree);
void symtab_initialize_asm_name_hash (void);
-void symtab_prevail_in_asm_name_hash (symtab_node node);
+void symtab_prevail_in_asm_name_hash (symtab_node *node);
void varpool_remove_initializer (struct varpool_node *);
/* Return callgraph node for given symbol and check it is a function. */
static inline struct cgraph_node *
-cgraph (symtab_node node)
+cgraph (symtab_node *node)
{
gcc_checking_assert (!node || node->type == SYMTAB_FUNCTION);
return (struct cgraph_node *)node;
/* Return varpool node for given symbol and check it is a variable. */
static inline struct varpool_node *
-varpool (symtab_node node)
+varpool (symtab_node *node)
{
gcc_checking_assert (!node || node->type == SYMTAB_VARIABLE);
return (struct varpool_node *)node;
static inline struct varpool_node *
varpool_first_variable (void)
{
- symtab_node node;
+ symtab_node *node;
for (node = symtab_nodes; node; node = node->next)
if (varpool_node *vnode = dyn_cast <varpool_node> (node))
return vnode;
static inline struct varpool_node *
varpool_next_variable (struct varpool_node *node)
{
- symtab_node node1 = node->next;
+ symtab_node *node1 = node->next;
for (; node1; node1 = node1->next)
if (varpool_node *vnode1 = dyn_cast <varpool_node> (node1))
return vnode1;
static inline struct varpool_node *
varpool_first_static_initializer (void)
{
- symtab_node node;
+ symtab_node *node;
for (node = symtab_nodes; node; node = node->next)
{
varpool_node *vnode = dyn_cast <varpool_node> (node);
static inline struct varpool_node *
varpool_next_static_initializer (struct varpool_node *node)
{
- symtab_node node1 = node->next;
+ symtab_node *node1 = node->next;
for (; node1; node1 = node1->next)
{
varpool_node *vnode1 = dyn_cast <varpool_node> (node1);
static inline struct varpool_node *
varpool_first_defined_variable (void)
{
- symtab_node node;
+ symtab_node *node;
for (node = symtab_nodes; node; node = node->next)
{
varpool_node *vnode = dyn_cast <varpool_node> (node);
static inline struct varpool_node *
varpool_next_defined_variable (struct varpool_node *node)
{
- symtab_node node1 = node->next;
+ symtab_node *node1 = node->next;
for (; node1; node1 = node1->next)
{
varpool_node *vnode1 = dyn_cast <varpool_node> (node1);
static inline struct cgraph_node *
cgraph_first_defined_function (void)
{
- symtab_node node;
+ symtab_node *node;
for (node = symtab_nodes; node; node = node->next)
{
cgraph_node *cn = dyn_cast <cgraph_node> (node);
static inline struct cgraph_node *
cgraph_next_defined_function (struct cgraph_node *node)
{
- symtab_node node1 = node->next;
+ symtab_node *node1 = node->next;
for (; node1; node1 = node1->next)
{
cgraph_node *cn1 = dyn_cast <cgraph_node> (node1);
static inline struct cgraph_node *
cgraph_first_function (void)
{
- symtab_node node;
+ symtab_node *node;
for (node = symtab_nodes; node; node = node->next)
if (cgraph_node *cn = dyn_cast <cgraph_node> (node))
return cn;
static inline struct cgraph_node *
cgraph_next_function (struct cgraph_node *node)
{
- symtab_node node1 = node->next;
+ symtab_node *node1 = node->next;
for (; node1; node1 = node1->next)
if (cgraph_node *cn1 = dyn_cast <cgraph_node> (node1))
return cn1;
static inline struct cgraph_node *
cgraph_first_function_with_gimple_body (void)
{
- symtab_node node;
+ symtab_node *node;
for (node = symtab_nodes; node; node = node->next)
{
cgraph_node *cn = dyn_cast <cgraph_node> (node);
static inline struct cgraph_node *
cgraph_next_function_with_gimple_body (struct cgraph_node *node)
{
- symtab_node node1 = node->next;
+ symtab_node *node1 = node->next;
for (; node1; node1 = node1->next)
{
cgraph_node *cn1 = dyn_cast <cgraph_node> (node1);
/* Return node that alias N is aliasing. */
-static inline symtab_node
-symtab_alias_target (symtab_node n)
+static inline symtab_node *
+symtab_alias_target (symtab_node *n)
{
struct ipa_ref *ref;
ipa_ref_list_reference_iterate (&n->ref_list, 0, ref);
or abstract function kept for debug info purposes only. */
static inline bool
-symtab_real_symbol_p (symtab_node node)
+symtab_real_symbol_p (symtab_node *node)
{
struct cgraph_node *cnode;
/* Return true if NODE can be discarded by linker from the binary. */
static inline bool
-symtab_can_be_discarded (symtab_node node)
+symtab_can_be_discarded (symtab_node *node)
{
return (DECL_EXTERNAL (node->decl)
|| (DECL_ONE_ONLY (node->decl)
{
struct cgraph_node *node = cgraph_get_create_real_symbol_node (addr);
cgraph_mark_address_taken_node (node);
- ipa_record_reference ((symtab_node)data,
+ ipa_record_reference ((symtab_node *)data,
node,
IPA_REF_ADDR, stmt);
}
{
struct varpool_node *vnode = varpool_node_for_decl (addr);
- ipa_record_reference ((symtab_node)data,
+ ipa_record_reference ((symtab_node *)data,
vnode,
IPA_REF_ADDR, stmt);
}
directly manipulated in the code. Pretend that it's an address. */
struct cgraph_node *node = cgraph_get_create_real_symbol_node (t);
cgraph_mark_address_taken_node (node);
- ipa_record_reference ((symtab_node)data,
+ ipa_record_reference ((symtab_node *)data,
node,
IPA_REF_ADDR, stmt);
}
{
struct varpool_node *vnode = varpool_node_for_decl (t);
- ipa_record_reference ((symtab_node)data,
+ ipa_record_reference ((symtab_node *)data,
vnode,
IPA_REF_LOAD, stmt);
}
{
struct varpool_node *vnode = varpool_node_for_decl (t);
- ipa_record_reference ((symtab_node)data,
+ ipa_record_reference ((symtab_node *)data,
vnode,
IPA_REF_STORE, stmt);
}
either outside this translation unit, something magic in the system
configury */
bool
-decide_is_symbol_needed (symtab_node node)
+decide_is_symbol_needed (symtab_node *node)
{
tree decl = node->decl;
/* Head of the queue of nodes to be processed while building callgraph */
-static symtab_node first = (symtab_node)(void *)1;
+static symtab_node *first = (symtab_node *)(void *)1;
/* Add NODE to queue starting at FIRST.
The queue is linked via AUX pointers and terminated by pointer to 1. */
static void
-enqueue_node (symtab_node node)
+enqueue_node (symtab_node *node)
{
if (node->aux)
return;
/* Return true when there are references to NODE. */
static bool
-referred_to_p (symtab_node node)
+referred_to_p (symtab_node *node)
{
struct ipa_ref *ref;
void
cgraph_process_same_body_aliases (void)
{
- symtab_node node;
+ symtab_node *node;
FOR_EACH_SYMBOL (node)
if (node->cpp_implicit_alias && !node->analyzed)
symtab_resolve_alias
(node,
TREE_CODE (node->alias_target) == VAR_DECL
- ? (symtab_node)varpool_node_for_decl (node->alias_target)
- : (symtab_node)cgraph_get_create_node (node->alias_target));
+ ? (symtab_node *)varpool_node_for_decl (node->alias_target)
+ : (symtab_node *)cgraph_get_create_node (node->alias_target));
cpp_implicit_aliases_done = true;
}
struct varpool_node *first_handled_var = first_analyzed_var;
struct pointer_set_t *reachable_call_targets = pointer_set_create ();
- symtab_node node;
- symtab_node next;
+ symtab_node *node;
+ symtab_node *next;
int i;
struct ipa_ref *ref;
bool changed = true;
/* Lower representation, build callgraph edges and references for all trivially
needed symbols and all symbols referred by them. */
- while (first != (symtab_node)(void *)1)
+ while (first != (symtab_node *)(void *)1)
{
changed = true;
node = first;
- first = (symtab_node)first->aux;
+ first = (symtab_node *)first->aux;
cgraph_node *cnode = dyn_cast <cgraph_node> (node);
if (cnode && cnode->definition)
{
if (node->same_comdat_group)
{
- symtab_node next;
+ symtab_node *next;
for (next = node->same_comdat_group;
next != node;
next = next->same_comdat_group)
for (i = 0; alias_pairs && alias_pairs->iterate (i, &p);)
{
- symtab_node target_node = symtab_node_for_asm (p->target);
+ symtab_node *target_node = symtab_node_for_asm (p->target);
/* Weakrefs with target not defined in current unit are easy to handle:
they behave just as external variables except we need to note the
if (!target_node
&& lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl)) != NULL)
{
- symtab_node node = symtab_get_node (p->decl);
+ symtab_node *node = symtab_get_node (p->decl);
if (node)
{
node->alias_target = p->target;
else if (!target_node)
{
error ("%q+D aliased to undefined symbol %qE", p->decl, p->target);
- symtab_node node = symtab_get_node (p->decl);
+ symtab_node *node = symtab_get_node (p->decl);
if (node)
node->alias = false;
alias_pairs->unordered_remove (i);
static void
output_weakrefs (void)
{
- symtab_node node;
+ symtab_node *node;
FOR_EACH_SYMBOL (node)
if (node->alias
&& !TREE_ASM_WRITTEN (node->decl)
level by physically rewritting the IL. At the moment we can only redirect
calls, so we need infrastructure for renaming references as well. */
#ifndef ASM_OUTPUT_WEAKREF
- symtab_node node;
+ symtab_node *node;
FOR_EACH_SYMBOL (node)
if (node->alias
{
struct varpool_node *vnode;
struct cgraph_node *node;
- symtab_node snode;
+ symtab_node *snode;
if (DECL_ABSTRACT (decl))
return false;
for (i = 0; i < lto_symtab_encoder_size (encoder); i++)
{
- symtab_node snode = lto_symtab_encoder_deref (encoder, i);
+ symtab_node *snode = lto_symtab_encoder_deref (encoder, i);
cgraph_node *cnode = dyn_cast <cgraph_node> (snode);
if (cnode && cnode->definition && !cnode->alias)
count++;
for (i = 0; i < lto_symtab_encoder_size (encoder); i++)
{
- symtab_node snode = lto_symtab_encoder_deref (encoder, i);
+ symtab_node *snode = lto_symtab_encoder_deref (encoder, i);
cgraph_node *cnode = dyn_cast <cgraph_node> (snode);
if (cnode && (node = cnode)->definition && !node->alias)
{
successfully found and removed. */
static bool
-remove_described_reference (symtab_node symbol, struct ipa_cst_ref_desc *rdesc)
+remove_described_reference (symtab_node *symbol, struct ipa_cst_ref_desc *rdesc)
{
struct ipa_ref *to_del;
struct cgraph_edge *origin;
&& (rdesc = jfunc_rdesc_usable (jfunc))
&& --rdesc->refcount == 0)
{
- symtab_node symbol = cgraph_node_for_jfunc (jfunc);
+ symtab_node *symbol = cgraph_node_for_jfunc (jfunc);
if (!symbol)
return false;
else if (src->caller == dst->caller)
{
struct ipa_ref *ref;
- symtab_node n = cgraph_node_for_jfunc (src_jf);
+ symtab_node *n = cgraph_node_for_jfunc (src_jf);
gcc_checking_assert (n);
ref = ipa_find_reference (src->caller, n,
src->call_stmt, src->lto_stmt_uid);
of the use and STMT the statement (if it exists). */
struct ipa_ref *
-ipa_record_reference (symtab_node referring_node,
- symtab_node referred_node,
+ipa_record_reference (symtab_node *referring_node,
+ symtab_node *referred_node,
enum ipa_ref_use use_type, gimple stmt)
{
struct ipa_ref *ref, *ref2;
reference or NULL if none was created. */
struct ipa_ref *
-ipa_maybe_record_reference (symtab_node referring_node, tree val,
+ipa_maybe_record_reference (symtab_node *referring_node, tree val,
enum ipa_ref_use use_type, gimple stmt)
{
STRIP_NOPS (val);
if (val && (TREE_CODE (val) == FUNCTION_DECL
|| TREE_CODE (val) == VAR_DECL))
{
- symtab_node referred = symtab_get_node (val);
+ symtab_node *referred = symtab_get_node (val);
gcc_checking_assert (referred);
return ipa_record_reference (referring_node, referred,
use_type, stmt);
struct ipa_ref *
ipa_clone_ref (struct ipa_ref *ref,
- symtab_node dest_node,
+ symtab_node *dest_node,
gimple stmt)
{
bool speculative = ref->speculative;
/* Clone all references from SRC to DEST_NODE or DEST_VARPOOL_NODE. */
void
-ipa_clone_references (symtab_node dest_node,
+ipa_clone_references (symtab_node *dest_node,
struct ipa_ref_list *src)
{
struct ipa_ref *ref, *ref2;
/* Clone all referring from SRC to DEST_NODE or DEST_VARPOOL_NODE. */
void
-ipa_clone_referring (symtab_node dest_node,
+ipa_clone_referring (symtab_node *dest_node,
struct ipa_ref_list *src)
{
struct ipa_ref *ref, *ref2;
and associated with statement STMT. */
struct ipa_ref *
-ipa_find_reference (symtab_node referring_node, symtab_node referred_node,
+ipa_find_reference (symtab_node *referring_node, symtab_node *referred_node,
gimple stmt, unsigned int lto_stmt_uid)
{
struct ipa_ref *r = NULL;
STMT. */
void
-ipa_remove_stmt_references (symtab_node referring_node, gimple stmt)
+ipa_remove_stmt_references (symtab_node *referring_node, gimple stmt)
{
struct ipa_ref *r = NULL;
int i;
with callgraph edges associated with them. */
void
-ipa_clear_stmts_in_references (symtab_node referring_node)
+ipa_clear_stmts_in_references (symtab_node *referring_node)
{
struct ipa_ref *r = NULL;
int i;
struct cgraph_node;
struct varpool_node;
-class symtab_node_base;
+class symtab_node;
/* How the reference is done. */
/* Record of reference in callgraph or varpool. */
struct GTY(()) ipa_ref
{
- symtab_node referring;
- symtab_node referred;
+ symtab_node *referring;
+ symtab_node *referred;
gimple stmt;
unsigned int lto_stmt_uid;
unsigned int referred_index;
vec<ipa_ref_ptr> GTY((skip)) referring;
};
-struct ipa_ref * ipa_record_reference (symtab_node,
- symtab_node,
+struct ipa_ref * ipa_record_reference (symtab_node *,
+ symtab_node *,
enum ipa_ref_use, gimple);
-struct ipa_ref * ipa_maybe_record_reference (symtab_node, tree,
+struct ipa_ref * ipa_maybe_record_reference (symtab_node *, tree,
enum ipa_ref_use, gimple);
void ipa_remove_reference (struct ipa_ref *);
void ipa_remove_all_referring (struct ipa_ref_list *);
void ipa_dump_references (FILE *, struct ipa_ref_list *);
void ipa_dump_referring (FILE *, struct ipa_ref_list *);
-void ipa_clone_references (symtab_node, struct ipa_ref_list *);
-void ipa_clone_referring (symtab_node, struct ipa_ref_list *);
-struct ipa_ref * ipa_clone_ref (struct ipa_ref *, symtab_node, gimple);
+void ipa_clone_references (symtab_node *, struct ipa_ref_list *);
+void ipa_clone_referring (symtab_node *, struct ipa_ref_list *);
+struct ipa_ref * ipa_clone_ref (struct ipa_ref *, symtab_node *, gimple);
bool ipa_ref_cannot_lead_to_return (struct ipa_ref *);
bool ipa_ref_has_aliases_p (struct ipa_ref_list *);
-struct ipa_ref * ipa_find_reference (symtab_node, symtab_node, gimple, unsigned int);
-void ipa_remove_stmt_references (symtab_node, gimple);
-void ipa_clear_stmts_in_references (symtab_node);
+struct ipa_ref * ipa_find_reference (symtab_node *, symtab_node *, gimple, unsigned int);
+void ipa_remove_stmt_references (symtab_node *, gimple);
+void ipa_clear_stmts_in_references (symtab_node *);
/* See what variables we are interested in. */
for (i = 0; i < lto_symtab_encoder_size (encoder); i++)
{
- symtab_node snode = lto_symtab_encoder_deref (encoder, i);
+ symtab_node *snode = lto_symtab_encoder_deref (encoder, i);
varpool_node *vnode = dyn_cast <varpool_node> (snode);
if (vnode
&& bitmap_bit_p (all_module_statics, DECL_UID (vnode->decl))
if (ltrans_statics_bitcount)
for (i = 0; i < lto_symtab_encoder_size (encoder); i++)
{
- symtab_node snode = lto_symtab_encoder_deref (encoder, i);
+ symtab_node *snode = lto_symtab_encoder_deref (encoder, i);
cgraph_node *cnode = dyn_cast <cgraph_node> (snode);
if (cnode && write_node_summary_p (cnode, encoder, ltrans_statics))
count++;
if (ltrans_statics_bitcount)
for (i = 0; i < lto_symtab_encoder_size (encoder); i++)
{
- symtab_node snode = lto_symtab_encoder_deref (encoder, i);
+ symtab_node *snode = lto_symtab_encoder_deref (encoder, i);
cgraph_node *cnode = dyn_cast <cgraph_node> (snode);
if (cnode && write_node_summary_p (cnode, encoder, ltrans_statics))
{
reachable. */
static void
-enqueue_node (symtab_node node, symtab_node *first,
+enqueue_node (symtab_node *node, symtab_node **first,
struct pointer_set_t *reachable)
{
/* Node is still in queue; do nothing. */
static void
process_references (struct ipa_ref_list *list,
- symtab_node *first,
+ symtab_node **first,
bool before_inlining_p,
struct pointer_set_t *reachable)
{
struct ipa_ref *ref;
for (i = 0; ipa_ref_list_reference_iterate (list, i, ref); i++)
{
- symtab_node node = ref->referred;
+ symtab_node *node = ref->referred;
if (node->definition && !node->in_other_partition
&& ((!DECL_EXTERNAL (node->decl) || node->alias)
static void
walk_polymorphic_call_targets (pointer_set_t *reachable_call_targets,
struct cgraph_edge *edge,
- symtab_node *first,
+ symtab_node **first,
pointer_set_t *reachable, bool before_inlining_p)
{
unsigned int i;
bool
symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
{
- symtab_node first = (symtab_node) (void *) 1;
+ symtab_node *first = (symtab_node *) (void *) 1;
struct cgraph_node *node, *next;
struct varpool_node *vnode, *vnext;
bool changed = false;
}
/* Perform reachability analysis. */
- while (first != (symtab_node) (void *) 1)
+ while (first != (symtab_node *) (void *) 1)
{
bool in_boundary_p = !pointer_set_contains (reachable, first);
- symtab_node node = first;
+ symtab_node *node = first;
- first = (symtab_node)first->aux;
+ first = (symtab_node *)first->aux;
/* If we are processing symbol in boundary, mark its AUX pointer for
possible later re-processing in enqueue_node. */
all other in the same comdat group to be also reachable. */
if (node->same_comdat_group)
{
- symtab_node next;
+ symtab_node *next;
for (next = node->same_comdat_group;
next != node;
next = next->same_comdat_group)
/* Return true when there is a reference to node and it is not vtable. */
static bool
-address_taken_from_non_vtable_p (symtab_node node)
+address_taken_from_non_vtable_p (symtab_node *node)
{
int i;
struct ipa_ref *ref;
/* A helper for comdat_can_be_unshared_p. */
static bool
-comdat_can_be_unshared_p_1 (symtab_node node)
+comdat_can_be_unshared_p_1 (symtab_node *node)
{
/* When address is taken, we don't know if equality comparison won't
break eventually. Exception are virutal functions, C++
but in C++ there is no way to compare their addresses for equality. */
static bool
-comdat_can_be_unshared_p (symtab_node node)
+comdat_can_be_unshared_p (symtab_node *node)
{
if (!comdat_can_be_unshared_p_1 (node))
return false;
if (node->same_comdat_group)
{
- symtab_node next;
+ symtab_node *next;
/* If more than one function is in the same COMDAT group, it must
be shared even if just one function in the comdat group has
*/
bool
-can_replace_by_local_alias (symtab_node node)
+can_replace_by_local_alias (symtab_node *node)
{
return (symtab_node_availability (node) > AVAIL_OVERWRITABLE
&& !symtab_can_be_discarded (node));
if (node->same_comdat_group && DECL_EXTERNAL (node->decl))
{
#ifdef ENABLE_CHECKING
- symtab_node n;
+ symtab_node *n;
for (n = node->same_comdat_group;
n != node;
Tests whether the pointer actually points to a more derived TYPE.
- Suppose you have a symtab_node_base *ptr, AKA symtab_node ptr. You can test
+ Suppose you have a symtab_node *ptr, AKA symtab_node *ptr. You can test
whether it points to a 'derived' cgraph_node as follows.
if (is_a <cgraph_node> (ptr))
template <>
template <>
inline bool
- is_a_helper <cgraph_node>::test (symtab_node_base *p)
+ is_a_helper <cgraph_node>::test (symtab_node *p)
{
return p->type == SYMTAB_FUNCTION;
}
template <>
template <>
inline bool
- is_a_helper <cgraph_node>::cast (symtab_node_base *p)
+ is_a_helper <cgraph_node>::cast (symtab_node *p)
{
return &p->x_function;
}
#include "ipa-utils.h"
static void output_cgraph_opt_summary (void);
-static void input_cgraph_opt_summary (vec<symtab_node> nodes);
+static void input_cgraph_opt_summary (vec<symtab_node *> nodes);
/* Number of LDPR values known to GCC. */
#define LDPR_NUM_KNOWN (LDPR_PREVAILING_DEF_IRONLY_EXP + 1)
int
lto_symtab_encoder_encode (lto_symtab_encoder_t encoder,
- symtab_node node)
+ symtab_node *node)
{
int ref;
void **slot;
bool
lto_symtab_encoder_delete_node (lto_symtab_encoder_t encoder,
- symtab_node node)
+ symtab_node *node)
{
void **slot, **last_slot;
int index;
bool
lto_symtab_encoder_in_partition_p (lto_symtab_encoder_t encoder,
- symtab_node node)
+ symtab_node *node)
{
int index = lto_symtab_encoder_lookup (encoder, node);
if (index == LCC_NOT_FOUND)
void
lto_set_symtab_encoder_in_partition (lto_symtab_encoder_t encoder,
- symtab_node node)
+ symtab_node *node)
{
int index = lto_symtab_encoder_encode (encoder, node);
encoder->nodes[index].in_partition = true;
for (lsei = lsei_start_in_partition (encoder); !lsei_end_p (lsei);
lsei_next_in_partition (&lsei))
{
- symtab_node node = lsei_node (lsei);
+ symtab_node *node = lsei_node (lsei);
count = ipa_ref_list_nreferences (&node->ref_list);
if (count)
pickle those too. */
for (i = 0; i < lto_symtab_encoder_size (encoder); i++)
{
- symtab_node node = lto_symtab_encoder_deref (encoder, i);
+ symtab_node *node = lto_symtab_encoder_deref (encoder, i);
if (varpool_node *vnode = dyn_cast <varpool_node> (node))
{
if (!lto_symtab_encoder_encode_initializer_p (encoder,
n_nodes = lto_symtab_encoder_size (encoder);
for (i = 0; i < n_nodes; i++)
{
- symtab_node node = lto_symtab_encoder_deref (encoder, i);
+ symtab_node *node = lto_symtab_encoder_deref (encoder, i);
if (cgraph_node *cnode = dyn_cast <cgraph_node> (node))
lto_output_node (ob, cnode, encoder);
else
input_node (struct lto_file_decl_data *file_data,
struct lto_input_block *ib,
enum LTO_symtab_tags tag,
- vec<symtab_node> nodes)
+ vec<symtab_node *> nodes)
{
gcc::pass_manager *passes = g->get_passes ();
tree fn_decl;
node->global.inlined_to = (cgraph_node_ptr) (intptr_t) ref;
/* Store a reference for now, and fix up later to be a pointer. */
- node->same_comdat_group = (symtab_node) (intptr_t) ref2;
+ node->same_comdat_group = (symtab_node *) (intptr_t) ref2;
if (node->thunk.thunk_p)
{
node->alias_target = get_alias_symbol (node->decl);
ref = streamer_read_hwi (ib);
/* Store a reference for now, and fix up later to be a pointer. */
- node->same_comdat_group = (symtab_node) (intptr_t) ref;
+ node->same_comdat_group = (symtab_node *) (intptr_t) ref;
node->resolution = streamer_read_enum (ib, ld_plugin_symbol_resolution,
LDPR_NUM_KNOWN);
static void
input_ref (struct lto_input_block *ib,
- symtab_node referring_node,
- vec<symtab_node> nodes)
+ symtab_node *referring_node,
+ vec<symtab_node *> nodes)
{
- symtab_node node = NULL;
+ symtab_node *node = NULL;
struct bitpack_d bp;
enum ipa_ref_use use;
bool speculative;
indirect_unknown_callee set). */
static void
-input_edge (struct lto_input_block *ib, vec<symtab_node> nodes,
+input_edge (struct lto_input_block *ib, vec<symtab_node *> nodes,
bool indirect)
{
struct cgraph_node *caller, *callee;
/* Read a cgraph from IB using the info in FILE_DATA. */
-static vec<symtab_node>
+static vec<symtab_node *>
input_cgraph_1 (struct lto_file_decl_data *file_data,
struct lto_input_block *ib)
{
enum LTO_symtab_tags tag;
- vec<symtab_node> nodes = vNULL;
- symtab_node node;
+ vec<symtab_node *> nodes = vNULL;
+ symtab_node *node;
unsigned i;
tag = streamer_read_enum (ib, LTO_symtab_tags, LTO_symtab_last_tag);
static void
input_refs (struct lto_input_block *ib,
- vec<symtab_node> nodes)
+ vec<symtab_node *> nodes)
{
int count;
int idx;
while (true)
{
- symtab_node node;
+ symtab_node *node;
count = streamer_read_uhwi (ib);
if (!count)
break;
const char *data;
size_t len;
struct lto_input_block *ib;
- vec<symtab_node> nodes;
+ vec<symtab_node *> nodes;
ib = lto_create_simple_input_block (file_data, LTO_section_symtab_nodes,
&data, &len);
n_nodes = lto_symtab_encoder_size (encoder);
for (i = 0; i < n_nodes; i++)
{
- symtab_node node = lto_symtab_encoder_deref (encoder, i);
+ symtab_node *node = lto_symtab_encoder_deref (encoder, i);
cgraph_node *cnode = dyn_cast <cgraph_node> (node);
if (cnode && output_cgraph_opt_summary_p (cnode))
count++;
streamer_write_uhwi (ob, count);
for (i = 0; i < n_nodes; i++)
{
- symtab_node node = lto_symtab_encoder_deref (encoder, i);
+ symtab_node *node = lto_symtab_encoder_deref (encoder, i);
cgraph_node *cnode = dyn_cast <cgraph_node> (node);
if (cnode && output_cgraph_opt_summary_p (cnode))
{
static void
input_cgraph_opt_section (struct lto_file_decl_data *file_data,
const char *data, size_t len,
- vec<symtab_node> nodes)
+ vec<symtab_node *> nodes)
{
const struct lto_function_header *header =
(const struct lto_function_header *) data;
/* Input optimization summary of cgraph. */
static void
-input_cgraph_opt_summary (vec<symtab_node> nodes)
+input_cgraph_opt_summary (vec<symtab_node *> nodes)
{
struct lto_file_decl_data **file_data_vec = lto_get_file_decl_data ();
struct lto_file_decl_data *file_data;
release trees needed by the NODE's body. */
void
-lto_free_function_in_decl_state_for_node (symtab_node node)
+lto_free_function_in_decl_state_for_node (symtab_node *node)
{
struct lto_in_decl_state temp;
void **slot;
/* Process only the functions with bodies. */
for (i = 0; i < n_nodes; i++)
{
- symtab_node snode = lto_symtab_encoder_deref (encoder, i);
+ symtab_node *snode = lto_symtab_encoder_deref (encoder, i);
cgraph_node *node = dyn_cast <cgraph_node> (snode);
if (node
&& lto_symtab_encoder_encode_body_p (encoder, node)
/* Return true if NODE should appear in the plugin symbol table. */
bool
-output_symbol_p (symtab_node node)
+output_symbol_p (symtab_node *node)
{
struct cgraph_node *cnode;
if (!symtab_real_symbol_p (node))
for (lsei = lsei_start (encoder);
!lsei_end_p (lsei); lsei_next (&lsei))
{
- symtab_node node = lsei_node (lsei);
+ symtab_node *node = lsei_node (lsei);
if (!output_symbol_p (node) || DECL_EXTERNAL (node->decl))
continue;
for (lsei = lsei_start (encoder);
!lsei_end_p (lsei); lsei_next (&lsei))
{
- symtab_node node = lsei_node (lsei);
+ symtab_node *node = lsei_node (lsei);
if (!output_symbol_p (node) || !DECL_EXTERNAL (node->decl))
continue;
/* Entry of LTO symtab encoder. */
typedef struct
{
- symtab_node node;
+ symtab_node *node;
/* Is the node in this partition (i.e. ltrans of this partition will
be responsible for outputting it)? */
unsigned int in_partition:1;
extern struct lto_in_decl_state *lto_get_function_in_decl_state (
struct lto_file_decl_data *, tree);
extern void lto_free_function_in_decl_state (struct lto_in_decl_state *);
-extern void lto_free_function_in_decl_state_for_node (symtab_node);
+extern void lto_free_function_in_decl_state_for_node (symtab_node *);
extern void lto_section_overrun (struct lto_input_block *) ATTRIBUTE_NORETURN;
extern void lto_value_range_error (const char *,
HOST_WIDE_INT, HOST_WIDE_INT,
/* In lto-cgraph.c */
lto_symtab_encoder_t lto_symtab_encoder_new (bool);
-int lto_symtab_encoder_encode (lto_symtab_encoder_t, symtab_node);
+int lto_symtab_encoder_encode (lto_symtab_encoder_t, symtab_node *);
void lto_symtab_encoder_delete (lto_symtab_encoder_t);
-bool lto_symtab_encoder_delete_node (lto_symtab_encoder_t, symtab_node);
+bool lto_symtab_encoder_delete_node (lto_symtab_encoder_t, symtab_node *);
bool lto_symtab_encoder_encode_body_p (lto_symtab_encoder_t,
struct cgraph_node *);
bool lto_symtab_encoder_in_partition_p (lto_symtab_encoder_t,
- symtab_node);
+ symtab_node *);
void lto_set_symtab_encoder_in_partition (lto_symtab_encoder_t,
- symtab_node);
+ symtab_node *);
bool lto_symtab_encoder_encode_initializer_p (lto_symtab_encoder_t,
struct varpool_node *);
static inline int
lto_symtab_encoder_lookup (lto_symtab_encoder_t encoder,
- symtab_node node)
+ symtab_node *node)
{
void **slot = pointer_map_contains (encoder->map, node);
return (slot && *slot ? (size_t) *(slot) - 1 : LCC_NOT_FOUND);
}
/* Return the node pointed to by LSI. */
-static inline symtab_node
+static inline symtab_node *
lsei_node (lto_symtab_encoder_iterator lsei)
{
return lsei.encoder->nodes[lsei.index].node;
/* Return the cgraph node corresponding to REF using ENCODER. */
-static inline symtab_node
+static inline symtab_node *
lto_symtab_encoder_deref (lto_symtab_encoder_t encoder, int ref)
{
if (ref == LCC_NOT_FOUND)
+2013-10-31 David Malcolm <dmalcolm@redhat.com>
+
+ Automated part of renaming of symtab_node_base to symtab_node.
+
+ Patch autogenerated by rename_symtab.py from
+ https://github.com/davidmalcolm/gcc-refactoring-scripts
+ revision 58bb219cc090b2f4516a9297d868c245495ee622
+
+ * lto-partition.c (add_symbol_to_partition): Rename
+ symtab_node_base to symtab_node.
+ (get_symbol_class): Likewise.
+ (symbol_partitioned_p): Likewise.
+ (add_references_to_partition): Likewise.
+ (add_symbol_to_partition_1): Likewise.
+ (contained_in_symbol): Likewise.
+ (add_symbol_to_partition): Likewise.
+ (lto_1_to_1_map): Likewise.
+ (lto_max_map): Likewise.
+ (lto_balanced_map): Likewise.
+ (privatize_symbol_name): Likewise.
+ (promote_symbol): Likewise.
+ (may_need_named_section_p): Likewise.
+ (rename_statics): Likewise.
+ (lto_promote_statics_nonwpa): Likewise.
+ * lto-symtab.c (lto_symtab_merge): Likewise.
+ (lto_symtab_resolve_replaceable_p): Likewise.
+ (lto_symtab_symbol_p): Likewise.
+ (lto_symtab_resolve_can_prevail_p): Likewise.
+ (lto_symtab_resolve_symbols): Likewise.
+ (lto_symtab_merge_decls_2): Likewise.
+ (lto_symtab_merge_decls_1): Likewise.
+ (lto_symtab_merge_decls): Likewise.
+ (lto_symtab_merge_symbols_1): Likewise.
+ (lto_symtab_merge_symbols): Likewise.
+ (lto_symtab_prevailing_decl): Likewise.
+ * lto.c (lto_wpa_write_files): Likewise.
+ (read_cgraph_and_symbols): Likewise.
+ (do_whole_program_analysis): Likewise.
+
2013-10-30 David Malcolm <dmalcolm@redhat.com>
* lto-symtab.c (lto_symtab_merge_decls_2): Split symtab_node
vec<ltrans_partition> ltrans_partitions;
-static void add_symbol_to_partition (ltrans_partition part, symtab_node node);
+static void add_symbol_to_partition (ltrans_partition part, symtab_node *node);
/* Classify symbol NODE. */
enum symbol_class
-get_symbol_class (symtab_node node)
+get_symbol_class (symtab_node *node)
{
/* Inline clones are always duplicated.
This include external delcarations. */
/* Return true if symbol is already in some partition. */
static inline bool
-symbol_partitioned_p (symtab_node node)
+symbol_partitioned_p (symtab_node *node)
{
return node->aux;
}
/* Add references into the partition. */
static void
-add_references_to_partition (ltrans_partition part, symtab_node node)
+add_references_to_partition (ltrans_partition part, symtab_node *node)
{
int i;
struct ipa_ref *ref;
of adding NODE to PART. */
static bool
-add_symbol_to_partition_1 (ltrans_partition part, symtab_node node)
+add_symbol_to_partition_1 (ltrans_partition part, symtab_node *node)
{
enum symbol_class c = get_symbol_class (node);
int i;
struct ipa_ref *ref;
- symtab_node node1;
+ symtab_node *node1;
/* If NODE is already there, we have nothing to do. */
if (lto_symtab_encoder_in_partition_p (part->encoder, node))
internal label, thunk, alias or so), return the outer symbol.
When add_symbol_to_partition_1 is called on the outer symbol it must
eventually add NODE, too. */
-static symtab_node
-contained_in_symbol (symtab_node node)
+static symtab_node *
+contained_in_symbol (symtab_node *node)
{
/* Weakrefs are never contained in anything. */
if (node->weakref)
of other symbol definition, add the other symbol, too. */
static void
-add_symbol_to_partition (ltrans_partition part, symtab_node node)
+add_symbol_to_partition (ltrans_partition part, symtab_node *node)
{
- symtab_node node1;
+ symtab_node *node1;
/* Verify that we do not try to duplicate something that can not be. */
gcc_checking_assert (get_symbol_class (node) == SYMBOL_DUPLICATE
{
while (lto_symtab_encoder_size (partition->encoder) > (int)n_nodes)
{
- symtab_node node = lto_symtab_encoder_deref (partition->encoder,
+ symtab_node *node = lto_symtab_encoder_deref (partition->encoder,
n_nodes);
/* After UNDO we no longer know what was visited. */
void
lto_1_to_1_map (void)
{
- symtab_node node;
+ symtab_node *node;
struct lto_file_decl_data *file_data;
struct pointer_map_t *pmap;
ltrans_partition partition;
void
lto_max_map (void)
{
- symtab_node node;
+ symtab_node *node;
ltrans_partition partition;
int npartitions = 0;
struct ipa_ref_list *refs;
int j;
struct ipa_ref *ref;
- symtab_node snode = lto_symtab_encoder_deref (partition->encoder,
+ symtab_node *snode = lto_symtab_encoder_deref (partition->encoder,
last_visited_node);
if (cgraph_node *node = dyn_cast <cgraph_node> (snode))
*/
static bool
-privatize_symbol_name (symtab_node node)
+privatize_symbol_name (symtab_node *node)
{
tree decl = node->decl;
const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
/* Promote variable VNODE to be static. */
static void
-promote_symbol (symtab_node node)
+promote_symbol (symtab_node *node)
{
/* We already promoted ... */
if (DECL_VISIBILITY (node->decl) == VISIBILITY_HIDDEN
FIXME: we should really not use named sections for inline clones and master clones. */
static bool
-may_need_named_section_p (lto_symtab_encoder_t encoder, symtab_node node)
+may_need_named_section_p (lto_symtab_encoder_t encoder, symtab_node *node)
{
struct cgraph_node *cnode = dyn_cast <cgraph_node> (node);
if (!cnode)
asm statemnets referring to them by symbol name. */
static void
-rename_statics (lto_symtab_encoder_t encoder, symtab_node node)
+rename_statics (lto_symtab_encoder_t encoder, symtab_node *node)
{
tree decl = node->decl;
- symtab_node s;
+ symtab_node *s;
tree name = DECL_ASSEMBLER_NAME (decl);
/* See if this is static symbol. */
for (lsei = lsei_start (encoder); !lsei_end_p (lsei);
lsei_next (&lsei))
{
- symtab_node node = lsei_node (lsei);
+ symtab_node *node = lsei_node (lsei);
/* If symbol is static, rename it if its assembler name clash with
anything else in this unit. */
void
lto_promote_statics_nonwpa (void)
{
- symtab_node node;
+ symtab_node *node;
FOR_EACH_SYMBOL (node)
rename_statics (NULL, node);
}
should be emitted. */
static bool
-lto_symtab_merge (symtab_node prevailing, symtab_node entry)
+lto_symtab_merge (symtab_node *prevailing, symtab_node *entry)
{
tree prevailing_decl = prevailing->decl;
tree decl = entry->decl;
entry. */
static bool
-lto_symtab_resolve_replaceable_p (symtab_node e)
+lto_symtab_resolve_replaceable_p (symtab_node *e)
{
if (DECL_EXTERNAL (e->decl)
|| DECL_COMDAT (e->decl)
handle renaming of static later in partitioning). */
static bool
-lto_symtab_symbol_p (symtab_node e)
+lto_symtab_symbol_p (symtab_node *e)
{
if (!TREE_PUBLIC (e->decl) && !DECL_EXTERNAL (e->decl))
return false;
/* Return true if the symtab entry E can be the prevailing one. */
static bool
-lto_symtab_resolve_can_prevail_p (symtab_node e)
+lto_symtab_resolve_can_prevail_p (symtab_node *e)
{
if (!lto_symtab_symbol_p (e))
return false;
/* Resolve the symbol with the candidates in the chain *SLOT and store
their resolutions. */
-static symtab_node
-lto_symtab_resolve_symbols (symtab_node first)
+static symtab_node *
+lto_symtab_resolve_symbols (symtab_node *first)
{
- symtab_node e;
- symtab_node prevailing = NULL;
+ symtab_node *e;
+ symtab_node *prevailing = NULL;
/* Always set e->node so that edges are updated to reflect decl merging. */
for (e = first; e; e = e->next_sharing_asm_name)
do not issue further diagnostics.*/
static void
-lto_symtab_merge_decls_2 (symtab_node first, bool diagnosed_p)
+lto_symtab_merge_decls_2 (symtab_node *first, bool diagnosed_p)
{
- symtab_node prevailing;
- symtab_node e;
+ symtab_node *prevailing;
+ symtab_node *e;
vec<tree> mismatches = vNULL;
unsigned i;
tree decl;
/* Helper to process the decl chain for the symbol table entry *SLOT. */
static void
-lto_symtab_merge_decls_1 (symtab_node first)
+lto_symtab_merge_decls_1 (symtab_node *first)
{
- symtab_node e;
- symtab_node prevailing;
+ symtab_node *e;
+ symtab_node *prevailing;
bool diagnosed_p = false;
if (cgraph_dump_file)
void
lto_symtab_merge_decls (void)
{
- symtab_node node;
+ symtab_node *node;
/* Populate assembler name hash. */
symtab_initialize_asm_name_hash ();
/* Helper to process the decl chain for the symbol table entry *SLOT. */
static void
-lto_symtab_merge_symbols_1 (symtab_node prevailing)
+lto_symtab_merge_symbols_1 (symtab_node *prevailing)
{
- symtab_node e;
- symtab_node next;
+ symtab_node *e;
+ symtab_node *next;
/* Replace the cgraph node of each entry with the prevailing one. */
for (e = prevailing->next_sharing_asm_name; e;
void
lto_symtab_merge_symbols (void)
{
- symtab_node node;
+ symtab_node *node;
if (!flag_ltrans)
{
{
cgraph_node *cnode, *cnode2;
varpool_node *vnode;
- symtab_node node2;
+ symtab_node *node2;
if (!node->analyzed && node->alias_target)
{
- symtab_node tgt = symtab_node_for_asm (node->alias_target);
+ symtab_node *tgt = symtab_node_for_asm (node->alias_target);
gcc_assert (node->weakref);
if (tgt)
symtab_resolve_alias (node, tgt);
tree
lto_symtab_prevailing_decl (tree decl)
{
- symtab_node ret;
+ symtab_node *ret;
/* Builtins and local symbols are their own prevailing decl. */
if ((!TREE_PUBLIC (decl) && !DECL_EXTERNAL (decl)) || is_builtin_fn (decl))
for (lsei = lsei_start_in_partition (part->encoder); !lsei_end_p (lsei);
lsei_next_in_partition (&lsei))
{
- symtab_node node = lsei_node (lsei);
+ symtab_node *node = lsei_node (lsei);
fprintf (cgraph_dump_file, "%s ", symtab_node_asm_name (node));
}
fprintf (cgraph_dump_file, "\n Symbols in boundary: ");
for (lsei = lsei_start (part->encoder); !lsei_end_p (lsei);
lsei_next (&lsei))
{
- symtab_node node = lsei_node (lsei);
+ symtab_node *node = lsei_node (lsei);
if (!lto_symtab_encoder_in_partition_p (part->encoder, node))
{
fprintf (cgraph_dump_file, "%s ", symtab_node_asm_name (node));
int count = 0;
struct lto_file_decl_data **decl_data;
void **res;
- symtab_node snode;
+ symtab_node *snode;
init_cgraph ();
static void
do_whole_program_analysis (void)
{
- symtab_node node;
+ symtab_node *node;
timevar_start (TV_PHASE_OPT_GEN);
};
/* Hash table used to convert declarations into nodes. */
-static GTY((param_is (symtab_node_base))) htab_t symtab_hash;
+static GTY((param_is (symtab_node))) htab_t symtab_hash;
/* Hash table used to convert assembler names into nodes. */
-static GTY((param_is (symtab_node_base))) htab_t assembler_name_hash;
+static GTY((param_is (symtab_node))) htab_t assembler_name_hash;
/* Linked list of symbol table nodes. */
-symtab_node symtab_nodes;
+symtab_node *symtab_nodes;
/* The order index of the next symtab node to be created. This is
used so that we can sort the cgraph nodes in order by when we saw
static hashval_t
hash_node (const void *p)
{
- const_symtab_node n = (const_symtab_node ) p;
+ const symtab_node *n = (const symtab_node *) p;
return (hashval_t) DECL_UID (n->decl);
}
static int
eq_node (const void *p1, const void *p2)
{
- const_symtab_node n1 = (const_symtab_node) p1;
- const_symtab_node n2 = (const_symtab_node) p2;
+ const symtab_node *n1 = (const symtab_node *) p1;
+ const symtab_node *n2 = (const symtab_node *) p2;
return DECL_UID (n1->decl) == DECL_UID (n2->decl);
}
static hashval_t
hash_node_by_assembler_name (const void *p)
{
- const_symtab_node n = (const_symtab_node) p;
+ const symtab_node *n = (const symtab_node *) p;
return (hashval_t) decl_assembler_name_hash (DECL_ASSEMBLER_NAME (n->decl));
}
static int
eq_assembler_name (const void *p1, const void *p2)
{
- const_symtab_node n1 = (const_symtab_node) p1;
+ const symtab_node *n1 = (const symtab_node *) p1;
const_tree name = (const_tree)p2;
return (decl_assembler_name_equal (n1->decl, name));
}
/* Insert NODE to assembler name hash. */
static void
-insert_to_assembler_name_hash (symtab_node node, bool with_clones)
+insert_to_assembler_name_hash (symtab_node *node, bool with_clones)
{
if (is_a <varpool_node> (node) && DECL_HARD_REGISTER (node->decl))
return;
decl_assembler_name_hash (name),
INSERT);
gcc_assert (*aslot != node);
- node->next_sharing_asm_name = (symtab_node)*aslot;
+ node->next_sharing_asm_name = (symtab_node *)*aslot;
if (*aslot != NULL)
- ((symtab_node)*aslot)->previous_sharing_asm_name = node;
+ ((symtab_node *)*aslot)->previous_sharing_asm_name = node;
*aslot = node;
/* Update also possible inline clones sharing a decl. */
/* Remove NODE from assembler name hash. */
static void
-unlink_from_assembler_name_hash (symtab_node node, bool with_clones)
+unlink_from_assembler_name_hash (symtab_node *node, bool with_clones)
{
if (assembler_name_hash)
{
/* Arrange node to be first in its entry of assembler_name_hash. */
void
-symtab_prevail_in_asm_name_hash (symtab_node node)
+symtab_prevail_in_asm_name_hash (symtab_node *node)
{
unlink_from_assembler_name_hash (node, false);
insert_to_assembler_name_hash (node, false);
cgraph/varpool node creation routines. */
void
-symtab_register_node (symtab_node node)
+symtab_register_node (symtab_node *node)
{
- struct symtab_node_base key;
- symtab_node *slot;
+ struct symtab_node key;
+ symtab_node **slot;
node->next = symtab_nodes;
node->previous = NULL;
if (!symtab_hash)
symtab_hash = htab_create_ggc (10, hash_node, eq_node, NULL);
key.decl = node->decl;
- slot = (symtab_node *) htab_find_slot (symtab_hash, &key, INSERT);
+ slot = (symtab_node **) htab_find_slot (symtab_hash, &key, INSERT);
if (*slot == NULL)
*slot = node;
of inline clones. */
void
-symtab_insert_node_to_hashtable (symtab_node node)
+symtab_insert_node_to_hashtable (symtab_node *node)
{
- struct symtab_node_base key;
- symtab_node *slot;
+ struct symtab_node key;
+ symtab_node **slot;
if (!symtab_hash)
symtab_hash = htab_create_ggc (10, hash_node, eq_node, NULL);
key.decl = node->decl;
- slot = (symtab_node *) htab_find_slot (symtab_hash, &key, INSERT);
+ slot = (symtab_node **) htab_find_slot (symtab_hash, &key, INSERT);
*slot = node;
}
cgraph/varpool node removal routines. */
void
-symtab_unregister_node (symtab_node node)
+symtab_unregister_node (symtab_node *node)
{
void **slot;
ipa_remove_all_references (&node->ref_list);
if (node->same_comdat_group)
{
- symtab_node prev;
+ symtab_node *prev;
for (prev = node->same_comdat_group;
prev->same_comdat_group != node;
prev = prev->same_comdat_group)
gcc_assert ((slot && *slot) || in_lto_p);
if (slot && *slot && *slot == node)
{
- symtab_node replacement_node = NULL;
+ symtab_node *replacement_node = NULL;
if (cgraph_node *cnode = dyn_cast <cgraph_node> (node))
replacement_node = cgraph_find_replacement_node (cnode);
if (!replacement_node)
/* Return symbol table node associated with DECL, if any,
and NULL otherwise. */
-symtab_node
+symtab_node *
symtab_get_node (const_tree decl)
{
- symtab_node *slot;
- struct symtab_node_base key;
+ symtab_node **slot;
+ struct symtab_node key;
#ifdef ENABLE_CHECKING
/* Check that we are called for sane type of object - functions
key.decl = CONST_CAST2 (tree, const_tree, decl);
- slot = (symtab_node *) htab_find_slot (symtab_hash, &key,
+ slot = (symtab_node **) htab_find_slot (symtab_hash, &key,
NO_INSERT);
if (slot)
/* Remove symtab NODE from the symbol table. */
void
-symtab_remove_node (symtab_node node)
+symtab_remove_node (symtab_node *node)
{
if (cgraph_node *cnode = dyn_cast <cgraph_node> (node))
cgraph_remove_node (cnode);
void
symtab_initialize_asm_name_hash (void)
{
- symtab_node node;
+ symtab_node *node;
if (!assembler_name_hash)
{
assembler_name_hash =
/* Return the cgraph node that has ASMNAME for its DECL_ASSEMBLER_NAME.
Return NULL if there's no such node. */
-symtab_node
+symtab_node *
symtab_node_for_asm (const_tree asmname)
{
- symtab_node node;
+ symtab_node *node;
void **slot;
symtab_initialize_asm_name_hash ();
if (slot)
{
- node = (symtab_node) *slot;
+ node = (symtab_node *) *slot;
return node;
}
return NULL;
void
change_decl_assembler_name (tree decl, tree name)
{
- symtab_node node = NULL;
+ symtab_node *node = NULL;
/* We can have user ASM names on things, like global register variables, that
are not in the symbol table. */
/* Add NEW_ to the same comdat group that OLD is in. */
void
-symtab_add_to_same_comdat_group (symtab_node new_node,
- symtab_node old_node)
+symtab_add_to_same_comdat_group (symtab_node *new_node,
+ symtab_node *old_node)
{
gcc_assert (DECL_ONE_ONLY (old_node->decl));
gcc_assert (!new_node->same_comdat_group);
old_node->same_comdat_group = new_node;
else
{
- symtab_node n;
+ symtab_node *n;
for (n = old_node->same_comdat_group;
n->same_comdat_group != old_node;
n = n->same_comdat_group)
/* Dissolve the same_comdat_group list in which NODE resides. */
void
-symtab_dissolve_same_comdat_group_list (symtab_node node)
+symtab_dissolve_same_comdat_group_list (symtab_node *node)
{
- symtab_node n = node;
- symtab_node next;
+ symtab_node *n = node;
+ symtab_node *next;
if (!node->same_comdat_group)
return;
is unknown go with identifier name. */
const char *
-symtab_node_asm_name (symtab_node node)
+symtab_node_asm_name (symtab_node *node)
{
if (!DECL_ASSEMBLER_NAME_SET_P (node->decl))
return lang_hooks.decl_printable_name (node->decl, 2);
/* Return printable identifier name. */
const char *
-symtab_node_name (symtab_node node)
+symtab_node_name (symtab_node *node)
{
return lang_hooks.decl_printable_name (node->decl, 2);
}
/* Dump base fields of symtab nodes. Not to be used directly. */
void
-dump_symtab_base (FILE *f, symtab_node node)
+dump_symtab_base (FILE *f, symtab_node *node)
{
static const char * const visibility_types[] = {
"default", "protected", "hidden", "internal"
/* Dump symtab node. */
void
-dump_symtab_node (FILE *f, symtab_node node)
+dump_symtab_node (FILE *f, symtab_node *node)
{
if (cgraph_node *cnode = dyn_cast <cgraph_node> (node))
dump_cgraph_node (f, cnode);
void
dump_symtab (FILE *f)
{
- symtab_node node;
+ symtab_node *node;
fprintf (f, "Symbol table:\n\n");
FOR_EACH_SYMBOL (node)
dump_symtab_node (f, node);
/* Dump symtab node NODE to stderr. */
DEBUG_FUNCTION void
-debug_symtab_node (symtab_node node)
+debug_symtab_node (symtab_node *node)
{
dump_symtab_node (stderr, node);
}
/* Verify common part of symtab nodes. */
DEBUG_FUNCTION bool
-verify_symtab_base (symtab_node node)
+verify_symtab_base (symtab_node *node)
{
bool error_found = false;
- symtab_node hashed_node;
+ symtab_node *hashed_node;
if (is_a <cgraph_node> (node))
{
}
if (node->same_comdat_group)
{
- symtab_node n = node->same_comdat_group;
+ symtab_node *n = node->same_comdat_group;
if (!DECL_ONE_ONLY (n->decl))
{
/* Verify consistency of NODE. */
DEBUG_FUNCTION void
-verify_symtab_node (symtab_node node)
+verify_symtab_node (symtab_node *node)
{
if (seen_error ())
return;
DEBUG_FUNCTION void
verify_symtab (void)
{
- symtab_node node;
+ symtab_node *node;
FOR_EACH_SYMBOL (node)
verify_symtab_node (node);
}
Known only when doing LTO via linker plugin. */
bool
-symtab_used_from_object_file_p (symtab_node node)
+symtab_used_from_object_file_p (symtab_node *node)
{
if (!TREE_PUBLIC (node->decl) || DECL_EXTERNAL (node->decl))
return false;
/* Return availability of NODE. */
enum availability
-symtab_node_availability (symtab_node node)
+symtab_node_availability (symtab_node *node)
{
if (is_a <cgraph_node> (node))
return cgraph_function_body_availability (cgraph (node));
If NODE is not an alias, return NODE.
When AVAILABILITY is non-NULL, get minimal availability in the chain. */
-symtab_node
-symtab_alias_ultimate_target (symtab_node node, enum availability *availability)
+symtab_node *
+symtab_alias_ultimate_target (symtab_node *node, enum availability *availability)
{
bool weakref_p = false;
copy the visibility from the target to get things right. */
void
-fixup_same_cpp_alias_visibility (symtab_node node, symtab_node target)
+fixup_same_cpp_alias_visibility (symtab_node *node, symtab_node *target)
{
if (is_a <cgraph_node> (node))
{
it returns false. */
bool
-symtab_resolve_alias (symtab_node node, symtab_node target)
+symtab_resolve_alias (symtab_node *node, symtab_node *target)
{
- symtab_node n;
+ symtab_node *n;
gcc_assert (!node->analyzed
&& !vec_safe_length (node->ref_list.references));
skipped. */
bool
-symtab_for_node_and_aliases (symtab_node node,
- bool (*callback) (symtab_node, void *),
+symtab_for_node_and_aliases (symtab_node *node,
+ bool (*callback) (symtab_node *, void *),
void *data,
bool include_overwritable)
{
for (i = 0; ipa_ref_list_referring_iterate (&node->ref_list, i, ref); i++)
if (ref->use == IPA_REF_ALIAS)
{
- symtab_node alias = ref->referring;
+ symtab_node *alias = ref->referring;
if (include_overwritable
|| symtab_node_availability (alias) > AVAIL_OVERWRITABLE)
if (symtab_for_node_and_aliases (alias, callback, data,
/* Worker searching nonoverwritable alias. */
static bool
-symtab_nonoverwritable_alias_1 (symtab_node node, void *data)
+symtab_nonoverwritable_alias_1 (symtab_node *node, void *data)
{
if (decl_binds_to_current_def_p (node->decl))
{
- *(symtab_node *)data = node;
+ *(symtab_node **)data = node;
return true;
}
return false;
definition, return NODE. Otherwise look for alias with such property and if
none exists, introduce new one. */
-symtab_node
-symtab_nonoverwritable_alias (symtab_node node)
+symtab_node *
+symtab_nonoverwritable_alias (symtab_node *node)
{
tree new_decl;
- symtab_node new_node = NULL;
+ symtab_node *new_node = NULL;
/* First try to look up existing alias or base object
(if that is already non-overwritable). */
/* Return true if A and B represents semantically equivalent symbols. */
bool
-symtab_semantically_equivalent_p (symtab_node a,
- symtab_node b)
+symtab_semantically_equivalent_p (symtab_node *a,
+ symtab_node *b)
{
enum availability avail;
- symtab_node ba;
- symtab_node bb;
+ symtab_node *ba;
+ symtab_node *bb;
/* Equivalent functions are equivalent. */
if (a->decl == b->decl)
n->profile_id,
cgraph_node_name (n),
n->order,
- symtab_node_name (*(symtab_node*)val),
- (*(symtab_node *)val)->order);
+ symtab_node_name (*(symtab_node **)val),
+ (*(symtab_node **)val)->order);
n->profile_id = (n->profile_id + 1) & 0x7fffffff;
}
}
static tree
find_decl (tree target)
{
- symtab_node node = symtab_node_for_asm (target);
+ symtab_node *node = symtab_node_for_asm (target);
if (node)
return node->decl;
return NULL_TREE;
struct varpool_node *
varpool_node_for_asm (tree asmname)
{
- if (symtab_node node = symtab_node_for_asm (asmname))
+ if (symtab_node *node = symtab_node_for_asm (asmname))
return dyn_cast <varpool_node> (node);
else
return NULL;
if (node->same_comdat_group)
{
- symtab_node next;
+ symtab_node *next;
for (next = node->same_comdat_group;
next != node;
next = next->same_comdat_group)