+2013-10-29 David Malcolm <dmalcolm@redhat.com>
+
+ Patch autogenerated by refactor_symtab.py from
+ https://github.com/davidmalcolm/gcc-refactoring-scripts
+ revision 58bb219cc090b2f4516a9297d868c245495ee622
+
+ * asan.c (asan_finish_file): Update for conversion of symtab types to
+ a true class hierarchy.
+ * cfgexpand.c (estimated_stack_frame_size): Likewise.
+ * cgraph.c (cgraph_get_body): Likewise.
+ (cgraph_get_create_real_symbol_node): Likewise.
+ (verify_cgraph_node): Likewise.
+ (verify_edge_corresponds_to_fndecl): Likewise.
+ (verify_edge_count_and_frequency): Likewise.
+ (cgraph_will_be_removed_from_program_if_no_direct_calls): Likewise.
+ (cgraph_can_remove_if_no_direct_calls_p): Likewise.
+ (cgraph_can_remove_if_no_direct_calls_and_refs_p): Likewise.
+ (cgraph_node_cannot_return): Likewise.
+ (cgraph_set_pure_flag_1): Likewise.
+ (cgraph_set_const_flag_1): Likewise.
+ (cgraph_set_nothrow_flag_1): Likewise.
+ (cgraph_make_node_local_1): Likewise.
+ (cgraph_for_node_and_aliases): Likewise.
+ (cgraph_for_node_thunks_and_aliases): Likewise.
+ (cgraph_node_can_be_local_p): Likewise.
+ (cgraph_node_cannot_be_local_p_1): Likewise.
+ (cgraph_function_body_availability): Likewise.
+ (dump_cgraph_node): Likewise.
+ (cgraph_rtl_info): Likewise.
+ (cgraph_mark_address_taken_node): Likewise.
+ (cgraph_remove_node): Likewise.
+ (cgraph_release_function_body): Likewise.
+ (cgraph_update_edges_for_call_stmt_node): Likewise.
+ (cgraph_redirect_edge_call_stmt_to_callee): Likewise.
+ (cgraph_make_edge_direct): Likewise.
+ (cgraph_resolve_speculation): Likewise.
+ (cgraph_speculative_call_info): Likewise.
+ (cgraph_turn_edge_to_speculative): Likewise.
+ (cgraph_create_edge_1): Likewise.
+ (cgraph_set_call_stmt): Likewise.
+ (cgraph_node_for_asm): Likewise.
+ (cgraph_add_thunk): Likewise.
+ (cgraph_same_body_alias): Likewise.
+ (cgraph_create_function_alias): Likewise.
+ (cgraph_create_node): Likewise.
+ (cgraph_create_empty_node): Likewise.
+ (record_function_versions): Likewise.
+ (used_from_object_file_p): Likewise.
+ * cgraph.h (symtab_can_be_discarded): Likewise.
+ (symtab_real_symbol_p): Likewise.
+ (cgraph_mark_force_output_node): Likewise.
+ (cgraph_edge_recursive_p): Likewise.
+ (symtab_alias_target): Likewise.
+ (varpool_all_refs_explicit_p): Likewise.
+ (varpool_can_remove_if_no_refs): Likewise.
+ (cgraph_only_called_directly_or_aliased_p): Likewise.
+ (cgraph_next_function_with_gimple_body): Likewise.
+ (cgraph_first_function_with_gimple_body): Likewise.
+ (cgraph_function_with_gimple_body_p): Likewise.
+ (cgraph_next_function): Likewise.
+ (cgraph_first_function): Likewise.
+ (cgraph_next_defined_function): Likewise.
+ (cgraph_first_defined_function): Likewise.
+ (varpool_next_defined_variable): Likewise.
+ (varpool_first_defined_variable): Likewise.
+ (varpool_next_static_initializer): Likewise.
+ (varpool_first_static_initializer): Likewise.
+ (varpool_next_variable): Likewise.
+ (varpool_first_variable): Likewise.
+ (varpool_node_name): Likewise.
+ (varpool): Likewise.
+ (cgraph): Likewise.
+ (is_a_helper <varpool_node>::test): Likewise.
+ (is_a_helper <cgraph_node>::test): Likewise.
+ (varpool_variable_node): Likewise.
+ (cgraph_function_or_thunk_node): Likewise.
+ (varpool_alias_target): Likewise.
+ (cgraph_alias_target): Likewise.
+ (cgraph_node_name): Likewise.
+ (varpool_node_asm_name): Likewise.
+ (cgraph_node_asm_name): Likewise.
+ * cgraphbuild.c (remove_cgraph_callee_edges): Likewise.
+ (cgraph_rebuild_references): Likewise.
+ (rebuild_cgraph_edges): Likewise.
+ (record_eh_tables): Likewise.
+ (build_cgraph_edges): Likewise.
+ (mark_store): Likewise.
+ (mark_load): Likewise.
+ (mark_address): Likewise.
+ (record_type_list): Likewise.
+ (record_reference): Likewise.
+ * cgraphclones.c (cgraph_materialize_all_clones): Likewise.
+ (cgraph_materialize_clone): Likewise.
+ (cgraph_function_versioning): Likewise.
+ (cgraph_copy_node_for_versioning): Likewise.
+ (update_call_expr): Likewise.
+ (cgraph_find_replacement_node): Likewise.
+ (cgraph_create_virtual_clone): Likewise.
+ (cgraph_clone_node): Likewise.
+ * cgraphunit.c (compile): Likewise.
+ (output_weakrefs): Likewise.
+ (output_in_order): Likewise.
+ (expand_function): Likewise.
+ (assemble_thunks_and_aliases): Likewise.
+ (expand_thunk): Likewise.
+ (mark_functions_to_output): Likewise.
+ (handle_alias_pairs): Likewise.
+ (analyze_functions): Likewise.
+ (walk_polymorphic_call_targets): Likewise.
+ (varpool_finalize_decl): Likewise.
+ (process_function_and_variable_attributes): Likewise.
+ (cgraph_process_same_body_aliases): Likewise.
+ (analyze_function): Likewise.
+ (cgraph_add_new_function): Likewise.
+ (cgraph_finalize_function): Likewise.
+ (referred_to_p): Likewise.
+ (cgraph_reset_node): Likewise.
+ (cgraph_process_new_functions): Likewise.
+ (enqueue_node): Likewise.
+ (decide_is_symbol_needed): Likewise.
+ * coverage.c (coverage_compute_profile_id): Likewise.
+ * dbxout.c (dbxout_expand_expr): Likewise.
+ * dwarf2out.c (premark_types_used_by_global_vars_helper): Likewise.
+ (reference_to_unused): Likewise.
+ * gimple-fold.c (can_refer_decl_in_current_unit_p): Likewise.
+ * gimplify.c (unvisit_body): Likewise.
+ (unshare_body): Likewise.
+ * ipa-cp.c (ipcp_generate_summary): Likewise.
+ (ipcp_decision_stage): Likewise.
+ (identify_dead_nodes): Likewise.
+ (decide_whether_version_node): Likewise.
+ (decide_about_value): Likewise.
+ (perhaps_add_new_callers): Likewise.
+ (create_specialized_node): Likewise.
+ (update_profiling_info): Likewise.
+ (ipcp_propagate_stage): Likewise.
+ (estimate_local_effects): Likewise.
+ (good_cloning_opportunity_p): Likewise.
+ (devirtualization_time_bonus): Likewise.
+ (propagate_constants_accross_call): Likewise.
+ (initialize_node_lattices): Likewise.
+ (ipcp_cloning_candidate_p): Likewise.
+ (determine_versionability): Likewise.
+ (print_all_lattices): Likewise.
+ (print_lattice): Likewise.
+ (ipcp_discover_new_direct_edges): Likewise.
+ * ipa-devirt.c (ipa_devirt): Likewise.
+ (likely_target_p): Likewise.
+ (update_type_inheritance_graph): Likewise.
+ (possible_polymorphic_call_target_p): Likewise.
+ (dump_possible_polymorphic_call_targets): Likewise.
+ (devirt_variable_node_removal_hook): Likewise.
+ (record_binfo): Likewise.
+ (maybe_record_node): Likewise.
+ (build_type_inheritance_graph): Likewise.
+ * ipa-inline-analysis.c (inline_write_summary): Likewise.
+ (inline_generate_summary): Likewise.
+ (inline_analyze_function): Likewise.
+ (do_estimate_growth): Likewise.
+ (simple_edge_hints): Likewise.
+ (estimate_node_size_and_time): Likewise.
+ (estimate_edge_devirt_benefit): Likewise.
+ (compute_inline_parameters): Likewise.
+ (estimate_function_body_sizes): Likewise.
+ (compute_bb_predicates): Likewise.
+ (initialize_inline_failed): Likewise.
+ (dump_inline_summary): Likewise.
+ (dump_inline_edge_summary): Likewise.
+ * ipa-inline-transform.c (inline_transform): Likewise.
+ (preserve_function_body_p): Likewise.
+ (save_inline_function_body): Likewise.
+ (inline_call): Likewise.
+ (clone_inlined_nodes): Likewise.
+ (can_remove_node_now_p): Likewise.
+ (can_remove_node_now_p_1): Likewise.
+ * ipa-inline.c (early_inliner): Likewise.
+ (early_inline_small_functions): Likewise.
+ (inline_always_inline_functions): Likewise.
+ (ipa_inline): Likewise.
+ (flatten_function): Likewise.
+ (inline_small_functions): Likewise.
+ (speculation_useful_p): Likewise.
+ (recursive_inlining): Likewise.
+ (update_caller_keys): Likewise.
+ (reset_edge_caches): Likewise.
+ (update_edge_key): Likewise.
+ (edge_badness): Likewise.
+ (relative_time_benefit): Likewise.
+ (want_inline_self_recursive_call_p): Likewise.
+ (want_inline_small_function_p): Likewise.
+ (want_early_inline_function_p): Likewise.
+ (num_calls): Likewise.
+ (can_early_inline_edge_p): Likewise.
+ (can_inline_edge_p): Likewise.
+ (report_inline_failed_reason): Likewise.
+ * ipa-profile.c (ipa_profile): Likewise.
+ (ipa_propagate_frequency): Likewise.
+ (ipa_propagate_frequency_1): Likewise.
+ (ipa_profile_generate_summary): Likewise.
+ * ipa-prop.c (ipcp_transform_function): Likewise.
+ (read_replacements_section): Likewise.
+ (ipa_prop_read_section): Likewise.
+ (ipa_modify_call_arguments): Likewise.
+ (ipa_print_node_params): Likewise.
+ (propagate_controlled_uses): Likewise.
+ (update_indirect_edges_after_inlining): Likewise.
+ (remove_described_reference): Likewise.
+ (ipa_make_edge_direct_to_target): Likewise.
+ (ipa_analyze_node): Likewise.
+ (ipa_analyze_params_uses): Likewise.
+ (ipa_compute_jump_functions): Likewise.
+ (ipa_get_callee_param_type): Likewise.
+ (ipa_print_node_jump_functions): Likewise.
+ (ipa_initialize_node_params): Likewise.
+ (ipa_populate_param_decls): Likewise.
+ (ipa_func_spec_opts_forbid_analysis_p): Likewise.
+ (write_agg_replacement_chain): Likewise.
+ (ipa_write_node_info): Likewise.
+ (ipa_edge_duplication_hook): Likewise.
+ (try_decrement_rdesc_refcount): Likewise.
+ * ipa-pure-const.c (propagate_nothrow): Likewise.
+ (propagate_pure_const): Likewise.
+ (pure_const_read_summary): Likewise.
+ (pure_const_write_summary): Likewise.
+ (analyze_function): Likewise.
+ * ipa-ref-inline.h (ipa_ref_referred_ref_list): Likewise.
+ (ipa_ref_referring_ref_list): Likewise.
+ * ipa-ref.c (ipa_clear_stmts_in_references): Likewise.
+ (ipa_remove_stmt_references): Likewise.
+ (ipa_find_reference): Likewise.
+ (ipa_dump_referring): Likewise.
+ (ipa_dump_references): Likewise.
+ (ipa_record_reference): Likewise.
+ * ipa-reference.c (ipa_reference_read_optimization_summary): Likewise.
+ (ipa_reference_write_optimization_summary): Likewise.
+ (write_node_summary_p): Likewise.
+ (propagate): Likewise.
+ (read_write_all_from_decl): Likewise.
+ (generate_summary): Likewise.
+ (analyze_function): Likewise.
+ (propagate_bits): Likewise.
+ (ipa_reference_get_not_written_global): Likewise.
+ (ipa_reference_get_not_read_global): Likewise.
+ * ipa-split.c (execute_split_functions): Likewise.
+ (split_function): Likewise.
+ * ipa-utils.c (ipa_merge_profiles): Likewise.
+ (dump_cgraph_node_set): Likewise.
+ (ipa_reverse_postorder): Likewise.
+ (ipa_edge_within_scc): Likewise.
+ (ipa_get_nodes_in_cycle): Likewise.
+ (ipa_free_postorder_info): Likewise.
+ (ipa_reduced_postorder): Likewise.
+ (searchc): Likewise.
+ (recursive_call_p): Likewise.
+ * ipa.c (ipa_cdtor_merge): Likewise.
+ (record_cdtor_fn): Likewise.
+ (function_and_variable_visibility): Likewise.
+ (varpool_externally_visible_p): Likewise.
+ (cgraph_externally_visible_p): Likewise.
+ (comdat_can_be_unshared_p): Likewise.
+ (comdat_can_be_unshared_p_1): Likewise.
+ (address_taken_from_non_vtable_p): Likewise.
+ (ipa_discover_readonly_nonaddressable_vars): Likewise.
+ (symtab_remove_unreachable_nodes): Likewise.
+ (walk_polymorphic_call_targets): Likewise.
+ (process_references): Likewise.
+ (enqueue_node): Likewise.
+ (has_addr_references_p): Likewise.
+ (cgraph_non_local_node_p_1): Likewise.
+ * is-a.h (varpool_analyze_node): Likewise.
+ * lto-cgraph.c (input_symtab): Likewise.
+ (merge_profile_summaries): Likewise.
+ (input_cgraph_1): Likewise.
+ (input_edge): Likewise.
+ (input_varpool_node): Likewise.
+ (input_node): Likewise.
+ (input_overwrite_node): Likewise.
+ (compute_ltrans_boundary): Likewise.
+ (output_refs): Likewise.
+ (lto_output_varpool_node): Likewise.
+ (lto_output_node): Likewise.
+ (reachable_from_other_partition_p): Likewise.
+ (referenced_from_other_partition_p): Likewise.
+ (lto_output_edge): Likewise.
+ (output_node_opt_summary): Likewise.
+ (add_node_to): Likewise.
+ (reachable_from_this_partition_p): Likewise.
+ (lto_set_symtab_encoder_in_partition): Likewise.
+ (lto_symtab_encoder_in_partition_p): Likewise.
+ (lto_set_symtab_encoder_encode_initializer): Likewise.
+ (lto_symtab_encoder_encode_initializer_p): Likewise.
+ (lto_set_symtab_encoder_encode_body): Likewise.
+ (lto_symtab_encoder_encode_body_p): Likewise.
+ * lto-section-in.c (lto_free_function_in_decl_state_for_node):
+ Likewise.
+ * lto-streamer-in.c (lto_read_body): Likewise.
+ (fixup_call_stmt_edges): Likewise.
+ (fixup_call_stmt_edges_1): Likewise.
+ * lto-streamer-out.c (produce_symtab): Likewise.
+ (output_symbol_p): Likewise.
+ (write_symbol): Likewise.
+ (lto_output): Likewise.
+ (copy_function): Likewise.
+ (output_function): Likewise.
+ * passes.c (function_called_by_processed_nodes_p): Likewise.
+ (ipa_write_optimization_summaries): Likewise.
+ (ipa_write_summaries): Likewise.
+ (do_per_function_toporder): Likewise.
+ (do_per_function): Likewise.
+ (dump_passes): Likewise.
+ * symtab.c (symtab_semantically_equivalent_p): Likewise.
+ (symtab_nonoverwritable_alias): Likewise.
+ (symtab_nonoverwritable_alias_1): Likewise.
+ (symtab_for_node_and_aliases): Likewise.
+ (symtab_resolve_alias): Likewise.
+ (fixup_same_cpp_alias_visibility): Likewise.
+ (symtab_alias_ultimate_target): Likewise.
+ (symtab_used_from_object_file_p): Likewise.
+ (verify_symtab_base): Likewise.
+ (dump_symtab_base): Likewise.
+ (symtab_node_name): Likewise.
+ (symtab_node_asm_name): Likewise.
+ (symtab_dissolve_same_comdat_group_list): Likewise.
+ (symtab_add_to_same_comdat_group): Likewise.
+ (symtab_unregister_node): Likewise.
+ (symtab_insert_node_to_hashtable): Likewise.
+ (symtab_register_node): Likewise.
+ (unlink_from_assembler_name_hash): Likewise.
+ (insert_to_assembler_name_hash): Likewise.
+ (eq_assembler_name): Likewise.
+ (hash_node_by_assembler_name): Likewise.
+ (eq_node): Likewise.
+ (hash_node): Likewise.
+ * toplev.c (wrapup_global_declaration_2): Likewise.
+ * trans-mem.c (ipa_tm_execute): Likewise.
+ (ipa_tm_transform_clone): Likewise.
+ (ipa_tm_transform_transaction): Likewise.
+ (ipa_tm_transform_calls_redirect): Likewise.
+ (ipa_tm_insert_gettmclone_call): Likewise.
+ (ipa_tm_insert_irr_call): Likewise.
+ (ipa_tm_create_version): Likewise.
+ (ipa_tm_create_version_alias): Likewise.
+ (ipa_tm_mark_forced_by_abi_node): Likewise.
+ (ipa_tm_mark_force_output_node): Likewise.
+ (ipa_tm_diagnose_tm_safe): Likewise.
+ (ipa_tm_mayenterirr_function): Likewise.
+ (ipa_tm_scan_irr_function): Likewise.
+ (ipa_tm_note_irrevocable): Likewise.
+ (ipa_tm_scan_calls_clone): Likewise.
+ (get_cg_data): Likewise.
+ * tree-eh.c (tree_could_trap_p): Likewise.
+ * tree-emutls.c (ipa_lower_emutls): Likewise.
+ (create_emultls_var): Likewise.
+ (lower_emutls_function_body): Likewise.
+ (gen_emutls_addr): Likewise.
+ (emutls_decl): Likewise.
+ (new_emutls_decl): Likewise.
+ * tree-inline.c (tree_function_versioning): Likewise.
+ (optimize_inline_calls): Likewise.
+ (expand_call_inline): Likewise.
+ (estimate_num_insns): Likewise.
+ (copy_bb): Likewise.
+ (delete_unreachable_blocks_update_callgraph): Likewise.
+ * tree-nested.c (gimplify_all_functions): Likewise.
+ (create_nesting_tree): Likewise.
+ (check_for_nested_with_variably_modified): Likewise.
+ * tree-pretty-print.c (dump_function_header): Likewise.
+ * tree-profile.c (tree_profiling): Likewise.
+ * tree-sra.c (ipa_sra_preliminary_function_checks): Likewise.
+ (modify_function): Likewise.
+ (convert_callers): Likewise.
+ (convert_callers_for_node): Likewise.
+ * tree-ssa-structalias.c (ipa_pta_execute): Likewise.
+ (associate_varinfo_to_alias): Likewise.
+ (create_variable_info_for): Likewise.
+ (get_constraint_for_ssa_var): Likewise.
+ * tree-vectorizer.c (increase_alignment): Likewise.
+ * tree.c (find_decls_types_in_var): Likewise.
+ (find_decls_types_in_node): Likewise.
+ (free_lang_data_in_decl): Likewise.
+ * value-prof.c (gimple_ic_transform): Likewise.
+ (gimple_ic): Likewise.
+ (check_ic_target): Likewise.
+ (init_node_map): Likewise.
+ * varasm.c (decl_binds_to_current_def_p): Likewise.
+ (default_binds_local_p_1): Likewise.
+ (dump_tm_clone_pairs): Likewise.
+ (assemble_alias): Likewise.
+ (find_decl): Likewise.
+ (mark_decl_referenced): Likewise.
+ * varpool.c (varpool_for_node_and_aliases): Likewise.
+ (varpool_extra_name_alias): Likewise.
+ (varpool_create_variable_alias): Likewise.
+ (add_new_static_var): Likewise.
+ (varpool_finalize_named_section_flags): Likewise.
+ (varpool_remove_unreferenced_decls): Likewise.
+ (enqueue_node): Likewise.
+ (varpool_assemble_decl): Likewise.
+ (assemble_aliases): Likewise.
+ (varpool_analyze_node): Likewise.
+ (cgraph_variable_initializer_availability): Likewise.
+ (varpool_add_new_variable): Likewise.
+ (ctor_for_folding): Likewise.
+ (dump_varpool_node): Likewise.
+ (varpool_remove_initializer): Likewise.
+ (varpool_remove_node): Likewise.
+ (varpool_node_for_decl): Likewise.
+ (varpool_create_empty_node): Likewise.
+ * config/i386/i386.c (ix86_generate_version_dispatcher_body):
+ Likewise.
+ (ix86_get_function_versions_dispatcher): Likewise.
+
2013-10-29 David Malcolm <dmalcolm@redhat.com>
* cgraph.h (symtab_node_base): Convert to a class;
+2013-10-29 David Malcolm <dmalcolm@redhat.com>
+
+ Patch autogenerated by refactor_symtab.py from
+ https://github.com/davidmalcolm/gcc-refactoring-scripts
+ revision 58bb219cc090b2f4516a9297d868c245495ee622
+
+ * gcc-interface/trans.c (finalize_nrv): Update for conversion of
+ symtab types to a true class hierarchy.
+ * gcc-interface/utils.c (gnat_write_global_declarations): Likewise.
+
2013-10-28 Trevor Saunders <tsaunders@mozilla.com>
* gcc-interface/decl.c (components_to_record): Adjust.
/* Prune also the candidates that are referenced by nested functions. */
node = cgraph_get_create_node (fndecl);
for (node = node->nested; node; node = node->next_nested)
- walk_tree_without_duplicates (&DECL_SAVED_TREE (node->symbol.decl), prune_nrv_r,
+ walk_tree_without_duplicates (&DECL_SAVED_TREE (node->decl), prune_nrv_r,
&data);
if (bitmap_empty_p (nrv))
return;
TREE_STATIC (dummy_global) = 1;
TREE_ASM_WRITTEN (dummy_global) = 1;
node = varpool_node_for_decl (dummy_global);
- node->symbol.force_output = 1;
+ node->force_output = 1;
while (!types_used_by_cur_var_decl->is_empty ())
{
tree fn = builtin_decl_implicit (BUILT_IN_ASAN_INIT);
append_to_statement_list (build_call_expr (fn, 0), &asan_ctor_statements);
FOR_EACH_DEFINED_VARIABLE (vnode)
- if (TREE_ASM_WRITTEN (vnode->symbol.decl)
- && asan_protect_global (vnode->symbol.decl))
+ if (TREE_ASM_WRITTEN (vnode->decl)
+ && asan_protect_global (vnode->decl))
++gcount;
htab_t const_desc_htab = constant_pool_htab ();
htab_traverse (const_desc_htab, count_string_csts, &gcount);
DECL_IGNORED_P (var) = 1;
vec_alloc (v, gcount);
FOR_EACH_DEFINED_VARIABLE (vnode)
- if (TREE_ASM_WRITTEN (vnode->symbol.decl)
- && asan_protect_global (vnode->symbol.decl))
- asan_add_global (vnode->symbol.decl, TREE_TYPE (type), v);
+ if (TREE_ASM_WRITTEN (vnode->decl)
+ && asan_protect_global (vnode->decl))
+ asan_add_global (vnode->decl, TREE_TYPE (type), v);
struct asan_add_string_csts_data aascd;
aascd.type = TREE_TYPE (type);
aascd.v = v;
+2013-10-29 David Malcolm <dmalcolm@redhat.com>
+
+ Patch autogenerated by refactor_symtab.py from
+ https://github.com/davidmalcolm/gcc-refactoring-scripts
+ revision 58bb219cc090b2f4516a9297d868c245495ee622
+
+ * c-gimplify.c (c_genericize): Update for conversion of symtab types
+ to a true class hierarchy.
+ * c-pragma.c (maybe_apply_pending_pragma_weaks): Likewise.
+
2013-10-27 Richard Sandiford <rdsandiford@googlemail.com>
* c-lex.c (interpret_integer): Remove call to cpp_num_sign_extend.
/* Dump all nested functions now. */
cgn = cgraph_get_create_node (fndecl);
for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested)
- c_genericize (cgn->symbol.decl);
+ c_genericize (cgn->decl);
}
static void
target = symtab_node_for_asm (id);
decl = build_decl (UNKNOWN_LOCATION,
- target ? TREE_CODE (target->symbol.decl) : FUNCTION_DECL,
+ target ? TREE_CODE (target->decl) : FUNCTION_DECL,
alias_id, default_function_type);
DECL_ARTIFICIAL (decl) = 1;
HOST_WIDE_INT size = 0;
size_t i;
tree var;
- struct function *fn = DECL_STRUCT_FUNCTION (node->symbol.decl);
+ struct function *fn = DECL_STRUCT_FUNCTION (node->decl);
push_cfun (fn);
/* Macros to access the next item in the list of free cgraph nodes and
edges. */
-#define NEXT_FREE_NODE(NODE) cgraph ((NODE)->symbol.next)
-#define SET_NEXT_FREE_NODE(NODE,NODE2) ((NODE))->symbol.next = (symtab_node)NODE2
+#define NEXT_FREE_NODE(NODE) cgraph ((NODE)->next)
+#define SET_NEXT_FREE_NODE(NODE,NODE2) ((NODE))->next = NODE2
#define NEXT_FREE_EDGE(EDGE) (EDGE)->prev_caller
/* Register HOOK to be called with DATA on each removed edge. */
{
struct cgraph_node *node = cgraph_allocate_node ();
- node->symbol.type = SYMTAB_FUNCTION;
+ node->type = SYMTAB_FUNCTION;
node->frequency = NODE_FREQUENCY_NORMAL;
node->count_materialization_scale = REG_BR_PROB_BASE;
cgraph_n_nodes++;
struct cgraph_node *node = cgraph_create_empty_node ();
gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
- node->symbol.decl = decl;
- symtab_register_node ((symtab_node) node);
+ node->decl = decl;
+ symtab_register_node (node);
if (DECL_CONTEXT (decl) && TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL)
{
|| TREE_CODE (target) == IDENTIFIER_NODE);
gcc_assert (TREE_CODE (alias) == FUNCTION_DECL);
alias_node = cgraph_get_create_node (alias);
- gcc_assert (!alias_node->symbol.definition);
- alias_node->symbol.alias_target = target;
- alias_node->symbol.definition = true;
- alias_node->symbol.alias = true;
+ gcc_assert (!alias_node->definition);
+ alias_node->alias_target = target;
+ alias_node->definition = true;
+ alias_node->alias = true;
if (lookup_attribute ("weakref", DECL_ATTRIBUTES (alias)) != NULL)
- alias_node->symbol.weakref = true;
+ alias_node->weakref = true;
return alias_node;
}
return NULL;
n = cgraph_create_function_alias (alias, decl);
- n->symbol.cpp_implicit_alias = true;
+ n->cpp_implicit_alias = true;
if (cpp_implicit_aliases_done)
- symtab_resolve_alias ((symtab_node)n,
- (symtab_node)cgraph_get_node (decl));
+ symtab_resolve_alias (n,
+ cgraph_get_node (decl));
return n;
}
node = cgraph_get_node (alias);
if (node)
{
- gcc_assert (node->symbol.definition);
- gcc_assert (!node->symbol.alias);
+ gcc_assert (node->definition);
+ gcc_assert (!node->alias);
gcc_assert (!node->thunk.thunk_p);
cgraph_remove_node (node);
}
node->thunk.virtual_offset_p = virtual_offset != NULL;
node->thunk.alias = real_alias;
node->thunk.thunk_p = true;
- node->symbol.definition = true;
+ node->definition = true;
return node;
}
/* We do not want to look at inline clones. */
for (symtab_node node = symtab_node_for_asm (asmname);
node;
- node = node->symbol.next_sharing_asm_name)
+ node = node->next_sharing_asm_name)
{
cgraph_node *cn = dyn_cast <cgraph_node> (node);
if (cn && !cn->global.inlined_to)
e = cgraph_make_edge_direct (e, new_callee);
}
- push_cfun (DECL_STRUCT_FUNCTION (e->caller->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (e->caller->decl));
e->can_throw_external = stmt_can_throw_external (new_stmt);
pop_cfun ();
if (e->caller->call_site_hash)
gcc_assert (freq <= CGRAPH_FREQ_MAX);
edge->call_stmt = call_stmt;
- push_cfun (DECL_STRUCT_FUNCTION (caller->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (caller->decl));
edge->can_throw_external
= call_stmt ? stmt_can_throw_external (call_stmt) : false;
pop_cfun ();
if (call_stmt
- && callee && callee->symbol.decl
- && !gimple_check_call_matching_types (call_stmt, callee->symbol.decl,
+ && callee && callee->decl
+ && !gimple_check_call_matching_types (call_stmt, callee->decl,
false))
edge->call_stmt_cannot_inline_p = true;
else
{
fprintf (dump_file, "Indirect call -> speculative call"
" %s/%i => %s/%i\n",
- xstrdup (cgraph_node_name (n)), n->symbol.order,
- xstrdup (cgraph_node_name (n2)), n2->symbol.order);
+ xstrdup (cgraph_node_name (n)), n->order,
+ xstrdup (cgraph_node_name (n2)), n2->order);
}
e->speculative = true;
e2 = cgraph_create_edge (n, n2, e->call_stmt, direct_count, direct_frequency);
initialize_inline_failed (e2);
e2->speculative = true;
- if (TREE_NOTHROW (n2->symbol.decl))
+ if (TREE_NOTHROW (n2->decl))
e2->can_throw_external = false;
else
e2->can_throw_external = e->can_throw_external;
e->count -= e2->count;
e->frequency -= e2->frequency;
cgraph_call_edge_duplication_hooks (e, e2);
- ref = ipa_record_reference ((symtab_node)n, (symtab_node)n2,
+ ref = ipa_record_reference (n, n2,
IPA_REF_ADDR, e->call_stmt);
ref->lto_stmt_uid = e->lto_stmt_uid;
ref->speculative = e->speculative;
indirect = e2;
reference = NULL;
- for (i = 0; ipa_ref_list_reference_iterate (&e->caller->symbol.ref_list,
+ for (i = 0; ipa_ref_list_reference_iterate (&e->caller->ref_list,
i, ref); i++)
if (ref->speculative
&& ((ref->stmt && ref->stmt == e->call_stmt)
gcc_assert (edge->speculative);
cgraph_speculative_call_info (edge, e2, edge, ref);
if (!callee_decl
- || !symtab_semantically_equivalent_p ((symtab_node) ref->referred,
+ || !symtab_semantically_equivalent_p (ref->referred,
symtab_get_node (callee_decl)))
{
if (dump_file)
{
fprintf (dump_file, "Speculative indirect call %s/%i => %s/%i has "
"turned out to have contradicting known target ",
- xstrdup (cgraph_node_name (edge->caller)), edge->caller->symbol.order,
- xstrdup (cgraph_node_name (e2->callee)), e2->callee->symbol.order);
+ xstrdup (cgraph_node_name (edge->caller)), edge->caller->order,
+ xstrdup (cgraph_node_name (e2->callee)), e2->callee->order);
print_generic_expr (dump_file, callee_decl, 0);
fprintf (dump_file, "\n");
}
else
{
fprintf (dump_file, "Removing speculative call %s/%i => %s/%i\n",
- xstrdup (cgraph_node_name (edge->caller)), edge->caller->symbol.order,
- xstrdup (cgraph_node_name (e2->callee)), e2->callee->symbol.order);
+ xstrdup (cgraph_node_name (edge->caller)), edge->caller->order,
+ xstrdup (cgraph_node_name (e2->callee)), e2->callee->order);
}
}
}
/* If we are redirecting speculative call, make it non-speculative. */
if (edge->indirect_unknown_callee && edge->speculative)
{
- edge = cgraph_resolve_speculation (edge, callee->symbol.decl);
+ edge = cgraph_resolve_speculation (edge, callee->decl);
/* On successful speculation just return the pre existing direct edge. */
if (!edge->indirect_unknown_callee)
if (edge->call_stmt)
edge->call_stmt_cannot_inline_p
- = !gimple_check_call_matching_types (edge->call_stmt, callee->symbol.decl,
+ = !gimple_check_call_matching_types (edge->call_stmt, callee->decl,
false);
/* We need to re-determine the inlining status of the edge. */
signature. We did not update the call statement yet, so compare it
with the reference that still points to the proper type. */
else if (!gimple_check_call_matching_types (e->call_stmt,
- ref->referred->symbol.decl,
+ ref->referred->decl,
true))
{
if (dump_file)
fprintf (dump_file, "Not expanding speculative call of %s/%i -> %s/%i\n"
"Type mismatch.\n",
xstrdup (cgraph_node_name (e->caller)),
- e->caller->symbol.order,
+ e->caller->order,
xstrdup (cgraph_node_name (e->callee)),
- e->callee->symbol.order);
+ e->callee->order);
e = cgraph_resolve_speculation (e, NULL);
/* We are producing the final function body and will throw away the
callgraph edges really soon. Reset the counts/frequencies to
keep verifier happy in the case of roundoff errors. */
e->count = gimple_bb (e->call_stmt)->count;
e->frequency = compute_call_stmt_bb_frequency
- (e->caller->symbol.decl, gimple_bb (e->call_stmt));
+ (e->caller->decl, gimple_bb (e->call_stmt));
}
/* Expand speculation into GIMPLE code. */
else
"Expanding speculative call of %s/%i -> %s/%i count:"
HOST_WIDEST_INT_PRINT_DEC"\n",
xstrdup (cgraph_node_name (e->caller)),
- e->caller->symbol.order,
+ e->caller->order,
xstrdup (cgraph_node_name (e->callee)),
- e->callee->symbol.order,
+ e->callee->order,
(HOST_WIDEST_INT)e->count);
gcc_assert (e2->speculative);
- push_cfun (DECL_STRUCT_FUNCTION (e->caller->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (e->caller->decl));
new_stmt = gimple_ic (e->call_stmt, cgraph (ref->referred),
e->count || e2->count
? RDIV (e->count * REG_BR_PROB_BASE,
cgraph_set_call_stmt_including_clones (e->caller, e->call_stmt,
new_stmt, false);
e->frequency = compute_call_stmt_bb_frequency
- (e->caller->symbol.decl, gimple_bb (e->call_stmt));
+ (e->caller->decl, gimple_bb (e->call_stmt));
e2->frequency = compute_call_stmt_bb_frequency
- (e2->caller->symbol.decl, gimple_bb (e2->call_stmt));
+ (e2->caller->decl, gimple_bb (e2->call_stmt));
e2->speculative = false;
ref->speculative = false;
ref->stmt = NULL;
}
if (e->indirect_unknown_callee
- || decl == e->callee->symbol.decl)
+ || decl == e->callee->decl)
return e->call_stmt;
#ifdef ENABLE_CHECKING
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "updating call of %s/%i -> %s/%i: ",
- xstrdup (cgraph_node_name (e->caller)), e->caller->symbol.order,
- xstrdup (cgraph_node_name (e->callee)), e->callee->symbol.order);
+ xstrdup (cgraph_node_name (e->caller)), e->caller->order,
+ xstrdup (cgraph_node_name (e->callee)), e->callee->order);
print_gimple_stmt (cgraph_dump_file, e->call_stmt, 0, dump_flags);
if (e->callee->clone.combined_args_to_skip)
{
new_stmt
= gimple_call_copy_skip_args (e->call_stmt,
e->callee->clone.combined_args_to_skip);
- gimple_call_set_fndecl (new_stmt, e->callee->symbol.decl);
+ gimple_call_set_fndecl (new_stmt, e->callee->decl);
gimple_call_set_fntype (new_stmt, gimple_call_fntype (e->call_stmt));
if (gimple_vdef (new_stmt)
else
{
new_stmt = e->call_stmt;
- gimple_call_set_fndecl (new_stmt, e->callee->symbol.decl);
+ gimple_call_set_fndecl (new_stmt, e->callee->decl);
update_stmt (new_stmt);
}
struct cgraph_node *callee = e->callee;
while (callee)
{
- if (callee->symbol.decl == new_call
+ if (callee->decl == new_call
|| callee->former_clone_of == new_call)
return;
callee = callee->clone_of;
node->ipa_transforms_to_apply.release ();
if (!node->used_as_abstract_origin && cgraph_state != CGRAPH_STATE_PARSING)
{
- DECL_RESULT (node->symbol.decl) = NULL;
- DECL_ARGUMENTS (node->symbol.decl) = NULL;
+ DECL_RESULT (node->decl) = NULL;
+ DECL_ARGUMENTS (node->decl) = NULL;
}
/* If the node is abstract and needed, then do not clear DECL_INITIAL
of its associated function function declaration because it's
needed to emit debug info later. */
- if (!node->used_as_abstract_origin && DECL_INITIAL (node->symbol.decl))
- DECL_INITIAL (node->symbol.decl) = error_mark_node;
- release_function_body (node->symbol.decl);
- if (node->symbol.lto_file_data)
- lto_free_function_in_decl_state_for_node ((symtab_node) node);
+ if (!node->used_as_abstract_origin && DECL_INITIAL (node->decl))
+ DECL_INITIAL (node->decl) = error_mark_node;
+ release_function_body (node->decl);
+ if (node->lto_file_data)
+ lto_free_function_in_decl_state_for_node (node);
}
/* Remove the node from cgraph. */
/* Incremental inlining access removed nodes stored in the postorder list.
*/
- node->symbol.force_output = false;
- node->symbol.forced_by_abi = false;
+ node->force_output = false;
+ node->forced_by_abi = false;
for (n = node->nested; n; n = n->next_nested)
n->origin = NULL;
node->nested = NULL;
node2 = &(*node2)->next_nested;
*node2 = node->next_nested;
}
- symtab_unregister_node ((symtab_node)node);
+ symtab_unregister_node (node);
if (node->prev_sibling_clone)
node->prev_sibling_clone->next_sibling_clone = node->next_sibling_clone;
else if (node->clone_of)
*/
if (cgraph_state != CGRAPH_LTO_STREAMING)
{
- n = cgraph_get_node (node->symbol.decl);
+ n = cgraph_get_node (node->decl);
if (!n
|| (!n->clones && !n->clone_of && !n->global.inlined_to
&& (cgraph_global_info_ready
- && (TREE_ASM_WRITTEN (n->symbol.decl)
- || DECL_EXTERNAL (n->symbol.decl)
- || !n->symbol.analyzed
- || (!flag_wpa && n->symbol.in_other_partition)))))
+ && (TREE_ASM_WRITTEN (n->decl)
+ || DECL_EXTERNAL (n->decl)
+ || !n->analyzed
+ || (!flag_wpa && n->in_other_partition)))))
cgraph_release_function_body (node);
}
- node->symbol.decl = NULL;
+ node->decl = NULL;
if (node->call_site_hash)
{
htab_delete (node->call_site_hash);
/* Clear out the node to NULL all pointers and add the node to the free
list. */
memset (node, 0, sizeof (*node));
- node->symbol.type = SYMTAB_FUNCTION;
+ node->type = SYMTAB_FUNCTION;
node->uid = uid;
SET_NEXT_FREE_NODE (node, free_nodes);
free_nodes = node;
of the object was taken (and thus it should be set on node alias is
referring to). We should remove the first use and the remove the
following set. */
- node->symbol.address_taken = 1;
+ node->address_taken = 1;
node = cgraph_function_or_thunk_node (node, NULL);
- node->symbol.address_taken = 1;
+ node->address_taken = 1;
}
/* Return local info for the compiled function. */
node = cgraph_get_node (decl);
if (!node
|| (decl != current_function_decl
- && !TREE_ASM_WRITTEN (node->symbol.decl)))
+ && !TREE_ASM_WRITTEN (node->decl)))
return NULL;
return &node->rtl;
}
struct cgraph_edge *edge;
int indirect_calls_count = 0;
- dump_symtab_base (f, (symtab_node) node);
+ dump_symtab_base (f, node);
if (node->global.inlined_to)
fprintf (f, " Function %s/%i is inline copy in %s/%i\n",
xstrdup (cgraph_node_name (node)),
- node->symbol.order,
+ node->order,
xstrdup (cgraph_node_name (node->global.inlined_to)),
- node->global.inlined_to->symbol.order);
+ node->global.inlined_to->order);
if (node->clone_of)
fprintf (f, " Clone of %s/%i\n",
cgraph_node_asm_name (node->clone_of),
- node->clone_of->symbol.order);
+ node->clone_of->order);
if (cgraph_function_flags_ready)
fprintf (f, " Availability: %s\n",
cgraph_availability_names [cgraph_function_body_availability (node)]);
(HOST_WIDEST_INT)node->count);
if (node->origin)
fprintf (f, " nested in: %s", cgraph_node_asm_name (node->origin));
- if (gimple_has_body_p (node->symbol.decl))
+ if (gimple_has_body_p (node->decl))
fprintf (f, " body");
if (node->process)
fprintf (f, " process");
(int)node->thunk.virtual_value,
(int)node->thunk.virtual_offset_p);
}
- if (node->symbol.alias && node->thunk.alias
+ if (node->alias && node->thunk.alias
&& DECL_P (node->thunk.alias))
{
fprintf (f, " Alias of %s",
for (edge = node->callers; edge; edge = edge->next_caller)
{
fprintf (f, "%s/%i ", cgraph_node_asm_name (edge->caller),
- edge->caller->symbol.order);
+ edge->caller->order);
if (edge->count)
fprintf (f, "("HOST_WIDEST_INT_PRINT_DEC"x) ",
(HOST_WIDEST_INT)edge->count);
for (edge = node->callees; edge; edge = edge->next_callee)
{
fprintf (f, "%s/%i ", cgraph_node_asm_name (edge->callee),
- edge->callee->symbol.order);
+ edge->callee->order);
if (edge->speculative)
fprintf (f, "(speculative) ");
if (!edge->inline_failed)
cgraph_function_body_availability (struct cgraph_node *node)
{
enum availability avail;
- if (!node->symbol.analyzed)
+ if (!node->analyzed)
avail = AVAIL_NOT_AVAILABLE;
else if (node->local.local)
avail = AVAIL_LOCAL;
- else if (node->symbol.alias && node->symbol.weakref)
+ else if (node->alias && node->weakref)
cgraph_function_or_thunk_node (node, &avail);
- else if (lookup_attribute ("ifunc", DECL_ATTRIBUTES (node->symbol.decl)))
+ else if (lookup_attribute ("ifunc", DECL_ATTRIBUTES (node->decl)))
avail = AVAIL_OVERWRITABLE;
- else if (!node->symbol.externally_visible)
+ else if (!node->externally_visible)
avail = AVAIL_AVAILABLE;
/* Inline functions are safe to be analyzed even if their symbol can
be overwritten at runtime. It is not meaningful to enforce any sane
behaviour on replacing inline function by different body. */
- else if (DECL_DECLARED_INLINE_P (node->symbol.decl))
+ else if (DECL_DECLARED_INLINE_P (node->decl))
avail = AVAIL_AVAILABLE;
/* If the function can be overwritten, return OVERWRITABLE. Take
AVAIL_AVAILABLE here? That would be good reason to preserve this
bit. */
- else if (decl_replaceable_p (node->symbol.decl)
- && !DECL_EXTERNAL (node->symbol.decl))
+ else if (decl_replaceable_p (node->decl)
+ && !DECL_EXTERNAL (node->decl))
avail = AVAIL_OVERWRITABLE;
else avail = AVAIL_AVAILABLE;
cgraph_node_cannot_be_local_p_1 (struct cgraph_node *node,
void *data ATTRIBUTE_UNUSED)
{
- return !(!node->symbol.force_output
- && ((DECL_COMDAT (node->symbol.decl)
- && !node->symbol.forced_by_abi
- && !symtab_used_from_object_file_p ((symtab_node) node)
- && !node->symbol.same_comdat_group)
- || !node->symbol.externally_visible));
+ return !(!node->force_output
+ && ((DECL_COMDAT (node->decl)
+ && !node->forced_by_abi
+ && !symtab_used_from_object_file_p (node)
+ && !node->same_comdat_group)
+ || !node->externally_visible));
}
/* Return true if NODE can be made local for API change.
bool
cgraph_node_can_be_local_p (struct cgraph_node *node)
{
- return (!node->symbol.address_taken
+ return (!node->address_taken
&& !cgraph_for_node_and_aliases (node,
cgraph_node_cannot_be_local_p_1,
NULL, true));
if (cgraph_for_node_thunks_and_aliases (e->caller, callback, data,
include_overwritable))
return true;
- for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list, i, ref); i++)
+ for (i = 0; ipa_ref_list_referring_iterate (&node->ref_list, i, ref); i++)
if (ref->use == IPA_REF_ALIAS)
{
struct cgraph_node *alias = ipa_ref_referring_node (ref);
if (callback (node, data))
return true;
- for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list, i, ref); i++)
+ for (i = 0; ipa_ref_list_referring_iterate (&node->ref_list, i, ref); i++)
if (ref->use == IPA_REF_ALIAS)
{
struct cgraph_node *alias = ipa_ref_referring_node (ref);
cgraph_make_node_local_1 (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
{
gcc_checking_assert (cgraph_node_can_be_local_p (node));
- if (DECL_COMDAT (node->symbol.decl) || DECL_EXTERNAL (node->symbol.decl))
+ if (DECL_COMDAT (node->decl) || DECL_EXTERNAL (node->decl))
{
- symtab_make_decl_local (node->symbol.decl);
+ symtab_make_decl_local (node->decl);
- node->symbol.externally_visible = false;
- node->symbol.forced_by_abi = false;
+ node->externally_visible = false;
+ node->forced_by_abi = false;
node->local.local = true;
- node->symbol.unique_name = (node->symbol.resolution == LDPR_PREVAILING_DEF_IRONLY
- || node->symbol.resolution == LDPR_PREVAILING_DEF_IRONLY_EXP);
- node->symbol.resolution = LDPR_PREVAILING_DEF_IRONLY;
+ node->unique_name = (node->resolution == LDPR_PREVAILING_DEF_IRONLY
+ || node->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP);
+ node->resolution = LDPR_PREVAILING_DEF_IRONLY;
gcc_assert (cgraph_function_body_availability (node) == AVAIL_LOCAL);
}
return false;
{
struct cgraph_edge *e;
- TREE_NOTHROW (node->symbol.decl) = data != NULL;
+ TREE_NOTHROW (node->decl) = data != NULL;
if (data != NULL)
for (e = node->callers; e; e = e->next_caller)
optimized out. */
if (data && !((size_t)data & 2))
{
- if (DECL_STATIC_CONSTRUCTOR (node->symbol.decl))
- DECL_STATIC_CONSTRUCTOR (node->symbol.decl) = 0;
- if (DECL_STATIC_DESTRUCTOR (node->symbol.decl))
- DECL_STATIC_DESTRUCTOR (node->symbol.decl) = 0;
+ if (DECL_STATIC_CONSTRUCTOR (node->decl))
+ DECL_STATIC_CONSTRUCTOR (node->decl) = 0;
+ if (DECL_STATIC_DESTRUCTOR (node->decl))
+ DECL_STATIC_DESTRUCTOR (node->decl) = 0;
}
- TREE_READONLY (node->symbol.decl) = data != NULL;
- DECL_LOOPING_CONST_OR_PURE_P (node->symbol.decl) = ((size_t)data & 2) != 0;
+ TREE_READONLY (node->decl) = data != NULL;
+ DECL_LOOPING_CONST_OR_PURE_P (node->decl) = ((size_t)data & 2) != 0;
return false;
}
optimized out. */
if (data && !((size_t)data & 2))
{
- if (DECL_STATIC_CONSTRUCTOR (node->symbol.decl))
- DECL_STATIC_CONSTRUCTOR (node->symbol.decl) = 0;
- if (DECL_STATIC_DESTRUCTOR (node->symbol.decl))
- DECL_STATIC_DESTRUCTOR (node->symbol.decl) = 0;
+ if (DECL_STATIC_CONSTRUCTOR (node->decl))
+ DECL_STATIC_CONSTRUCTOR (node->decl) = 0;
+ if (DECL_STATIC_DESTRUCTOR (node->decl))
+ DECL_STATIC_DESTRUCTOR (node->decl) = 0;
}
- DECL_PURE_P (node->symbol.decl) = data != NULL;
- DECL_LOOPING_CONST_OR_PURE_P (node->symbol.decl) = ((size_t)data & 2) != 0;
+ DECL_PURE_P (node->decl) = data != NULL;
+ DECL_LOOPING_CONST_OR_PURE_P (node->decl) = ((size_t)data & 2) != 0;
return false;
}
bool
cgraph_node_cannot_return (struct cgraph_node *node)
{
- int flags = flags_from_decl_or_type (node->symbol.decl);
+ int flags = flags_from_decl_or_type (node->decl);
if (!flag_exceptions)
return (flags & ECF_NORETURN) != 0;
else
{
gcc_assert (!node->global.inlined_to);
/* Extern inlines can always go, we will use the external definition. */
- if (DECL_EXTERNAL (node->symbol.decl))
+ if (DECL_EXTERNAL (node->decl))
return true;
/* When function is needed, we can not remove it. */
- if (node->symbol.force_output || node->symbol.used_from_other_partition)
+ if (node->force_output || node->used_from_other_partition)
return false;
- if (DECL_STATIC_CONSTRUCTOR (node->symbol.decl)
- || DECL_STATIC_DESTRUCTOR (node->symbol.decl))
+ if (DECL_STATIC_CONSTRUCTOR (node->decl)
+ || DECL_STATIC_DESTRUCTOR (node->decl))
return false;
/* Only COMDAT functions can be removed if externally visible. */
- if (node->symbol.externally_visible
- && (!DECL_COMDAT (node->symbol.decl)
- || node->symbol.forced_by_abi
- || symtab_used_from_object_file_p ((symtab_node) node)))
+ if (node->externally_visible
+ && (!DECL_COMDAT (node->decl)
+ || node->forced_by_abi
+ || symtab_used_from_object_file_p (node)))
return false;
return true;
}
cgraph_can_remove_if_no_direct_calls_p (struct cgraph_node *node)
{
/* Extern inlines can always go, we will use the external definition. */
- if (DECL_EXTERNAL (node->symbol.decl))
+ if (DECL_EXTERNAL (node->decl))
return true;
- if (node->symbol.address_taken)
+ if (node->address_taken)
return false;
return !cgraph_for_node_and_aliases (node, nonremovable_p, NULL, true);
}
static bool
used_from_object_file_p (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
{
- return symtab_used_from_object_file_p ((symtab_node) node);
+ return symtab_used_from_object_file_p (node);
}
/* Return true when function NODE can be expected to be removed
return cgraph_only_called_directly_p (node);
else
{
- if (DECL_EXTERNAL (node->symbol.decl))
+ if (DECL_EXTERNAL (node->decl))
return true;
return cgraph_can_remove_if_no_direct_calls_p (node);
}
error ("caller edge frequency is too large");
error_found = true;
}
- if (gimple_has_body_p (e->caller->symbol.decl)
+ if (gimple_has_body_p (e->caller->decl)
&& !e->caller->global.inlined_to
&& !e->speculative
/* FIXME: Inline-analysis sets frequency to 0 when edge is optimized out.
&& ((inline_edge_summary_vec.length () <= (unsigned) e->uid)
|| !inline_edge_summary (e)->predicate)))
&& (e->frequency
- != compute_call_stmt_bb_frequency (e->caller->symbol.decl,
+ != compute_call_stmt_bb_frequency (e->caller->decl,
gimple_bb (e->call_stmt))))
{
error ("caller edge frequency %i does not match BB frequency %i",
e->frequency,
- compute_call_stmt_bb_frequency (e->caller->symbol.decl,
+ compute_call_stmt_bb_frequency (e->caller->decl,
gimple_bb (e->call_stmt)));
error_found = true;
}
/* We do not know if a node from a different partition is an alias or what it
aliases and therefore cannot do the former_clone_of check reliably. */
- if (!node || node->symbol.in_other_partition || e->callee->symbol.in_other_partition)
+ if (!node || node->in_other_partition || e->callee->in_other_partition)
return false;
node = cgraph_function_or_thunk_node (node, NULL);
- if (e->callee->former_clone_of != node->symbol.decl
+ if (e->callee->former_clone_of != node->decl
/* IPA-CP sometimes redirect edge to clone and then back to the former
function. This ping-pong has to go, eventually. */
&& (node != cgraph_function_or_thunk_node (e->callee, NULL))
verify_cgraph_node (struct cgraph_node *node)
{
struct cgraph_edge *e;
- struct function *this_cfun = DECL_STRUCT_FUNCTION (node->symbol.decl);
+ struct function *this_cfun = DECL_STRUCT_FUNCTION (node->decl);
basic_block this_block;
gimple_stmt_iterator gsi;
bool error_found = false;
return;
timevar_push (TV_CGRAPH_VERIFY);
- error_found |= verify_symtab_base ((symtab_node) node);
+ error_found |= verify_symtab_base (node);
for (e = node->callees; e; e = e->next_callee)
if (e->aux)
{
error ("execution count is negative");
error_found = true;
}
- if (node->global.inlined_to && node->symbol.same_comdat_group)
+ if (node->global.inlined_to && node->same_comdat_group)
{
error ("inline clone in same comdat group list");
error_found = true;
}
- if (!node->symbol.definition && !node->symbol.in_other_partition && node->local.local)
+ if (!node->definition && !node->in_other_partition && node->local.local)
{
error ("local symbols must be defined");
error_found = true;
}
- if (node->global.inlined_to && node->symbol.externally_visible)
+ if (node->global.inlined_to && node->externally_visible)
{
error ("externally visible inline clone");
error_found = true;
}
- if (node->global.inlined_to && node->symbol.address_taken)
+ if (node->global.inlined_to && node->address_taken)
{
error ("inline clone with address taken");
error_found = true;
}
- if (node->global.inlined_to && node->symbol.force_output)
+ if (node->global.inlined_to && node->force_output)
{
error ("inline clone is forced to output");
error_found = true;
error_found = true;
}
- if (node->symbol.analyzed && node->symbol.alias)
+ if (node->analyzed && node->alias)
{
bool ref_found = false;
int i;
error ("Alias has call edges");
error_found = true;
}
- for (i = 0; ipa_ref_list_reference_iterate (&node->symbol.ref_list,
+ for (i = 0; ipa_ref_list_reference_iterate (&node->ref_list,
i, ref); i++)
if (ref->use != IPA_REF_ALIAS)
{
error_found = true;
}
}
- if (node->symbol.analyzed && node->thunk.thunk_p)
+ if (node->analyzed && node->thunk.thunk_p)
{
if (!node->callees)
{
error ("More than one edge out of thunk node");
error_found = true;
}
- if (gimple_has_body_p (node->symbol.decl))
+ if (gimple_has_body_p (node->decl))
{
error ("Thunk is not supposed to have body");
error_found = true;
}
}
- else if (node->symbol.analyzed && gimple_has_body_p (node->symbol.decl)
- && !TREE_ASM_WRITTEN (node->symbol.decl)
- && (!DECL_EXTERNAL (node->symbol.decl) || node->global.inlined_to)
+ else if (node->analyzed && gimple_has_body_p (node->decl)
+ && !TREE_ASM_WRITTEN (node->decl)
+ && (!DECL_EXTERNAL (node->decl) || node->global.inlined_to)
&& !flag_wpa)
{
if (this_cfun->cfg)
if (verify_edge_corresponds_to_fndecl (e, decl))
{
error ("edge points to wrong declaration:");
- debug_tree (e->callee->symbol.decl);
+ debug_tree (e->callee->decl);
fprintf (stderr," Instead of:");
debug_tree (decl);
error_found = true;
}
}
for (i = 0;
- ipa_ref_list_reference_iterate (&node->symbol.ref_list, i, ref);
+ ipa_ref_list_reference_iterate (&node->ref_list, i, ref);
i++)
if (ref->stmt && !pointer_set_contains (stmts, ref->stmt))
{
{
first_clone->clone_of = node;
node->clones = first_clone;
- symtab_prevail_in_asm_name_hash ((symtab_node) node);
- symtab_insert_node_to_hashtable ((symtab_node) node);
+ symtab_prevail_in_asm_name_hash (node);
+ symtab_insert_node_to_hashtable (node);
if (dump_file)
fprintf (dump_file, "Introduced new external node "
"(%s/%i) and turned into root of the clone tree.\n",
- xstrdup (cgraph_node_name (node)), node->symbol.order);
+ xstrdup (cgraph_node_name (node)), node->order);
}
else if (dump_file)
fprintf (dump_file, "Introduced new external node "
"(%s/%i).\n", xstrdup (cgraph_node_name (node)),
- node->symbol.order);
+ node->order);
return node;
}
struct lto_file_decl_data *file_data;
const char *data, *name;
size_t len;
- tree decl = node->symbol.decl;
+ tree decl = node->decl;
if (DECL_RESULT (decl))
return false;
gcc_assert (in_lto_p);
- file_data = node->symbol.lto_file_data;
+ file_data = node->lto_file_data;
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
/* We may have renamed the declaration, e.g., a static function. */
lto_stats.num_function_bodies++;
lto_free_section_data (file_data, LTO_section_function_body, name,
data, len);
- lto_free_function_in_decl_state_for_node ((symtab_node) node);
+ lto_free_function_in_decl_state_for_node (node);
return true;
}
inline bool
is_a_helper <cgraph_node>::test (symtab_node_base *p)
{
- return p->symbol.type == SYMTAB_FUNCTION;
+ return p->type == SYMTAB_FUNCTION;
}
/* Report whether or not THIS symtab node is a vriable, aka varpool_node. */
inline bool
is_a_helper <varpool_node>::test (symtab_node_base *p)
{
- return p->symbol.type == SYMTAB_VARIABLE;
+ return p->type == SYMTAB_VARIABLE;
}
extern GTY(()) symtab_node symtab_nodes;
static inline struct cgraph_node *
cgraph (symtab_node node)
{
- gcc_checking_assert (!node || node->symbol.type == SYMTAB_FUNCTION);
+ gcc_checking_assert (!node || node->type == SYMTAB_FUNCTION);
return (struct cgraph_node *)node;
}
static inline struct varpool_node *
varpool (symtab_node node)
{
- gcc_checking_assert (!node || node->symbol.type == SYMTAB_VARIABLE);
+ gcc_checking_assert (!node || node->type == SYMTAB_VARIABLE);
return (struct varpool_node *)node;
}
static inline const char *
cgraph_node_asm_name (struct cgraph_node *node)
{
- return symtab_node_asm_name ((symtab_node)node);
+ return symtab_node_asm_name (node);
}
/* Return asm name of varpool node. */
static inline const char *
varpool_node_asm_name (struct varpool_node *node)
{
- return symtab_node_asm_name ((symtab_node)node);
+ return symtab_node_asm_name (node);
}
/* Return name of cgraph node. */
static inline const char *
cgraph_node_name (struct cgraph_node *node)
{
- return symtab_node_name ((symtab_node)node);
+ return symtab_node_name (node);
}
/* Return name of varpool node. */
static inline const char *
varpool_node_name (struct varpool_node *node)
{
- return symtab_node_name ((symtab_node)node);
+ return symtab_node_name (node);
}
/* Walk all symbols. */
#define FOR_EACH_SYMBOL(node) \
- for ((node) = symtab_nodes; (node); (node) = (node)->symbol.next)
+ for ((node) = symtab_nodes; (node); (node) = (node)->next)
/* Return first variable. */
varpool_first_variable (void)
{
symtab_node node;
- for (node = symtab_nodes; node; node = node->symbol.next)
+ for (node = symtab_nodes; node; node = node->next)
if (varpool_node *vnode = dyn_cast <varpool_node> (node))
return vnode;
return NULL;
static inline struct varpool_node *
varpool_next_variable (struct varpool_node *node)
{
- symtab_node node1 = (symtab_node) node->symbol.next;
- for (; node1; node1 = node1->symbol.next)
+ symtab_node node1 = node->next;
+ for (; node1; node1 = node1->next)
if (varpool_node *vnode1 = dyn_cast <varpool_node> (node1))
return vnode1;
return NULL;
varpool_first_static_initializer (void)
{
symtab_node node;
- for (node = symtab_nodes; node; node = node->symbol.next)
+ for (node = symtab_nodes; node; node = node->next)
{
varpool_node *vnode = dyn_cast <varpool_node> (node);
- if (vnode && DECL_INITIAL (node->symbol.decl))
+ if (vnode && DECL_INITIAL (node->decl))
return vnode;
}
return NULL;
static inline struct varpool_node *
varpool_next_static_initializer (struct varpool_node *node)
{
- symtab_node node1 = (symtab_node) node->symbol.next;
- for (; node1; node1 = node1->symbol.next)
+ symtab_node node1 = node->next;
+ for (; node1; node1 = node1->next)
{
varpool_node *vnode1 = dyn_cast <varpool_node> (node1);
- if (vnode1 && DECL_INITIAL (node1->symbol.decl))
+ if (vnode1 && DECL_INITIAL (node1->decl))
return vnode1;
}
return NULL;
varpool_first_defined_variable (void)
{
symtab_node node;
- for (node = symtab_nodes; node; node = node->symbol.next)
+ for (node = symtab_nodes; node; node = node->next)
{
varpool_node *vnode = dyn_cast <varpool_node> (node);
- if (vnode && vnode->symbol.definition)
+ if (vnode && vnode->definition)
return vnode;
}
return NULL;
static inline struct varpool_node *
varpool_next_defined_variable (struct varpool_node *node)
{
- symtab_node node1 = (symtab_node) node->symbol.next;
- for (; node1; node1 = node1->symbol.next)
+ symtab_node node1 = node->next;
+ for (; node1; node1 = node1->next)
{
varpool_node *vnode1 = dyn_cast <varpool_node> (node1);
- if (vnode1 && vnode1->symbol.definition)
+ if (vnode1 && vnode1->definition)
return vnode1;
}
return NULL;
cgraph_first_defined_function (void)
{
symtab_node node;
- for (node = symtab_nodes; node; node = node->symbol.next)
+ for (node = symtab_nodes; node; node = node->next)
{
cgraph_node *cn = dyn_cast <cgraph_node> (node);
- if (cn && cn->symbol.definition)
+ if (cn && cn->definition)
return cn;
}
return NULL;
static inline struct cgraph_node *
cgraph_next_defined_function (struct cgraph_node *node)
{
- symtab_node node1 = (symtab_node) node->symbol.next;
- for (; node1; node1 = node1->symbol.next)
+ symtab_node node1 = node->next;
+ for (; node1; node1 = node1->next)
{
cgraph_node *cn1 = dyn_cast <cgraph_node> (node1);
- if (cn1 && cn1->symbol.definition)
+ if (cn1 && cn1->definition)
return cn1;
}
return NULL;
cgraph_first_function (void)
{
symtab_node node;
- for (node = symtab_nodes; node; node = node->symbol.next)
+ for (node = symtab_nodes; node; node = node->next)
if (cgraph_node *cn = dyn_cast <cgraph_node> (node))
return cn;
return NULL;
static inline struct cgraph_node *
cgraph_next_function (struct cgraph_node *node)
{
- symtab_node node1 = (symtab_node) node->symbol.next;
- for (; node1; node1 = node1->symbol.next)
+ symtab_node node1 = node->next;
+ for (; node1; node1 = node1->next)
if (cgraph_node *cn1 = dyn_cast <cgraph_node> (node1))
return cn1;
return NULL;
static inline bool
cgraph_function_with_gimple_body_p (struct cgraph_node *node)
{
- return node->symbol.definition && !node->thunk.thunk_p && !node->symbol.alias;
+ return node->definition && !node->thunk.thunk_p && !node->alias;
}
/* Return first function with body defined. */
cgraph_first_function_with_gimple_body (void)
{
symtab_node node;
- for (node = symtab_nodes; node; node = node->symbol.next)
+ for (node = symtab_nodes; node; node = node->next)
{
cgraph_node *cn = dyn_cast <cgraph_node> (node);
if (cn && cgraph_function_with_gimple_body_p (cn))
static inline struct cgraph_node *
cgraph_next_function_with_gimple_body (struct cgraph_node *node)
{
- symtab_node node1 = node->symbol.next;
- for (; node1; node1 = node1->symbol.next)
+ symtab_node node1 = node->next;
+ for (; node1; node1 = node1->next)
{
cgraph_node *cn1 = dyn_cast <cgraph_node> (node1);
if (cn1 && cgraph_function_with_gimple_body_p (cn1))
cgraph_only_called_directly_or_aliased_p (struct cgraph_node *node)
{
gcc_assert (!node->global.inlined_to);
- return (!node->symbol.force_output && !node->symbol.address_taken
- && !node->symbol.used_from_other_partition
- && !DECL_VIRTUAL_P (node->symbol.decl)
- && !DECL_STATIC_CONSTRUCTOR (node->symbol.decl)
- && !DECL_STATIC_DESTRUCTOR (node->symbol.decl)
- && !node->symbol.externally_visible);
+ return (!node->force_output && !node->address_taken
+ && !node->used_from_other_partition
+ && !DECL_VIRTUAL_P (node->decl)
+ && !DECL_STATIC_CONSTRUCTOR (node->decl)
+ && !DECL_STATIC_DESTRUCTOR (node->decl)
+ && !node->externally_visible);
}
/* Return true when function NODE can be removed from callgraph
static inline bool
varpool_can_remove_if_no_refs (struct varpool_node *node)
{
- if (DECL_EXTERNAL (node->symbol.decl))
+ if (DECL_EXTERNAL (node->decl))
return true;
- return (!node->symbol.force_output && !node->symbol.used_from_other_partition
- && ((DECL_COMDAT (node->symbol.decl)
- && !node->symbol.forced_by_abi
- && !symtab_used_from_object_file_p ((symtab_node) node))
- || !node->symbol.externally_visible
- || DECL_HAS_VALUE_EXPR_P (node->symbol.decl)));
+ return (!node->force_output && !node->used_from_other_partition
+ && ((DECL_COMDAT (node->decl)
+ && !node->forced_by_abi
+ && !symtab_used_from_object_file_p (node))
+ || !node->externally_visible
+ || DECL_HAS_VALUE_EXPR_P (node->decl)));
}
/* Return true when all references to VNODE must be visible in ipa_ref_list.
static inline bool
varpool_all_refs_explicit_p (struct varpool_node *vnode)
{
- return (vnode->symbol.definition
- && !vnode->symbol.externally_visible
- && !vnode->symbol.used_from_other_partition
- && !vnode->symbol.force_output);
+ return (vnode->definition
+ && !vnode->externally_visible
+ && !vnode->used_from_other_partition
+ && !vnode->force_output);
}
/* Constant pool accessor function. */
symtab_alias_target (symtab_node n)
{
struct ipa_ref *ref;
- ipa_ref_list_reference_iterate (&n->symbol.ref_list, 0, ref);
+ ipa_ref_list_reference_iterate (&n->ref_list, 0, ref);
gcc_checking_assert (ref->use == IPA_REF_ALIAS);
return ref->referred;
}
static inline struct cgraph_node *
cgraph_alias_target (struct cgraph_node *n)
{
- return dyn_cast <cgraph_node> (symtab_alias_target ((symtab_node) n));
+ return dyn_cast <cgraph_node> (symtab_alias_target (n));
}
static inline struct varpool_node *
varpool_alias_target (struct varpool_node *n)
{
- return dyn_cast <varpool_node> (symtab_alias_target ((symtab_node) n));
+ return dyn_cast <varpool_node> (symtab_alias_target (n));
}
/* Given NODE, walk the alias chain to return the function NODE is alias of.
{
struct cgraph_node *n;
- n = dyn_cast <cgraph_node> (symtab_alias_ultimate_target ((symtab_node)node,
+ n = dyn_cast <cgraph_node> (symtab_alias_ultimate_target (node,
availability));
if (!n && availability)
*availability = AVAIL_NOT_AVAILABLE;
{
struct varpool_node *n;
- n = dyn_cast <varpool_node> (symtab_alias_ultimate_target ((symtab_node)node,
+ n = dyn_cast <varpool_node> (symtab_alias_ultimate_target (node,
availability));
if (!n && availability)
*availability = AVAIL_NOT_AVAILABLE;
{
struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, NULL);
if (e->caller->global.inlined_to)
- return e->caller->global.inlined_to->symbol.decl == callee->symbol.decl;
+ return e->caller->global.inlined_to->decl == callee->decl;
else
- return e->caller->symbol.decl == callee->symbol.decl;
+ return e->caller->decl == callee->decl;
}
/* Return true if the TM_CLONE bit is set for a given FNDECL. */
static inline void
cgraph_mark_force_output_node (struct cgraph_node *node)
{
- node->symbol.force_output = 1;
+ node->force_output = 1;
gcc_checking_assert (!node->global.inlined_to);
}
{
struct cgraph_node *cnode;
- if (DECL_ABSTRACT (node->symbol.decl))
+ if (DECL_ABSTRACT (node->decl))
return false;
if (!is_a <cgraph_node> (node))
return true;
static inline bool
symtab_can_be_discarded (symtab_node node)
{
- return (DECL_EXTERNAL (node->symbol.decl)
- || (DECL_ONE_ONLY (node->symbol.decl)
- && node->symbol.resolution != LDPR_PREVAILING_DEF
- && node->symbol.resolution != LDPR_PREVAILING_DEF_IRONLY
- && node->symbol.resolution != LDPR_PREVAILING_DEF_IRONLY_EXP));
+ return (DECL_EXTERNAL (node->decl)
+ || (DECL_ONE_ONLY (node->decl)
+ && node->resolution != LDPR_PREVAILING_DEF
+ && node->resolution != LDPR_PREVAILING_DEF_IRONLY
+ && node->resolution != LDPR_PREVAILING_DEF_IRONLY_EXP));
}
#endif /* GCC_CGRAPH_H */
struct cgraph_node *node = cgraph_get_create_real_symbol_node (decl);
if (!ctx->only_vars)
cgraph_mark_address_taken_node (node);
- ipa_record_reference ((symtab_node)ctx->varpool_node,
- (symtab_node)node,
+ ipa_record_reference (ctx->varpool_node,
+ node,
IPA_REF_ADDR, NULL);
}
if (TREE_CODE (decl) == VAR_DECL)
{
struct varpool_node *vnode = varpool_node_for_decl (decl);
- ipa_record_reference ((symtab_node)ctx->varpool_node,
- (symtab_node)vnode,
+ ipa_record_reference (ctx->varpool_node,
+ vnode,
IPA_REF_ADDR, NULL);
}
*walk_subtrees = 0;
if (TREE_CODE (type) == VAR_DECL)
{
struct varpool_node *vnode = varpool_node_for_decl (type);
- ipa_record_reference ((symtab_node)node,
- (symtab_node)vnode,
+ ipa_record_reference (node,
+ vnode,
IPA_REF_ADDR, NULL);
}
}
{
eh_region i;
- if (DECL_FUNCTION_PERSONALITY (node->symbol.decl))
+ if (DECL_FUNCTION_PERSONALITY (node->decl))
{
struct cgraph_node *per_node;
- per_node = cgraph_get_create_real_symbol_node (DECL_FUNCTION_PERSONALITY (node->symbol.decl));
- ipa_record_reference ((symtab_node)node, (symtab_node)per_node, IPA_REF_ADDR, NULL);
+ per_node = cgraph_get_create_real_symbol_node (DECL_FUNCTION_PERSONALITY (node->decl));
+ ipa_record_reference (node, per_node, IPA_REF_ADDR, NULL);
cgraph_mark_address_taken_node (per_node);
}
struct cgraph_node *node = cgraph_get_create_real_symbol_node (addr);
cgraph_mark_address_taken_node (node);
ipa_record_reference ((symtab_node)data,
- (symtab_node)node,
+ node,
IPA_REF_ADDR, stmt);
}
else if (addr && TREE_CODE (addr) == VAR_DECL
struct varpool_node *vnode = varpool_node_for_decl (addr);
ipa_record_reference ((symtab_node)data,
- (symtab_node)vnode,
+ vnode,
IPA_REF_ADDR, stmt);
}
struct cgraph_node *node = cgraph_get_create_real_symbol_node (t);
cgraph_mark_address_taken_node (node);
ipa_record_reference ((symtab_node)data,
- (symtab_node)node,
+ node,
IPA_REF_ADDR, stmt);
}
else if (t && TREE_CODE (t) == VAR_DECL
struct varpool_node *vnode = varpool_node_for_decl (t);
ipa_record_reference ((symtab_node)data,
- (symtab_node)vnode,
+ vnode,
IPA_REF_LOAD, stmt);
}
return false;
struct varpool_node *vnode = varpool_node_for_decl (t);
ipa_record_reference ((symtab_node)data,
- (symtab_node)vnode,
+ vnode,
IPA_REF_STORE, stmt);
}
return false;
&& gimple_omp_parallel_child_fn (stmt))
{
tree fn = gimple_omp_parallel_child_fn (stmt);
- ipa_record_reference ((symtab_node)node,
- (symtab_node)cgraph_get_create_real_symbol_node (fn),
+ ipa_record_reference (node,
+ cgraph_get_create_real_symbol_node (fn),
IPA_REF_ADDR, stmt);
}
if (gimple_code (stmt) == GIMPLE_OMP_TASK)
{
tree fn = gimple_omp_task_child_fn (stmt);
if (fn)
- ipa_record_reference ((symtab_node)node,
- (symtab_node) cgraph_get_create_real_symbol_node (fn),
+ ipa_record_reference (node,
+ cgraph_get_create_real_symbol_node (fn),
IPA_REF_ADDR, stmt);
fn = gimple_omp_task_copy_fn (stmt);
if (fn)
- ipa_record_reference ((symtab_node)node,
- (symtab_node)cgraph_get_create_real_symbol_node (fn),
+ ipa_record_reference (node,
+ cgraph_get_create_real_symbol_node (fn),
IPA_REF_ADDR, stmt);
}
}
gimple_stmt_iterator gsi;
cgraph_node_remove_callees (node);
- ipa_remove_all_references (&node->symbol.ref_list);
+ ipa_remove_all_references (&node->ref_list);
node->count = ENTRY_BLOCK_PTR->count;
int i;
/* Keep speculative references for further cgraph edge expansion. */
- for (i = 0; ipa_ref_list_reference_iterate (&node->symbol.ref_list, i, ref);)
+ for (i = 0; ipa_ref_list_reference_iterate (&node->ref_list, i, ref);)
if (!ref->speculative)
ipa_remove_reference (ref);
else
{
struct cgraph_node *node = cgraph_get_node (current_function_decl);
cgraph_node_remove_callees (node);
- ipa_remove_all_references (&node->symbol.ref_list);
+ ipa_remove_all_references (&node->ref_list);
return 0;
}
gcov_type count_scale;
unsigned i;
- new_node->symbol.decl = decl;
- symtab_register_node ((symtab_node)new_node);
+ new_node->decl = decl;
+ symtab_register_node (new_node);
new_node->origin = n->origin;
- new_node->symbol.lto_file_data = n->symbol.lto_file_data;
+ new_node->lto_file_data = n->lto_file_data;
if (new_node->origin)
{
new_node->next_nested = new_node->origin->nested;
new_node->origin->nested = new_node;
}
- new_node->symbol.analyzed = n->symbol.analyzed;
- new_node->symbol.definition = n->symbol.definition;
+ new_node->analyzed = n->analyzed;
+ new_node->definition = n->definition;
new_node->local = n->local;
- new_node->symbol.externally_visible = false;
+ new_node->externally_visible = false;
new_node->local.local = true;
new_node->global = n->global;
new_node->global.inlined_to = new_inlined_to;
for (e = n->indirect_calls; e; e = e->next_callee)
cgraph_clone_edge (e, new_node, e->call_stmt, e->lto_stmt_uid,
count_scale, freq, update_original);
- ipa_clone_references ((symtab_node)new_node, &n->symbol.ref_list);
+ ipa_clone_references (new_node, &n->ref_list);
new_node->next_sibling_clone = n->clones;
if (n->clones)
bitmap args_to_skip,
const char * suffix)
{
- tree old_decl = old_node->symbol.decl;
+ tree old_decl = old_node->decl;
struct cgraph_node *new_node = NULL;
tree new_decl;
size_t len, i;
that is not weak also.
??? We cannot use COMDAT linkage because there is no
ABI support for this. */
- DECL_EXTERNAL (new_node->symbol.decl) = 0;
+ DECL_EXTERNAL (new_node->decl) = 0;
if (DECL_ONE_ONLY (old_decl))
- DECL_SECTION_NAME (new_node->symbol.decl) = NULL;
- DECL_COMDAT_GROUP (new_node->symbol.decl) = 0;
- TREE_PUBLIC (new_node->symbol.decl) = 0;
- DECL_COMDAT (new_node->symbol.decl) = 0;
- DECL_WEAK (new_node->symbol.decl) = 0;
- DECL_VIRTUAL_P (new_node->symbol.decl) = 0;
- DECL_STATIC_CONSTRUCTOR (new_node->symbol.decl) = 0;
- DECL_STATIC_DESTRUCTOR (new_node->symbol.decl) = 0;
+ DECL_SECTION_NAME (new_node->decl) = NULL;
+ DECL_COMDAT_GROUP (new_node->decl) = 0;
+ TREE_PUBLIC (new_node->decl) = 0;
+ DECL_COMDAT (new_node->decl) = 0;
+ DECL_WEAK (new_node->decl) = 0;
+ DECL_VIRTUAL_P (new_node->decl) = 0;
+ DECL_STATIC_CONSTRUCTOR (new_node->decl) = 0;
+ DECL_STATIC_DESTRUCTOR (new_node->decl) = 0;
new_node->clone.tree_map = tree_map;
new_node->clone.args_to_skip = args_to_skip;
&& !DECL_WEAK (old_decl)
&& !DECL_COMDAT (old_decl))
|| in_lto_p)
- new_node->symbol.unique_name = true;
+ new_node->unique_name = true;
FOR_EACH_VEC_SAFE_ELT (tree_map, i, map)
- ipa_maybe_record_reference ((symtab_node) new_node, map->new_tree,
+ ipa_maybe_record_reference (new_node, map->new_tree,
IPA_REF_ADDR, NULL);
if (!args_to_skip)
new_node->clone.combined_args_to_skip = old_node->clone.combined_args_to_skip;
struct cgraph_node *orig_node;
for (orig_node = old_node; orig_node->clone_of; orig_node = orig_node->clone_of)
;
- for (arg = DECL_ARGUMENTS (orig_node->symbol.decl);
+ for (arg = DECL_ARGUMENTS (orig_node->decl);
arg; arg = DECL_CHAIN (arg), oldi++)
{
if (bitmap_bit_p (old_node->clone.combined_args_to_skip, oldi))
}
else
new_node->clone.combined_args_to_skip = args_to_skip;
- new_node->symbol.externally_visible = 0;
+ new_node->externally_visible = 0;
new_node->local.local = 1;
new_node->lowered = true;
for (next_inline_clone = node->clones;
next_inline_clone
- && next_inline_clone->symbol.decl != node->symbol.decl;
+ && next_inline_clone->decl != node->decl;
next_inline_clone = next_inline_clone->next_sibling_clone)
;
/* Update the call expr on the edges to call the new version. */
for (e = new_version->callers; e; e = e->next_caller)
{
- struct function *inner_function = DECL_STRUCT_FUNCTION (e->caller->symbol.decl);
- gimple_call_set_fndecl (e->call_stmt, new_version->symbol.decl);
+ struct function *inner_function = DECL_STRUCT_FUNCTION (e->caller->decl);
+ gimple_call_set_fndecl (e->call_stmt, new_version->decl);
maybe_clean_eh_stmt_fn (inner_function, e->call_stmt);
}
}
new_version = cgraph_create_node (new_decl);
- new_version->symbol.analyzed = old_version->symbol.analyzed;
- new_version->symbol.definition = old_version->symbol.definition;
+ new_version->analyzed = old_version->analyzed;
+ new_version->definition = old_version->definition;
new_version->local = old_version->local;
- new_version->symbol.externally_visible = false;
- new_version->local.local = new_version->symbol.definition;
+ new_version->externally_visible = false;
+ new_version->local.local = new_version->definition;
new_version->global = old_version->global;
new_version->rtl = old_version->rtl;
new_version->count = old_version->count;
basic_block new_entry_block,
const char *clone_name)
{
- tree old_decl = old_version_node->symbol.decl;
+ tree old_decl = old_version_node->decl;
struct cgraph_node *new_version_node = NULL;
tree new_decl;
that is not weak also.
??? We cannot use COMDAT linkage because there is no
ABI support for this. */
- symtab_make_decl_local (new_version_node->symbol.decl);
- DECL_VIRTUAL_P (new_version_node->symbol.decl) = 0;
- new_version_node->symbol.externally_visible = 0;
+ symtab_make_decl_local (new_version_node->decl);
+ DECL_VIRTUAL_P (new_version_node->decl) = 0;
+ new_version_node->externally_visible = 0;
new_version_node->local.local = 1;
new_version_node->lowered = true;
/* Clones of global symbols or symbols with unique names are unique. */
&& !DECL_WEAK (old_decl)
&& !DECL_COMDAT (old_decl))
|| in_lto_p)
- new_version_node->symbol.unique_name = true;
+ new_version_node->unique_name = true;
/* Update the call_expr on the edges to call the new version node. */
update_call_expr (new_version_node);
cgraph_materialize_clone (struct cgraph_node *node)
{
bitmap_obstack_initialize (NULL);
- node->former_clone_of = node->clone_of->symbol.decl;
+ node->former_clone_of = node->clone_of->decl;
if (node->clone_of->former_clone_of)
node->former_clone_of = node->clone_of->former_clone_of;
/* Copy the OLD_VERSION_NODE function tree to the new version. */
- tree_function_versioning (node->clone_of->symbol.decl, node->symbol.decl,
+ tree_function_versioning (node->clone_of->decl, node->decl,
node->clone.tree_map, true,
node->clone.args_to_skip, false,
NULL, NULL);
if (cgraph_dump_file)
{
- dump_function_to_file (node->clone_of->symbol.decl, cgraph_dump_file, dump_flags);
- dump_function_to_file (node->symbol.decl, cgraph_dump_file, dump_flags);
+ dump_function_to_file (node->clone_of->decl, cgraph_dump_file, dump_flags);
+ dump_function_to_file (node->decl, cgraph_dump_file, dump_flags);
}
/* Function is no longer clone. */
node->clone_of->clones = node->next_sibling_clone;
node->next_sibling_clone = NULL;
node->prev_sibling_clone = NULL;
- if (!node->clone_of->symbol.analyzed && !node->clone_of->clones)
+ if (!node->clone_of->analyzed && !node->clone_of->clones)
{
cgraph_release_function_body (node->clone_of);
cgraph_node_remove_callees (node->clone_of);
- ipa_remove_all_references (&node->clone_of->symbol.ref_list);
+ ipa_remove_all_references (&node->clone_of->ref_list);
}
node->clone_of = NULL;
bitmap_obstack_release (NULL);
stabilized = true;
FOR_EACH_FUNCTION (node)
{
- if (node->clone_of && node->symbol.decl != node->clone_of->symbol.decl
- && !gimple_has_body_p (node->symbol.decl))
+ if (node->clone_of && node->decl != node->clone_of->decl
+ && !gimple_has_body_p (node->decl))
{
if (!node->clone_of->clone_of)
cgraph_get_body (node->clone_of);
- if (gimple_has_body_p (node->clone_of->symbol.decl))
+ if (gimple_has_body_p (node->clone_of->decl))
{
if (cgraph_dump_file)
{
}
}
FOR_EACH_FUNCTION (node)
- if (!node->symbol.analyzed && node->callees)
+ if (!node->analyzed && node->callees)
{
cgraph_node_remove_callees (node);
- ipa_remove_all_references (&node->symbol.ref_list);
+ ipa_remove_all_references (&node->ref_list);
}
else
- ipa_clear_stmts_in_references ((symtab_node)node);
+ ipa_clear_stmts_in_references (node);
if (cgraph_dump_file)
fprintf (cgraph_dump_file, "Materialization Call site updates done.\n");
#ifdef ENABLE_CHECKING
bool
decide_is_symbol_needed (symtab_node node)
{
- tree decl = node->symbol.decl;
+ tree decl = node->decl;
/* Double check that no one output the function into assembly file
early. */
gcc_checking_assert (!DECL_ASSEMBLER_NAME_SET_P (decl)
|| !TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)));
- if (!node->symbol.definition)
+ if (!node->definition)
return false;
if (DECL_EXTERNAL (decl))
return false;
/* If the user told us it is used, then it must be so. */
- if (node->symbol.force_output)
+ if (node->force_output)
return true;
/* ABI forced symbols are needed when they are external. */
- if (node->symbol.forced_by_abi && TREE_PUBLIC (decl))
+ if (node->forced_by_abi && TREE_PUBLIC (decl))
return true;
/* Keep constructors, destructors and virtual functions. */
static void
enqueue_node (symtab_node node)
{
- if (node->symbol.aux)
+ if (node->aux)
return;
gcc_checking_assert (first);
- node->symbol.aux = first;
+ node->aux = first;
first = node;
}
for (csi = csi_start (cgraph_new_nodes); !csi_end_p (csi); csi_next (&csi))
{
node = csi_node (csi);
- fndecl = node->symbol.decl;
+ fndecl = node->decl;
switch (cgraph_state)
{
case CGRAPH_STATE_CONSTRUCTION:
cgraph_finalize_function (fndecl, false);
output = true;
cgraph_call_function_insertion_hooks (node);
- enqueue_node ((symtab_node) node);
+ enqueue_node (node);
break;
case CGRAPH_STATE_IPA:
cgraph but not on this function. */
gimple_register_cfg_hooks ();
- if (!node->symbol.analyzed)
+ if (!node->analyzed)
analyze_function (node);
push_cfun (DECL_STRUCT_FUNCTION (fndecl));
if (cgraph_state == CGRAPH_STATE_IPA_SSA
memset (&node->local, 0, sizeof (node->local));
memset (&node->global, 0, sizeof (node->global));
memset (&node->rtl, 0, sizeof (node->rtl));
- node->symbol.analyzed = false;
- node->symbol.definition = false;
- node->symbol.alias = false;
- node->symbol.weakref = false;
- node->symbol.cpp_implicit_alias = false;
+ node->analyzed = false;
+ node->definition = false;
+ node->alias = false;
+ node->weakref = false;
+ node->cpp_implicit_alias = false;
cgraph_node_remove_callees (node);
- ipa_remove_all_references (&node->symbol.ref_list);
+ ipa_remove_all_references (&node->ref_list);
}
/* Return true when there are references to NODE. */
struct ipa_ref *ref;
/* See if there are any references at all. */
- if (ipa_ref_list_referring_iterate (&node->symbol.ref_list, 0, ref))
+ if (ipa_ref_list_referring_iterate (&node->ref_list, 0, ref))
return true;
/* For functions check also calls. */
cgraph_node *cn = dyn_cast <cgraph_node> (node);
{
struct cgraph_node *node = cgraph_get_create_node (decl);
- if (node->symbol.definition)
+ if (node->definition)
{
/* Nested functions should only be defined once. */
gcc_assert (!DECL_CONTEXT (decl)
}
notice_global_symbol (decl);
- node->symbol.definition = true;
+ node->definition = true;
node->lowered = DECL_STRUCT_FUNCTION (decl)->cfg != NULL;
/* With -fkeep-inline-functions we are keeping all inline functions except
&& DECL_DECLARED_INLINE_P (decl)
&& !DECL_EXTERNAL (decl)
&& !DECL_DISREGARD_INLINE_LIMITS (decl))
- node->symbol.force_output = 1;
+ node->force_output = 1;
/* When not optimizing, also output the static functions. (see
PR24561), but don't do so for always_inline functions, functions
in the original implementation and it is unclear whether we want
to change the behavior here. */
if ((!optimize
- && !node->symbol.cpp_implicit_alias
+ && !node->cpp_implicit_alias
&& !DECL_DISREGARD_INLINE_LIMITS (decl)
&& !DECL_DECLARED_INLINE_P (decl)
&& !(DECL_CONTEXT (decl)
&& TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL))
&& !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
- node->symbol.force_output = 1;
+ node->force_output = 1;
/* If we've not yet emitted decl, tell the debug info about it. */
if (!TREE_ASM_WRITTEN (decl))
ggc_collect ();
if (cgraph_state == CGRAPH_STATE_CONSTRUCTION
- && (decide_is_symbol_needed ((symtab_node) node)
- || referred_to_p ((symtab_node)node)))
- enqueue_node ((symtab_node)node);
+ && (decide_is_symbol_needed (node)
+ || referred_to_p (node)))
+ enqueue_node (node);
}
/* Add the function FNDECL to the call graph.
analyzing and compilation. */
node = cgraph_get_create_node (fndecl);
node->local.local = false;
- node->symbol.definition = true;
- node->symbol.force_output = true;
+ node->definition = true;
+ node->force_output = true;
if (!lowered && cgraph_state == CGRAPH_STATE_EXPANSION)
{
push_cfun (DECL_STRUCT_FUNCTION (fndecl));
node = cgraph_create_node (fndecl);
if (lowered)
node->lowered = true;
- node->symbol.definition = true;
+ node->definition = true;
analyze_function (node);
push_cfun (DECL_STRUCT_FUNCTION (fndecl));
gimple_register_cfg_hooks ();
static void
analyze_function (struct cgraph_node *node)
{
- tree decl = node->symbol.decl;
+ tree decl = node->decl;
location_t saved_loc = input_location;
input_location = DECL_SOURCE_LOCATION (decl);
if (!expand_thunk (node, false))
{
node->thunk.alias = NULL;
- node->symbol.analyzed = true;
+ node->analyzed = true;
return;
}
node->thunk.alias = NULL;
}
- if (node->symbol.alias)
+ if (node->alias)
symtab_resolve_alias
- ((symtab_node) node, (symtab_node) cgraph_get_node (node->symbol.alias_target));
+ (node, cgraph_get_node (node->alias_target));
else if (node->dispatcher_function)
{
/* Generate the dispatcher body of multi-versioned functions. */
{
push_cfun (DECL_STRUCT_FUNCTION (decl));
- assign_assembler_name_if_neeeded (node->symbol.decl);
+ assign_assembler_name_if_neeeded (node->decl);
/* Make sure to gimplify bodies only once. During analyzing a
function we lower it, which will require gimplified nested
if (!node->lowered)
{
if (node->nested)
- lower_nested_functions (node->symbol.decl);
+ lower_nested_functions (node->decl);
gcc_assert (!node->nested);
gimple_register_cfg_hooks ();
pop_cfun ();
}
- node->symbol.analyzed = true;
+ node->analyzed = true;
input_location = saved_loc;
}
{
symtab_node node;
FOR_EACH_SYMBOL (node)
- if (node->symbol.cpp_implicit_alias && !node->symbol.analyzed)
+ if (node->cpp_implicit_alias && !node->analyzed)
symtab_resolve_alias
(node,
- TREE_CODE (node->symbol.alias_target) == VAR_DECL
- ? (symtab_node)varpool_node_for_decl (node->symbol.alias_target)
- : (symtab_node)cgraph_get_create_node (node->symbol.alias_target));
+ 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));
cpp_implicit_aliases_done = true;
}
for (node = cgraph_first_function (); node != first;
node = cgraph_next_function (node))
{
- tree decl = node->symbol.decl;
+ tree decl = node->decl;
if (DECL_PRESERVE_P (decl))
cgraph_mark_force_output_node (node);
else if (lookup_attribute ("externally_visible", DECL_ATTRIBUTES (decl)))
{
- if (! TREE_PUBLIC (node->symbol.decl))
- warning_at (DECL_SOURCE_LOCATION (node->symbol.decl), OPT_Wattributes,
+ if (! TREE_PUBLIC (node->decl))
+ warning_at (DECL_SOURCE_LOCATION (node->decl), OPT_Wattributes,
"%<externally_visible%>"
" attribute have effect only on public objects");
}
if (lookup_attribute ("weakref", DECL_ATTRIBUTES (decl))
- && (node->symbol.definition && !node->symbol.alias))
+ && (node->definition && !node->alias))
{
- warning_at (DECL_SOURCE_LOCATION (node->symbol.decl), OPT_Wattributes,
+ warning_at (DECL_SOURCE_LOCATION (node->decl), OPT_Wattributes,
"%<weakref%> attribute ignored"
" because function is defined");
DECL_WEAK (decl) = 0;
for (vnode = varpool_first_variable (); vnode != first_var;
vnode = varpool_next_variable (vnode))
{
- tree decl = vnode->symbol.decl;
+ tree decl = vnode->decl;
if (DECL_EXTERNAL (decl)
&& DECL_INITIAL (decl))
varpool_finalize_decl (decl);
if (DECL_PRESERVE_P (decl))
- vnode->symbol.force_output = true;
+ vnode->force_output = true;
else if (lookup_attribute ("externally_visible", DECL_ATTRIBUTES (decl)))
{
- if (! TREE_PUBLIC (vnode->symbol.decl))
- warning_at (DECL_SOURCE_LOCATION (vnode->symbol.decl), OPT_Wattributes,
+ if (! TREE_PUBLIC (vnode->decl))
+ warning_at (DECL_SOURCE_LOCATION (vnode->decl), OPT_Wattributes,
"%<externally_visible%>"
" attribute have effect only on public objects");
}
if (lookup_attribute ("weakref", DECL_ATTRIBUTES (decl))
- && vnode->symbol.definition
+ && vnode->definition
&& DECL_INITIAL (decl))
{
- warning_at (DECL_SOURCE_LOCATION (vnode->symbol.decl), OPT_Wattributes,
+ warning_at (DECL_SOURCE_LOCATION (vnode->decl), OPT_Wattributes,
"%<weakref%> attribute ignored"
" because variable is initialized");
DECL_WEAK (decl) = 0;
gcc_assert (TREE_STATIC (decl) || DECL_EXTERNAL (decl));
- if (node->symbol.definition)
+ if (node->definition)
return;
notice_global_symbol (decl);
- node->symbol.definition = true;
+ node->definition = true;
if (TREE_THIS_VOLATILE (decl) || DECL_PRESERVE_P (decl)
/* Traditionally we do not eliminate static variables when not
optimizing and when not doing toplevel reoder. */
- || (!flag_toplevel_reorder && !DECL_COMDAT (node->symbol.decl)
- && !DECL_ARTIFICIAL (node->symbol.decl)))
- node->symbol.force_output = true;
+ || (!flag_toplevel_reorder && !DECL_COMDAT (node->decl)
+ && !DECL_ARTIFICIAL (node->decl)))
+ node->force_output = true;
if (cgraph_state == CGRAPH_STATE_CONSTRUCTION
- && (decide_is_symbol_needed ((symtab_node) node)
- || referred_to_p ((symtab_node)node)))
- enqueue_node ((symtab_node)node);
+ && (decide_is_symbol_needed (node)
+ || referred_to_p (node)))
+ enqueue_node (node);
if (cgraph_state >= CGRAPH_STATE_IPA_SSA)
varpool_analyze_node (node);
/* Some frontends produce various interface variables after compilation
/* Do not bother to mark virtual methods in anonymous namespace;
either we will find use of virtual table defining it, or it is
unused. */
- if (targets[i]->symbol.definition
+ if (targets[i]->definition
&& TREE_CODE
- (TREE_TYPE (targets[i]->symbol.decl))
+ (TREE_TYPE (targets[i]->decl))
== METHOD_TYPE
&& !type_in_anonymous_namespace_p
(method_class_type
- (TREE_TYPE (targets[i]->symbol.decl))))
- enqueue_node ((symtab_node) targets[i]);
+ (TREE_TYPE (targets[i]->decl))))
+ enqueue_node (targets[i]);
}
}
C++ FE is confused about the COMDAT groups being right. */
if (cpp_implicit_aliases_done)
FOR_EACH_SYMBOL (node)
- if (node->symbol.cpp_implicit_alias)
+ if (node->cpp_implicit_alias)
fixup_same_cpp_alias_visibility (node, symtab_alias_target (node));
if (optimize && flag_devirtualize)
build_type_inheritance_graph ();
/* First identify the trivially needed symbols. */
for (node = symtab_nodes;
- node != (symtab_node)first_analyzed
- && node != (symtab_node)first_analyzed_var; node = node->symbol.next)
+ node != first_analyzed
+ && node != first_analyzed_var; node = node->next)
{
if (decide_is_symbol_needed (node))
{
if (!changed && cgraph_dump_file)
fprintf (cgraph_dump_file, "\n");
}
- if (node == (symtab_node)first_analyzed
- || node == (symtab_node)first_analyzed_var)
+ if (node == first_analyzed
+ || node == first_analyzed_var)
break;
}
cgraph_process_new_functions ();
{
changed = true;
node = first;
- first = (symtab_node)first->symbol.aux;
+ first = (symtab_node)first->aux;
cgraph_node *cnode = dyn_cast <cgraph_node> (node);
- if (cnode && cnode->symbol.definition)
+ if (cnode && cnode->definition)
{
struct cgraph_edge *edge;
- tree decl = cnode->symbol.decl;
+ tree decl = cnode->decl;
/* ??? It is possible to create extern inline function
and later using weak alias attribute to kill its body.
See gcc.c-torture/compile/20011119-1.c */
if (!DECL_STRUCT_FUNCTION (decl)
- && !cnode->symbol.alias
+ && !cnode->alias
&& !cnode->thunk.thunk_p
&& !cnode->dispatcher_function)
{
continue;
}
- if (!cnode->symbol.analyzed)
+ if (!cnode->analyzed)
analyze_function (cnode);
for (edge = cnode->callees; edge; edge = edge->next_callee)
- if (edge->callee->symbol.definition)
- enqueue_node ((symtab_node)edge->callee);
+ if (edge->callee->definition)
+ enqueue_node (edge->callee);
if (optimize && flag_devirtualize)
{
struct cgraph_edge *next;
else
{
varpool_node *vnode = dyn_cast <varpool_node> (node);
- if (vnode && vnode->symbol.definition && !vnode->symbol.analyzed)
+ if (vnode && vnode->definition && !vnode->analyzed)
varpool_analyze_node (vnode);
}
- if (node->symbol.same_comdat_group)
+ if (node->same_comdat_group)
{
symtab_node next;
- for (next = node->symbol.same_comdat_group;
+ for (next = node->same_comdat_group;
next != node;
- next = next->symbol.same_comdat_group)
+ next = next->same_comdat_group)
enqueue_node (next);
}
- for (i = 0; ipa_ref_list_reference_iterate (&node->symbol.ref_list, i, ref); i++)
- if (ref->referred->symbol.definition)
+ for (i = 0; ipa_ref_list_reference_iterate (&node->ref_list, i, ref); i++)
+ if (ref->referred->definition)
enqueue_node (ref->referred);
cgraph_process_new_functions ();
}
fprintf (cgraph_dump_file, "\nRemoving unused symbols:");
for (node = symtab_nodes;
- node != (symtab_node)first_handled
- && node != (symtab_node)first_handled_var; node = next)
+ node != first_handled
+ && node != first_handled_var; node = next)
{
- next = node->symbol.next;
- if (!node->symbol.aux && !referred_to_p (node))
+ next = node->next;
+ if (!node->aux && !referred_to_p (node))
{
if (cgraph_dump_file)
fprintf (cgraph_dump_file, " %s", symtab_node_name (node));
}
if (cgraph_node *cnode = dyn_cast <cgraph_node> (node))
{
- tree decl = node->symbol.decl;
+ tree decl = node->decl;
- if (cnode->symbol.definition && !gimple_has_body_p (decl)
- && !cnode->symbol.alias
+ if (cnode->definition && !gimple_has_body_p (decl)
+ && !cnode->alias
&& !cnode->thunk.thunk_p)
cgraph_reset_node (cnode);
- gcc_assert (!cnode->symbol.definition || cnode->thunk.thunk_p
- || cnode->symbol.alias
+ gcc_assert (!cnode->definition || cnode->thunk.thunk_p
+ || cnode->alias
|| gimple_has_body_p (decl));
- gcc_assert (cnode->symbol.analyzed == cnode->symbol.definition);
+ gcc_assert (cnode->analyzed == cnode->definition);
}
- node->symbol.aux = NULL;
+ node->aux = NULL;
}
- for (;node; node = node->symbol.next)
- node->symbol.aux = NULL;
+ for (;node; node = node->next)
+ node->aux = NULL;
first_analyzed = cgraph_first_function ();
first_analyzed_var = varpool_first_variable ();
if (cgraph_dump_file)
symtab_node node = symtab_get_node (p->decl);
if (node)
{
- node->symbol.alias_target = p->target;
- node->symbol.weakref = true;
- node->symbol.alias = true;
+ node->alias_target = p->target;
+ node->weakref = true;
+ node->alias = true;
}
alias_pairs->unordered_remove (i);
continue;
error ("%q+D aliased to undefined symbol %qE", p->decl, p->target);
symtab_node node = symtab_get_node (p->decl);
if (node)
- node->symbol.alias = false;
+ node->alias = false;
alias_pairs->unordered_remove (i);
continue;
}
- if (DECL_EXTERNAL (target_node->symbol.decl)
+ if (DECL_EXTERNAL (target_node->decl)
/* We use local aliases for C++ thunks to force the tailcall
to bind locally. This is a hack - to keep it working do
the following (which is not strictly correct). */
- && (! TREE_CODE (target_node->symbol.decl) == FUNCTION_DECL
- || ! DECL_VIRTUAL_P (target_node->symbol.decl))
+ && (! TREE_CODE (target_node->decl) == FUNCTION_DECL
+ || ! DECL_VIRTUAL_P (target_node->decl))
&& ! lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl)))
{
error ("%q+D aliased to external symbol %qE",
&& target_node && is_a <cgraph_node> (target_node))
{
struct cgraph_node *src_node = cgraph_get_node (p->decl);
- if (src_node && src_node->symbol.definition)
+ if (src_node && src_node->definition)
cgraph_reset_node (src_node);
- cgraph_create_function_alias (p->decl, target_node->symbol.decl);
+ cgraph_create_function_alias (p->decl, target_node->decl);
alias_pairs->unordered_remove (i);
}
else if (TREE_CODE (p->decl) == VAR_DECL
&& target_node && is_a <varpool_node> (target_node))
{
- varpool_create_variable_alias (p->decl, target_node->symbol.decl);
+ varpool_create_variable_alias (p->decl, target_node->decl);
alias_pairs->unordered_remove (i);
}
else
error ("%q+D alias in between function and variable is not supported",
p->decl);
warning (0, "%q+D aliased declaration",
- target_node->symbol.decl);
+ target_node->decl);
alias_pairs->unordered_remove (i);
}
}
FOR_EACH_FUNCTION (node)
{
- tree decl = node->symbol.decl;
+ tree decl = node->decl;
- gcc_assert (!node->process || node->symbol.same_comdat_group);
+ gcc_assert (!node->process || node->same_comdat_group);
if (node->process)
continue;
/* We need to output all local functions that are used and not
always inlined, as well as those that are reachable from
outside the current compilation unit. */
- if (node->symbol.analyzed
+ if (node->analyzed
&& !node->thunk.thunk_p
- && !node->symbol.alias
+ && !node->alias
&& !node->global.inlined_to
&& !TREE_ASM_WRITTEN (decl)
&& !DECL_EXTERNAL (decl))
{
node->process = 1;
- if (node->symbol.same_comdat_group)
+ if (node->same_comdat_group)
{
struct cgraph_node *next;
- for (next = cgraph (node->symbol.same_comdat_group);
+ for (next = cgraph (node->same_comdat_group);
next != node;
- next = cgraph (next->symbol.same_comdat_group))
- if (!next->thunk.thunk_p && !next->symbol.alias)
+ next = cgraph (next->same_comdat_group))
+ if (!next->thunk.thunk_p && !next->alias)
next->process = 1;
}
}
- else if (node->symbol.same_comdat_group)
+ else if (node->same_comdat_group)
{
#ifdef ENABLE_CHECKING
check_same_comdat_groups = true;
/* FIXME: in ltrans unit when offline copy is outside partition but inline copies
are inside partition, we can end up not removing the body since we no longer
have analyzed node pointing to it. */
- && !node->symbol.in_other_partition
- && !node->symbol.alias
+ && !node->in_other_partition
+ && !node->alias
&& !node->clones
&& !DECL_EXTERNAL (decl))
{
#endif
gcc_assert (node->global.inlined_to
|| !gimple_has_body_p (decl)
- || node->symbol.in_other_partition
+ || node->in_other_partition
|| node->clones
|| DECL_ARTIFICIAL (decl)
|| DECL_EXTERNAL (decl));
#ifdef ENABLE_CHECKING
if (check_same_comdat_groups)
FOR_EACH_FUNCTION (node)
- if (node->symbol.same_comdat_group && !node->process)
+ if (node->same_comdat_group && !node->process)
{
- tree decl = node->symbol.decl;
+ tree decl = node->decl;
if (!node->global.inlined_to
&& gimple_has_body_p (decl)
/* FIXME: in an ltrans unit when the offline copy is outside a
partition but inline copies are inside a partition, we can
end up not removing the body since we no longer have an
analyzed node pointing to it. */
- && !node->symbol.in_other_partition
+ && !node->in_other_partition
&& !node->clones
&& !DECL_EXTERNAL (decl))
{
HOST_WIDE_INT fixed_offset = node->thunk.fixed_offset;
HOST_WIDE_INT virtual_value = node->thunk.virtual_value;
tree virtual_offset = NULL;
- tree alias = node->callees->callee->symbol.decl;
- tree thunk_fndecl = node->symbol.decl;
+ tree alias = node->callees->callee->decl;
+ tree thunk_fndecl = node->decl;
tree a;
set_cfun (NULL);
TREE_ASM_WRITTEN (thunk_fndecl) = 1;
node->thunk.thunk_p = false;
- node->symbol.analyzed = false;
+ node->analyzed = false;
}
else
{
}
else
e = e->next_caller;
- for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list,
+ for (i = 0; ipa_ref_list_referring_iterate (&node->ref_list,
i, ref); i++)
if (ref->use == IPA_REF_ALIAS)
{
struct cgraph_node *alias = ipa_ref_referring_node (ref);
- bool saved_written = TREE_ASM_WRITTEN (node->symbol.decl);
+ bool saved_written = TREE_ASM_WRITTEN (node->decl);
/* Force assemble_alias to really output the alias this time instead
of buffering it in same alias pairs. */
- TREE_ASM_WRITTEN (node->symbol.decl) = 1;
- do_assemble_alias (alias->symbol.decl,
- DECL_ASSEMBLER_NAME (node->symbol.decl));
+ TREE_ASM_WRITTEN (node->decl) = 1;
+ do_assemble_alias (alias->decl,
+ DECL_ASSEMBLER_NAME (node->decl));
assemble_thunks_and_aliases (alias);
- TREE_ASM_WRITTEN (node->symbol.decl) = saved_written;
+ TREE_ASM_WRITTEN (node->decl) = saved_written;
}
}
static void
expand_function (struct cgraph_node *node)
{
- tree decl = node->symbol.decl;
+ tree decl = node->decl;
location_t saved_loc;
/* We ought to not compile any inline clones. */
/* Eliminate all call edges. This is important so the GIMPLE_CALL no longer
points to the dead function body. */
cgraph_node_remove_callees (node);
- ipa_remove_all_references (&node->symbol.ref_list);
+ ipa_remove_all_references (&node->ref_list);
}
FOR_EACH_DEFINED_FUNCTION (pf)
{
- if (pf->process && !pf->thunk.thunk_p && !pf->symbol.alias)
+ if (pf->process && !pf->thunk.thunk_p && !pf->alias)
{
- i = pf->symbol.order;
+ i = pf->order;
gcc_assert (nodes[i].kind == ORDER_UNDEFINED);
nodes[i].kind = ORDER_FUNCTION;
nodes[i].u.f = pf;
}
FOR_EACH_DEFINED_VARIABLE (pv)
- if (!DECL_EXTERNAL (pv->symbol.decl))
+ if (!DECL_EXTERNAL (pv->decl))
{
- i = pv->symbol.order;
+ i = pv->order;
gcc_assert (nodes[i].kind == ORDER_UNDEFINED);
nodes[i].kind = ORDER_VAR;
nodes[i].u.v = pv;
{
symtab_node node;
FOR_EACH_SYMBOL (node)
- if (node->symbol.alias
- && !TREE_ASM_WRITTEN (node->symbol.decl)
- && node->symbol.weakref)
+ if (node->alias
+ && !TREE_ASM_WRITTEN (node->decl)
+ && node->weakref)
{
tree target;
alias.
When alias target is defined, we need to fetch it from symtab reference,
otherwise it is pointed to by alias_target. */
- if (node->symbol.alias_target)
- target = (DECL_P (node->symbol.alias_target)
- ? DECL_ASSEMBLER_NAME (node->symbol.alias_target)
- : node->symbol.alias_target);
- else if (node->symbol.analyzed)
- target = DECL_ASSEMBLER_NAME (symtab_alias_target (node)->symbol.decl);
+ if (node->alias_target)
+ target = (DECL_P (node->alias_target)
+ ? DECL_ASSEMBLER_NAME (node->alias_target)
+ : node->alias_target);
+ else if (node->analyzed)
+ target = DECL_ASSEMBLER_NAME (symtab_alias_target (node)->decl);
else
{
gcc_unreachable ();
- target = get_alias_symbol (node->symbol.decl);
+ target = get_alias_symbol (node->decl);
}
- do_assemble_alias (node->symbol.decl, target);
+ do_assemble_alias (node->decl, target);
}
}
symtab_node node;
FOR_EACH_SYMBOL (node)
- if (node->symbol.alias
- && lookup_attribute ("weakref", DECL_ATTRIBUTES (node->symbol.decl)))
+ if (node->alias
+ && lookup_attribute ("weakref", DECL_ATTRIBUTES (node->decl)))
{
IDENTIFIER_TRANSPARENT_ALIAS
- (DECL_ASSEMBLER_NAME (node->symbol.decl)) = 1;
- TREE_CHAIN (DECL_ASSEMBLER_NAME (node->symbol.decl))
- = (node->symbol.alias_target ? node->symbol.alias_target
- : DECL_ASSEMBLER_NAME (symtab_alias_target (node)->symbol.decl));
+ (DECL_ASSEMBLER_NAME (node->decl)) = 1;
+ TREE_CHAIN (DECL_ASSEMBLER_NAME (node->decl))
+ = (node->alias_target ? node->alias_target
+ : DECL_ASSEMBLER_NAME (symtab_alias_target (node)->decl));
}
#endif
FOR_EACH_DEFINED_FUNCTION (node)
if (node->global.inlined_to
- || gimple_has_body_p (node->symbol.decl))
+ || gimple_has_body_p (node->decl))
{
error_found = true;
dump_cgraph_node (stderr, node);
while (default_version_info != NULL)
{
if (is_function_default_version
- (default_version_info->this_node->symbol.decl))
+ (default_version_info->this_node->decl))
break;
default_version_info = default_version_info->next;
}
struct cgraph_function_version_info *dispatcher_version_info = NULL;
/* Right now, the dispatching is done via ifunc. */
- dispatch_decl = make_dispatcher_decl (default_node->symbol.decl);
+ dispatch_decl = make_dispatcher_decl (default_node->decl);
dispatcher_node = cgraph_get_create_node (dispatch_decl);
gcc_assert (dispatcher_node != NULL);
dispatcher_version_info
= insert_new_cgraph_node_version (dispatcher_node);
dispatcher_version_info->next = default_version_info;
- dispatcher_node->symbol.definition = 1;
+ dispatcher_node->definition = 1;
/* Set the dispatcher for all the versions. */
it_v = default_version_info;
else
#endif
{
- error_at (DECL_SOURCE_LOCATION (default_node->symbol.decl),
+ error_at (DECL_SOURCE_LOCATION (default_node->decl),
"multiversioning needs ifunc which is not supported "
"on this target");
}
return node_version_info->dispatcher_resolver;
/* The first version in the chain corresponds to the default version. */
- default_ver_decl = node_version_info->next->this_node->symbol.decl;
+ default_ver_decl = node_version_info->next->this_node->decl;
/* node is going to be an alias, so remove the finalized bit. */
- node->symbol.definition = false;
+ node->definition = false;
resolver_decl = make_resolver_func (default_ver_decl,
- node->symbol.decl, &empty_bb);
+ node->decl, &empty_bb);
node_version_info->dispatcher_resolver = resolver_decl;
not. This happens for methods in derived classes that override
virtual methods in base classes but are not explicitly marked as
virtual. */
- if (DECL_VINDEX (versn->symbol.decl))
+ if (DECL_VINDEX (versn->decl))
sorry ("Virtual function multiversioning not supported");
- fn_ver_vec.safe_push (versn->symbol.decl);
+ fn_ver_vec.safe_push (versn->decl);
}
dispatch_function_versions (resolver_decl, &fn_ver_vec, &empty_bb);
coverage_compute_profile_id (struct cgraph_node *n)
{
expanded_location xloc
- = expand_location (DECL_SOURCE_LOCATION (n->symbol.decl));
+ = expand_location (DECL_SOURCE_LOCATION (n->decl));
unsigned chksum = xloc.line;
chksum = coverage_checksum_string (chksum, xloc.file);
chksum = coverage_checksum_string
- (chksum, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (n->symbol.decl)));
+ (chksum, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (n->decl)));
if (first_global_object_name)
chksum = coverage_checksum_string
(chksum, first_global_object_name);
+2013-10-29 David Malcolm <dmalcolm@redhat.com>
+
+ Patch autogenerated by refactor_symtab.py from
+ https://github.com/davidmalcolm/gcc-refactoring-scripts
+ revision 58bb219cc090b2f4516a9297d868c245495ee622
+
+ * call.c (mark_versions_used): Update for conversion of symtab types
+ to a true class hierarchy.
+ * decl2.c (cp_write_global_declarations): Likewise.
+ (clear_decl_external): Likewise.
+ (build_java_method_aliases): Likewise.
+ (collect_candidates_for_java_method_aliases): Likewise.
+ (mark_needed): Likewise.
+ (var_finalized_p): Likewise.
+ (maybe_make_one_only): Likewise.
+ (maybe_emit_vtables): Likewise.
+ * lambda.c (maybe_add_lambda_conv_op): Likewise.
+ * method.c (use_thunk): Likewise.
+ * optimize.c (maybe_clone_body): Likewise.
+ * tree.c (cp_fix_function_decl_p): Likewise.
+
2013-10-29 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58888
it_v = node_v->next;
while (it_v != NULL)
{
- mark_used (it_v->this_node->symbol.decl);
+ mark_used (it_v->this_node->decl);
it_v = it_v->next;
}
}
struct varpool_node *node = varpool_node_for_decl (decl);
DECL_COMDAT (decl) = 1;
/* Mark it needed so we don't forget to emit it. */
- node->symbol.forced_by_abi = true;
+ node->forced_by_abi = true;
TREE_USED (decl) = 1;
}
}
static bool
var_finalized_p (tree var)
{
- return varpool_node_for_decl (var)->symbol.definition;
+ return varpool_node_for_decl (var)->definition;
}
/* DECL is a VAR_DECL or FUNCTION_DECL which, for whatever reason,
functions can be marked reachable, just use the external
definition. */
struct cgraph_node *node = cgraph_get_create_node (decl);
- node->symbol.forced_by_abi = true;
+ node->forced_by_abi = true;
}
else if (TREE_CODE (decl) == VAR_DECL)
{
struct varpool_node *node = varpool_node_for_decl (decl);
/* C++ frontend use mark_decl_references to force COMDAT variables
to be output that might appear dead otherwise. */
- node->symbol.forced_by_abi = true;
+ node->forced_by_abi = true;
}
}
{
current = varpool_node_for_decl (vtbl);
if (last)
- symtab_add_to_same_comdat_group ((symtab_node) current, (symtab_node) last);
+ symtab_add_to_same_comdat_group (current, last);
last = current;
}
}
FOR_EACH_FUNCTION (node)
{
- tree fndecl = node->symbol.decl;
+ tree fndecl = node->decl;
if (DECL_CLASS_SCOPE_P (fndecl)
&& TYPE_FOR_JAVA (DECL_CONTEXT (fndecl))
FOR_EACH_FUNCTION (node)
{
- tree fndecl = node->symbol.decl;
+ tree fndecl = node->decl;
if (TREE_ASM_WRITTEN (fndecl)
&& pointer_set_contains (candidates, fndecl))
static bool
clear_decl_external (struct cgraph_node *node, void * /*data*/)
{
- DECL_EXTERNAL (node->symbol.decl) = 0;
+ DECL_EXTERNAL (node->decl) = 0;
return false;
}
struct cgraph_node *node, *next;
node = cgraph_get_node (decl);
- if (node->symbol.cpp_implicit_alias)
+ if (node->cpp_implicit_alias)
node = cgraph_alias_target (node);
cgraph_for_node_and_aliases (node, clear_decl_external,
/* If we mark !DECL_EXTERNAL one of the symbols in some comdat
group, we need to mark all symbols in the same comdat group
that way. */
- if (node->symbol.same_comdat_group)
- for (next = cgraph (node->symbol.same_comdat_group);
+ if (node->same_comdat_group)
+ for (next = cgraph (node->same_comdat_group);
next != node;
- next = cgraph (next->symbol.same_comdat_group))
+ next = cgraph (next->same_comdat_group))
cgraph_for_node_and_aliases (next, clear_decl_external,
NULL, true);
}
if (!DECL_EXTERNAL (decl)
&& decl_needed_p (decl)
&& !TREE_ASM_WRITTEN (decl)
- && !cgraph_get_node (decl)->symbol.definition)
+ && !cgraph_get_node (decl)->definition)
{
/* We will output the function; no longer consider it in this
loop. */
{
/* Put the thunk in the same comdat group as the call op. */
symtab_add_to_same_comdat_group
- ((symtab_node) cgraph_get_create_node (statfn),
- (symtab_node) cgraph_get_create_node (callop));
+ (cgraph_get_create_node (statfn),
+ cgraph_get_create_node (callop));
}
tree body = begin_function_body ();
tree compound_stmt = begin_compound_stmt (0);
this_adjusting, fixed_offset, virtual_value,
virtual_offset, alias);
if (DECL_ONE_ONLY (function))
- symtab_add_to_same_comdat_group ((symtab_node) thunk_node,
- (symtab_node) funcn);
+ symtab_add_to_same_comdat_group (thunk_node,
+ funcn);
if (!this_adjusting
|| !targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset,
virtual, it goes into the same comdat group as well. */
if (comdat_group)
symtab_add_to_same_comdat_group
- ((symtab_node) cgraph_get_create_node (clone),
+ (cgraph_get_create_node (clone),
symtab_get_node (fns[0]));
}
else if (alias)
/* Don't fix same_body aliases. Although they don't have their own
CFG, they share it with what they alias to. */
- if (!node || !node->symbol.alias
- || !vec_safe_length (node->symbol.ref_list.references))
+ if (!node || !node->alias
+ || !vec_safe_length (node->ref_list.references))
return true;
}
return NULL, otherwise stabs might reference an undefined
symbol. */
struct varpool_node *node = varpool_get_node (expr);
- if (!node || !node->symbol.definition)
+ if (!node || !node->definition)
return NULL;
}
/* FALLTHRU */
else if (TREE_CODE (*tp) == VAR_DECL)
{
struct varpool_node *node = varpool_get_node (*tp);
- if (!node || !node->symbol.definition)
+ if (!node || !node->definition)
return *tp;
}
else if (TREE_CODE (*tp) == FUNCTION_DECL
/* Ask cgraph if the global variable really is to be emitted.
If yes, then we'll keep the DIE of ENTRY->TYPE. */
struct varpool_node *node = varpool_get_node (entry->var_decl);
- if (node && node->symbol.definition)
+ if (node && node->definition)
{
die->die_perennial_p = 1;
/* Keep the parent DIEs as well. */
|| TREE_CODE (from_decl) != VAR_DECL
|| !DECL_EXTERNAL (from_decl)
|| (flag_ltrans
- && symtab_get_node (from_decl)->symbol.in_other_partition))
+ && symtab_get_node (from_decl)->in_other_partition))
return true;
/* We are folding reference from external vtable. The vtable may reffer
to a symbol keyed to other compilation unit. The other compilation
unit may be in separate DSO and the symbol may be hidden. */
if (DECL_VISIBILITY_SPECIFIED (decl)
&& DECL_EXTERNAL (decl)
- && (!(snode = symtab_get_node (decl)) || !snode->symbol.in_other_partition))
+ && (!(snode = symtab_get_node (decl)) || !snode->in_other_partition))
return false;
/* When function is public, we always can introduce new reference.
Exception are the COMDAT functions where introducing a direct
The second is important when devirtualization happens during final
compilation stage when making a new reference no longer makes callee
to be compiled. */
- if (!node || !node->symbol.definition || node->global.inlined_to)
+ if (!node || !node->definition || node->global.inlined_to)
{
gcc_checking_assert (!TREE_ASM_WRITTEN (decl));
return false;
else if (TREE_CODE (decl) == VAR_DECL)
{
vnode = varpool_get_node (decl);
- if (!vnode || !vnode->symbol.definition)
+ if (!vnode || !vnode->definition)
{
gcc_checking_assert (!TREE_ASM_WRITTEN (decl));
return false;
if (cgn)
for (cgn = cgn->nested; cgn; cgn = cgn->next_nested)
- unshare_body (cgn->symbol.decl);
+ unshare_body (cgn->decl);
}
/* Callback for walk_tree to unmark the visited trees rooted at *TP.
if (cgn)
for (cgn = cgn->nested; cgn; cgn = cgn->next_nested)
- unvisit_body (cgn->symbol.decl);
+ unvisit_body (cgn->decl);
}
/* Unconditionally make an unshared copy of EXPR. This is used when using
fprintf (f, " [from:");
for (s = val->sources; s; s = s->next)
- fprintf (f, " %i(%i)", s->cs->caller->symbol.order,
+ fprintf (f, " %i(%i)", s->cs->caller->order,
s->cs->frequency);
fprintf (f, "]");
}
info = IPA_NODE_REF (node);
fprintf (f, " Node: %s/%i:\n", cgraph_node_name (node),
- node->symbol.order);
+ node->order);
count = ipa_get_param_count (info);
for (i = 0; i < count; i++)
{
/* There are a number of generic reasons functions cannot be versioned. We
also cannot remove parameters if there are type attributes such as fnspec
present. */
- if (node->symbol.alias || node->thunk.thunk_p)
+ if (node->alias || node->thunk.thunk_p)
reason = "alias or thunk";
else if (!node->local.versionable)
reason = "not a tree_versionable_function";
else if (cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE)
reason = "insufficient body availability";
- if (reason && dump_file && !node->symbol.alias && !node->thunk.thunk_p)
+ if (reason && dump_file && !node->alias && !node->thunk.thunk_p)
fprintf (dump_file, "Function %s/%i is not versionable, reason: %s.\n",
- cgraph_node_name (node), node->symbol.order, reason);
+ cgraph_node_name (node), node->order, reason);
node->local.versionable = (reason == NULL);
}
return false;
}
- if (!optimize_function_for_speed_p (DECL_STRUCT_FUNCTION (node->symbol.decl)))
+ if (!optimize_function_for_speed_p (DECL_STRUCT_FUNCTION (node->decl)))
{
if (dump_file)
fprintf (dump_file, "Not considering %s for cloning; "
set_all_contains_variable (plats);
}
if (dump_file && (dump_flags & TDF_DETAILS)
- && !node->symbol.alias && !node->thunk.thunk_p)
+ && !node->alias && !node->thunk.thunk_p)
fprintf (dump_file, "Marking all lattices of %s/%i as %s\n",
- cgraph_node_name (node), node->symbol.order,
+ cgraph_node_name (node), node->order,
disable ? "BOTTOM" : "VARIABLE");
}
int i, args_count, parms_count;
callee = cgraph_function_node (cs->callee, &availability);
- if (!callee->symbol.definition)
+ if (!callee->definition)
return false;
gcc_checking_assert (cgraph_function_with_gimple_body_p (callee));
callee_info = IPA_NODE_REF (callee);
parameter. However, we might need to uncover a thunk from below a series
of aliases first. */
alias_or_thunk = cs->callee;
- while (alias_or_thunk->symbol.alias)
+ while (alias_or_thunk->alias)
alias_or_thunk = cgraph_alias_target (alias_or_thunk);
if (alias_or_thunk->thunk.thunk_p)
{
/* Only bare minimum benefit for clearly un-inlineable targets. */
res += 1;
callee = cgraph_get_node (target);
- if (!callee || !callee->symbol.definition)
+ if (!callee || !callee->definition)
continue;
isummary = inline_summary (callee);
if (!isummary->inlinable)
else if (isummary->size <= MAX_INLINE_INSNS_AUTO / 2)
res += 15;
else if (isummary->size <= MAX_INLINE_INSNS_AUTO
- || DECL_DECLARED_INLINE_P (callee->symbol.decl))
+ || DECL_DECLARED_INLINE_P (callee->decl))
res += 7;
}
{
if (time_benefit == 0
|| !flag_ipa_cp_clone
- || !optimize_function_for_speed_p (DECL_STRUCT_FUNCTION (node->symbol.decl)))
+ || !optimize_function_for_speed_p (DECL_STRUCT_FUNCTION (node->decl)))
return false;
gcc_assert (size_cost > 0);
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "\nEstimating effects for %s/%i, base_time: %i.\n",
- cgraph_node_name (node), node->symbol.order, base_time);
+ cgraph_node_name (node), node->order, base_time);
always_const = gather_context_independent_values (info, &known_csts,
&known_binfos, &known_aggs,
ipa_get_param_count (info));
initialize_node_lattices (node);
}
- if (node->symbol.definition && !node->symbol.alias)
+ if (node->definition && !node->alias)
overall_size += inline_summary (node)->self_size;
if (node->count > max_count)
max_count = node->count;
fprintf (dump_file, " controlled uses count of param "
"%i bumped down to %i\n", param_index, c);
if (c == 0
- && (to_del = ipa_find_reference ((symtab_node) node,
- (symtab_node) cs->callee,
+ && (to_del = ipa_find_reference (node,
+ cs->callee,
NULL, 0)))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, " Problem: node %s/%i has too low count "
HOST_WIDE_INT_PRINT_DEC " while the sum of incoming "
"counts is " HOST_WIDE_INT_PRINT_DEC "\n",
- cgraph_node_name (orig_node), orig_node->symbol.order,
+ cgraph_node_name (orig_node), orig_node->order,
(HOST_WIDE_INT) orig_node_count,
(HOST_WIDE_INT) (orig_sum + new_sum));
args_to_skip, "constprop");
ipa_set_node_agg_value_chain (new_node, aggvals);
for (av = aggvals; av; av = av->next)
- ipa_maybe_record_reference ((symtab_node) new_node, av->value,
+ ipa_maybe_record_reference (new_node, av->value,
IPA_REF_ADDR, NULL);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " the new node is %s/%i.\n",
- cgraph_node_name (new_node), new_node->symbol.order);
+ cgraph_node_name (new_node), new_node->order);
if (aggvals)
ipa_dump_agg_replacement_values (dump_file, aggvals);
}
fprintf (dump_file, " - adding an extra caller %s/%i"
" of %s/%i\n",
xstrdup (cgraph_node_name (cs->caller)),
- cs->caller->symbol.order,
+ cs->caller->order,
xstrdup (cgraph_node_name (val->spec_node)),
- val->spec_node->symbol.order);
+ val->spec_node->order);
cgraph_redirect_edge_callee (cs, val->spec_node);
redirected_sum += cs->count;
if (dump_file)
fprintf (dump_file, " Creating a specialized node of %s/%i.\n",
- cgraph_node_name (node), node->symbol.order);
+ cgraph_node_name (node), node->order);
callers = gather_edges_for_value (val, caller_count);
kv = known_csts.copy ();
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "\nEvaluating opportunities for %s/%i.\n",
- cgraph_node_name (node), node->symbol.order);
+ cgraph_node_name (node), node->order);
gather_context_independent_values (info, &known_csts, &known_binfos,
info->do_clone_for_all_contexts ? &known_aggs
if (dump_file)
fprintf (dump_file, " - Creating a specialized node of %s/%i "
"for all known contexts.\n", cgraph_node_name (node),
- node->symbol.order);
+ node->order);
callers = collect_callers_of_node (node);
move_binfos_to_values (known_csts, known_binfos);
identify_dead_nodes (struct cgraph_node *node)
{
struct cgraph_node *v;
- for (v = node; v ; v = ((struct ipa_dfs_info *) v->symbol.aux)->next_cycle)
+ for (v = node; v ; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
if (cgraph_will_be_removed_from_program_if_no_direct_calls (v)
&& !cgraph_for_node_and_aliases (v,
has_undead_caller_from_outside_scc_p,
NULL, true))
IPA_NODE_REF (v)->node_dead = 1;
- for (v = node; v ; v = ((struct ipa_dfs_info *) v->symbol.aux)->next_cycle)
+ for (v = node; v ; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
if (!IPA_NODE_REF (v)->node_dead)
spread_undeadness (v);
if (dump_file && (dump_flags & TDF_DETAILS))
{
- for (v = node; v ; v = ((struct ipa_dfs_info *) v->symbol.aux)->next_cycle)
+ for (v = node; v ; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
if (IPA_NODE_REF (v)->node_dead)
fprintf (dump_file, " Marking node as dead: %s/%i.\n",
- cgraph_node_name (v), v->symbol.order);
+ cgraph_node_name (v), v->order);
}
}
{
struct cgraph_node *v;
iterate = false;
- for (v = node; v ; v = ((struct ipa_dfs_info *) v->symbol.aux)->next_cycle)
+ for (v = node; v ; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
if (cgraph_function_with_gimple_body_p (v)
&& ipcp_versionable_function_p (v))
iterate |= decide_whether_version_node (v);
FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
{
node->local.versionable
- = tree_versionable_function_p (node->symbol.decl);
+ = tree_versionable_function_p (node->decl);
ipa_analyze_node (node);
}
}
/* We reconstruct the graph starting of types of all methods seen in the
the unit. */
FOR_EACH_FUNCTION (n)
- if (DECL_VIRTUAL_P (n->symbol.decl)
- && symtab_real_symbol_p ((symtab_node)n))
- get_odr_type (method_class_type (TREE_TYPE (n->symbol.decl)), true);
+ if (DECL_VIRTUAL_P (n->decl)
+ && symtab_real_symbol_p (n))
+ get_odr_type (method_class_type (TREE_TYPE (n->decl)), true);
if (inheritance_dump_file)
{
dump_type_inheritance_graph (inheritance_dump_file);
&& !pointer_set_insert (inserted, target)
&& (target_node = cgraph_get_node (target)) != NULL
&& (TREE_PUBLIC (target)
- || target_node->symbol.definition)
- && symtab_real_symbol_p ((symtab_node)target_node))
+ || target_node->definition)
+ && symtab_real_symbol_p (target_node))
{
pointer_set_insert (cached_polymorphic_call_targets,
target_node);
if (TREE_CODE (vtable) == POINTER_PLUS_EXPR)
vtable = TREE_OPERAND (TREE_OPERAND (vtable, 0), 0);
vnode = varpool_get_node (vtable);
- if (!vnode || !vnode->symbol.definition)
+ if (!vnode || !vnode->definition)
return;
}
tree target = gimple_get_virt_method_for_binfo (otr_token, type_binfo);
void *d ATTRIBUTE_UNUSED)
{
if (cached_polymorphic_call_targets
- && DECL_VIRTUAL_P (n->symbol.decl)
- && type_in_anonymous_namespace_p (DECL_CONTEXT (n->symbol.decl)))
+ && DECL_VIRTUAL_P (n->decl)
+ && type_in_anonymous_namespace_p (DECL_CONTEXT (n->decl)))
free_polymorphic_call_targets_hash ();
}
final ? " (full list)" : " (partial list, may call to other unit)");
for (i = 0; i < targets.length (); i++)
fprintf (f, " %s/%i", cgraph_node_name (targets[i]),
- targets[i]->symbol.order);
+ targets[i]->order);
fprintf (f, "\n");
}
/* At a moment we allow middle end to dig out new external declarations
as a targets of polymorphic calls. */
- if (!final && !n->symbol.definition)
+ if (!final && !n->definition)
return true;
return false;
}
/* We reconstruct the graph starting of types of all methods seen in the
the unit. */
FOR_EACH_FUNCTION (n)
- if (DECL_VIRTUAL_P (n->symbol.decl)
- && !n->symbol.definition
- && symtab_real_symbol_p ((symtab_node)n))
- get_odr_type (method_class_type (TREE_TYPE (n->symbol.decl)), true);
+ if (DECL_VIRTUAL_P (n->decl)
+ && !n->definition
+ && symtab_real_symbol_p (n))
+ get_odr_type (method_class_type (TREE_TYPE (n->decl)), true);
timevar_pop (TV_IPA_INHERITANCE);
}
{
int flags;
/* cxa_pure_virtual and similar things are not likely. */
- if (TREE_CODE (TREE_TYPE (n->symbol.decl)) != METHOD_TYPE)
+ if (TREE_CODE (TREE_TYPE (n->decl)) != METHOD_TYPE)
return false;
- flags = flags_from_decl_or_type (n->symbol.decl);
+ flags = flags_from_decl_or_type (n->decl);
if (flags & ECF_NORETURN)
return false;
if (lookup_attribute ("cold",
- DECL_ATTRIBUTES (n->symbol.decl)))
+ DECL_ATTRIBUTES (n->decl)))
return false;
if (n->frequency < NODE_FREQUENCY_NORMAL)
return false;
bool update = false;
if (dump_file && n->indirect_calls)
fprintf (dump_file, "\n\nProcesing function %s/%i\n",
- cgraph_node_name (n), n->symbol.order);
+ cgraph_node_name (n), n->order);
for (e = n->indirect_calls; e; e = e->next_callee)
if (e->indirect_info->polymorphic)
{
}
continue;
}
- if (!likely_target->symbol.definition)
+ if (!likely_target->definition)
{
if (dump_file)
fprintf (dump_file, "Target is not an definition\n");
can handle these just well, it is common for programs to
incorrectly with headers defining methods they are linked
with. */
- if (DECL_EXTERNAL (likely_target->symbol.decl))
+ if (DECL_EXTERNAL (likely_target->decl))
{
if (dump_file)
fprintf (dump_file, "Target is external\n");
}
if (cgraph_function_body_availability (likely_target)
<= AVAIL_OVERWRITABLE
- && symtab_can_be_discarded ((symtab_node) likely_target))
+ && symtab_can_be_discarded (likely_target))
{
if (dump_file)
fprintf (dump_file, "Target is overwritable\n");
if (dump_file)
fprintf (dump_file,
"Speculatively devirtualizing call in %s/%i to %s/%i\n",
- cgraph_node_name (n), n->symbol.order,
+ cgraph_node_name (n), n->order,
cgraph_node_name (likely_target),
- likely_target->symbol.order);
- if (!symtab_can_be_discarded ((symtab_node) likely_target))
+ likely_target->order);
+ if (!symtab_can_be_discarded (likely_target))
{
cgraph_node *alias;
alias = cgraph (symtab_nonoverwritable_alias
- ((symtab_node)likely_target));
+ (likely_target));
if (alias)
likely_target = alias;
}
fprintf (f,
"%*s%s/%i %s\n%*s loop depth:%2i freq:%4i size:%2i"
" time: %2i callee size:%2i stack:%2i",
- indent, "", cgraph_node_name (callee), callee->symbol.order,
+ indent, "", cgraph_node_name (callee), callee->order,
!edge->inline_failed
? "inlined" : cgraph_inline_failed_string (edge-> inline_failed),
indent, "", es->loop_depth, edge->frequency,
void
dump_inline_summary (FILE *f, struct cgraph_node *node)
{
- if (node->symbol.definition)
+ if (node->definition)
{
struct inline_summary *s = inline_summary (node);
size_time_entry *e;
int i;
fprintf (f, "Inline summary for %s/%i", cgraph_node_name (node),
- node->symbol.order);
- if (DECL_DISREGARD_INLINE_LIMITS (node->symbol.decl))
+ node->order);
+ if (DECL_DISREGARD_INLINE_LIMITS (node->decl))
fprintf (f, " always_inline");
if (s->inlinable)
fprintf (f, " inlinable");
if (e->indirect_unknown_callee)
e->inline_failed = CIF_INDIRECT_UNKNOWN_CALL;
- else if (!callee->symbol.definition)
+ else if (!callee->definition)
e->inline_failed = CIF_BODY_NOT_AVAILABLE;
else if (callee->local.redefined_extern_inline)
e->inline_failed = CIF_REDEFINED_EXTERN_INLINE;
struct ipa_node_params *parms_info,
struct inline_summary *summary)
{
- struct function *my_function = DECL_STRUCT_FUNCTION (node->symbol.decl);
+ struct function *my_function = DECL_STRUCT_FUNCTION (node->decl);
bool done = false;
basic_block bb;
<0,2>. */
basic_block bb;
gimple_stmt_iterator bsi;
- struct function *my_function = DECL_STRUCT_FUNCTION (node->symbol.decl);
+ struct function *my_function = DECL_STRUCT_FUNCTION (node->decl);
int freq;
struct inline_summary *info = inline_summary (node);
struct predicate bb_predicate;
for (n = 0; n < nblocks; n++)
{
bb = BASIC_BLOCK (order[n]);
- freq = compute_call_stmt_bb_frequency (node->symbol.decl, bb);
+ freq = compute_call_stmt_bb_frequency (node->decl, bb);
/* TODO: Obviously predicates can be propagated down across CFG. */
if (parms_info)
}
/* Even is_gimple_min_invariant rely on current_function_decl. */
- push_cfun (DECL_STRUCT_FUNCTION (node->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
/* Estimate the stack size for the function if we're optimizing. */
self_stack_size = optimize ? estimated_stack_frame_size (node) : 0;
/* Can this function be inlined at all? */
if (!optimize && !lookup_attribute ("always_inline",
- DECL_ATTRIBUTES (node->symbol.decl)))
+ DECL_ATTRIBUTES (node->decl)))
info->inlinable = false;
else
- info->inlinable = tree_inlinable_function_p (node->symbol.decl);
+ info->inlinable = tree_inlinable_function_p (node->decl);
/* Type attributes can use parameter indices to describe them. */
- if (TYPE_ATTRIBUTES (TREE_TYPE (node->symbol.decl)))
+ if (TYPE_ATTRIBUTES (TREE_TYPE (node->decl)))
node->local.can_change_signature = false;
else
{
/* Functions calling builtin_apply can not change signature. */
for (e = node->callees; e; e = e->next_callee)
{
- tree cdecl = e->callee->symbol.decl;
+ tree cdecl = e->callee->decl;
if (DECL_BUILT_IN (cdecl)
&& DECL_BUILT_IN_CLASS (cdecl) == BUILT_IN_NORMAL
&& (DECL_FUNCTION_CODE (cdecl) == BUILT_IN_APPLY_ARGS
gcc_checking_assert (*size >= 0);
callee = cgraph_get_node (target);
- if (!callee || !callee->symbol.definition)
+ if (!callee || !callee->definition)
return false;
isummary = inline_summary (callee);
return isummary->inlinable;
bool found = false;
fprintf (dump_file, " Estimating body: %s/%i\n"
" Known to be false: ", cgraph_node_name (node),
- node->symbol.order);
+ node->order);
for (i = predicate_not_inlined_condition;
i < (predicate_first_dynamic_condition
hints |= INLINE_HINT_array_index;
if (info->scc_no)
hints |= INLINE_HINT_in_scc;
- if (DECL_DECLARED_INLINE_P (node->symbol.decl))
+ if (DECL_DECLARED_INLINE_P (node->decl))
hints |= INLINE_HINT_declared_inline;
estimate_calls_size_and_time (node, &size, &time, &hints, possible_truths,
&& !cgraph_edge_recursive_p (edge))
hints |= INLINE_HINT_same_scc;
- if (to->symbol.lto_file_data && edge->callee->symbol.lto_file_data
- && to->symbol.lto_file_data != edge->callee->symbol.lto_file_data)
+ if (to->lto_file_data && edge->callee->lto_file_data
+ && to->lto_file_data != edge->callee->lto_file_data)
hints |= INLINE_HINT_cross_module;
return hints;
return zero or negative growths. */
if (d.self_recursive)
d.growth = d.growth < info->size ? info->size : d.growth;
- else if (DECL_EXTERNAL (node->symbol.decl))
+ else if (DECL_EXTERNAL (node->decl))
;
else
{
/* COMDAT functions are very often not shared across multiple units
since they come from various template instantiations.
Take this into account. */
- else if (DECL_COMDAT (node->symbol.decl)
+ else if (DECL_COMDAT (node->decl)
&& cgraph_can_remove_if_no_direct_calls_p (node))
d.growth -= (info->size
* (100 - PARAM_VALUE (PARAM_COMDAT_SHARING_PROBABILITY))
static void
inline_analyze_function (struct cgraph_node *node)
{
- push_cfun (DECL_STRUCT_FUNCTION (node->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
if (dump_file)
fprintf (dump_file, "\nAnalyzing function: %s/%u\n",
- cgraph_node_name (node), node->symbol.order);
+ cgraph_node_name (node), node->order);
if (optimize && !node->thunk.thunk_p)
inline_indirect_intraprocedural_analysis (node);
compute_inline_parameters (node, false);
inline_free_summary ();
FOR_EACH_DEFINED_FUNCTION (node)
- if (!node->symbol.alias)
+ if (!node->alias)
inline_analyze_function (node);
}
{
symtab_node snode = lto_symtab_encoder_deref (encoder, i);
cgraph_node *cnode = dyn_cast <cgraph_node> (snode);
- if (cnode && cnode->symbol.definition && !cnode->symbol.alias)
+ if (cnode && cnode->definition && !cnode->alias)
count++;
}
streamer_write_uhwi (ob, count);
{
symtab_node snode = lto_symtab_encoder_deref (encoder, i);
cgraph_node *cnode = dyn_cast <cgraph_node> (snode);
- if (cnode && (node = cnode)->symbol.definition && !node->symbol.alias)
+ if (cnode && (node = cnode)->definition && !node->alias)
{
struct inline_summary *info = inline_summary (node);
struct bitpack_d bp;
streamer_write_uhwi (ob,
lto_symtab_encoder_encode (encoder,
- (symtab_node)
+
node));
streamer_write_hwi (ob, info->estimated_self_stack_size);
streamer_write_hwi (ob, info->self_size);
/* FIXME: When address is taken of DECL_EXTERNAL function we still
can remove its offline copy, but we would need to keep unanalyzed node in
the callgraph so references can point to it. */
- return (!node->symbol.address_taken
- && !ipa_ref_has_aliases_p (&node->symbol.ref_list)
+ return (!node->address_taken
+ && !ipa_ref_has_aliases_p (&node->ref_list)
&& !node->used_as_abstract_origin
&& cgraph_can_remove_if_no_direct_calls_p (node)
/* Inlining might enable more devirtualizing, so we want to remove
those only after all devirtualizable virtual calls are processed.
Lacking may edges in callgraph we just preserve them post
inlining. */
- && !DECL_VIRTUAL_P (node->symbol.decl)
+ && !DECL_VIRTUAL_P (node->decl)
/* During early inlining some unanalyzed cgraph nodes might be in the
callgraph and they might reffer the function in question. */
&& !cgraph_new_nodes);
/* When we see same comdat group, we need to be sure that all
items can be removed. */
- if (!node->symbol.same_comdat_group)
+ if (!node->same_comdat_group)
return true;
- for (next = cgraph (node->symbol.same_comdat_group);
- next != node; next = cgraph (next->symbol.same_comdat_group))
+ for (next = cgraph (node->same_comdat_group);
+ next != node; next = cgraph (next->same_comdat_group))
if ((next->callers && next->callers != e)
|| !can_remove_node_now_p_1 (next))
return false;
For now we keep the ohter functions in the group in program until
cgraph_remove_unreachable_functions gets rid of them. */
gcc_assert (!e->callee->global.inlined_to);
- symtab_dissolve_same_comdat_group_list ((symtab_node) e->callee);
- if (e->callee->symbol.definition && !DECL_EXTERNAL (e->callee->symbol.decl))
+ symtab_dissolve_same_comdat_group_list (e->callee);
+ if (e->callee->definition && !DECL_EXTERNAL (e->callee->decl))
{
if (overall_size)
*overall_size -= inline_summary (e->callee)->size;
nfunctions_inlined++;
}
duplicate = false;
- e->callee->symbol.externally_visible = false;
+ e->callee->externally_visible = false;
update_noncloned_frequencies (e->callee, e->frequency);
}
else
{
struct cgraph_node *n;
- n = cgraph_clone_node (e->callee, e->callee->symbol.decl,
+ n = cgraph_clone_node (e->callee, e->callee->decl,
e->count, e->frequency, update_original,
vNULL, true, inlining_into);
cgraph_redirect_edge_callee (e, n);
}
}
else
- symtab_dissolve_same_comdat_group_list ((symtab_node) e->callee);
+ symtab_dissolve_same_comdat_group_list (e->callee);
e->callee->global.inlined_to = inlining_into;
gcc_assert (!callee->global.inlined_to);
e->inline_failed = CIF_OK;
- DECL_POSSIBLY_INLINED (callee->symbol.decl) = true;
+ DECL_POSSIBLY_INLINED (callee->decl) = true;
to = e->caller;
if (to->global.inlined_to)
/* Account the change of overall unit size; external functions will be
removed and are thus not accounted. */
if (overall_size
- && !DECL_EXTERNAL (to->symbol.decl))
+ && !DECL_EXTERNAL (to->decl))
*overall_size += new_size - old_size;
ncalls_inlined++;
fprintf (dump_file, "\nSaving body of %s for later reuse\n",
cgraph_node_name (node));
- gcc_assert (node == cgraph_get_node (node->symbol.decl));
+ gcc_assert (node == cgraph_get_node (node->decl));
/* first_clone will be turned into real function. */
first_clone = node->clones;
- first_clone->symbol.decl = copy_node (node->symbol.decl);
- symtab_insert_node_to_hashtable ((symtab_node) first_clone);
- gcc_assert (first_clone == cgraph_get_node (first_clone->symbol.decl));
+ first_clone->decl = copy_node (node->decl);
+ symtab_insert_node_to_hashtable (first_clone);
+ gcc_assert (first_clone == cgraph_get_node (first_clone->decl));
/* Now reshape the clone tree, so all other clones descends from
first_clone. */
if (first_clone->clones)
for (n = first_clone->clones; n != first_clone;)
{
- gcc_assert (n->symbol.decl == node->symbol.decl);
- n->symbol.decl = first_clone->symbol.decl;
+ gcc_assert (n->decl == node->decl);
+ n->decl = first_clone->decl;
if (n->clones)
n = n->clones;
else if (n->next_sibling_clone)
}
/* Copy the OLD_VERSION_NODE function tree to the new version. */
- tree_function_versioning (node->symbol.decl, first_clone->symbol.decl,
+ tree_function_versioning (node->decl, first_clone->decl,
NULL, true, NULL, false,
NULL, NULL);
/* The function will be short lived and removed after we inline all the clones,
but make it internal so we won't confuse ourself. */
- DECL_EXTERNAL (first_clone->symbol.decl) = 0;
- DECL_COMDAT_GROUP (first_clone->symbol.decl) = NULL_TREE;
- TREE_PUBLIC (first_clone->symbol.decl) = 0;
- DECL_COMDAT (first_clone->symbol.decl) = 0;
+ DECL_EXTERNAL (first_clone->decl) = 0;
+ DECL_COMDAT_GROUP (first_clone->decl) = NULL_TREE;
+ TREE_PUBLIC (first_clone->decl) = 0;
+ DECL_COMDAT (first_clone->decl) = 0;
first_clone->ipa_transforms_to_apply.release ();
/* When doing recursive inlining, the clone may become unnecessary.
preserve_function_body_p (struct cgraph_node *node)
{
gcc_assert (cgraph_global_info_ready);
- gcc_assert (!node->symbol.alias && !node->thunk.thunk_p);
+ gcc_assert (!node->alias && !node->thunk.thunk_p);
/* Look if there is any clone around. */
if (node->clones)
next = e->next_callee;
cgraph_redirect_edge_call_stmt_to_callee (e);
}
- ipa_remove_all_references (&node->symbol.ref_list);
+ ipa_remove_all_references (&node->ref_list);
timevar_push (TV_INTEGRATION);
if (node->callees && optimize)
if (dump_file)
{
fprintf (dump_file, " not inlinable: %s/%i -> %s/%i, %s\n",
- xstrdup (cgraph_node_name (e->caller)), e->caller->symbol.order,
- xstrdup (cgraph_node_name (e->callee)), e->callee->symbol.order,
+ xstrdup (cgraph_node_name (e->caller)), e->caller->order,
+ xstrdup (cgraph_node_name (e->callee)), e->callee->order,
cgraph_inline_failed_string (e->inline_failed));
}
}
enum availability avail;
struct cgraph_node *callee
= cgraph_function_or_thunk_node (e->callee, &avail);
- tree caller_tree = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (e->caller->symbol.decl);
+ tree caller_tree = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (e->caller->decl);
tree callee_tree
- = callee ? DECL_FUNCTION_SPECIFIC_OPTIMIZATION (callee->symbol.decl) : NULL;
- struct function *caller_cfun = DECL_STRUCT_FUNCTION (e->caller->symbol.decl);
+ = callee ? DECL_FUNCTION_SPECIFIC_OPTIMIZATION (callee->decl) : NULL;
+ struct function *caller_cfun = DECL_STRUCT_FUNCTION (e->caller->decl);
struct function *callee_cfun
- = callee ? DECL_STRUCT_FUNCTION (callee->symbol.decl) : NULL;
+ = callee ? DECL_STRUCT_FUNCTION (callee->decl) : NULL;
if (!caller_cfun && e->caller->clone_of)
- caller_cfun = DECL_STRUCT_FUNCTION (e->caller->clone_of->symbol.decl);
+ caller_cfun = DECL_STRUCT_FUNCTION (e->caller->clone_of->decl);
if (!callee_cfun && callee && callee->clone_of)
- callee_cfun = DECL_STRUCT_FUNCTION (callee->clone_of->symbol.decl);
+ callee_cfun = DECL_STRUCT_FUNCTION (callee->clone_of->decl);
gcc_assert (e->inline_failed);
- if (!callee || !callee->symbol.definition)
+ if (!callee || !callee->definition)
{
e->inline_failed = CIF_BODY_NOT_AVAILABLE;
inlinable = false;
inlinable = false;
}
/* Don't inline if the functions have different EH personalities. */
- else if (DECL_FUNCTION_PERSONALITY (e->caller->symbol.decl)
- && DECL_FUNCTION_PERSONALITY (callee->symbol.decl)
- && (DECL_FUNCTION_PERSONALITY (e->caller->symbol.decl)
- != DECL_FUNCTION_PERSONALITY (callee->symbol.decl)))
+ else if (DECL_FUNCTION_PERSONALITY (e->caller->decl)
+ && DECL_FUNCTION_PERSONALITY (callee->decl)
+ && (DECL_FUNCTION_PERSONALITY (e->caller->decl)
+ != DECL_FUNCTION_PERSONALITY (callee->decl)))
{
e->inline_failed = CIF_EH_PERSONALITY;
inlinable = false;
}
/* TM pure functions should not be inlined into non-TM_pure
functions. */
- else if (is_tm_pure (callee->symbol.decl)
- && !is_tm_pure (e->caller->symbol.decl))
+ else if (is_tm_pure (callee->decl)
+ && !is_tm_pure (e->caller->decl))
{
e->inline_failed = CIF_UNSPECIFIED;
inlinable = false;
inlinable = false;
}
/* Check compatibility of target optimization options. */
- else if (!targetm.target_option.can_inline_p (e->caller->symbol.decl,
- callee->symbol.decl))
+ else if (!targetm.target_option.can_inline_p (e->caller->decl,
+ callee->decl))
{
e->inline_failed = CIF_TARGET_OPTION_MISMATCH;
inlinable = false;
}
/* Check if caller growth allows the inlining. */
- else if (!DECL_DISREGARD_INLINE_LIMITS (callee->symbol.decl)
+ else if (!DECL_DISREGARD_INLINE_LIMITS (callee->decl)
&& !disregard_limits
&& !lookup_attribute ("flatten",
DECL_ATTRIBUTES
(e->caller->global.inlined_to
- ? e->caller->global.inlined_to->symbol.decl
- : e->caller->symbol.decl))
+ ? e->caller->global.inlined_to->decl
+ : e->caller->decl))
&& !caller_growth_limits (e))
inlinable = false;
/* Don't inline a function with a higher optimization level than the
if (((caller_opt->x_optimize > callee_opt->x_optimize)
|| (caller_opt->x_optimize_size != callee_opt->x_optimize_size))
/* gcc.dg/pr43564.c. Look at forced inline even in -O0. */
- && !DECL_DISREGARD_INLINE_LIMITS (e->callee->symbol.decl))
+ && !DECL_DISREGARD_INLINE_LIMITS (e->callee->decl))
{
e->inline_failed = CIF_OPTIMIZATION_MISMATCH;
inlinable = false;
/* Early inliner might get called at WPA stage when IPA pass adds new
function. In this case we can not really do any of early inlining
because function bodies are missing. */
- if (!gimple_has_body_p (callee->symbol.decl))
+ if (!gimple_has_body_p (callee->decl))
{
e->inline_failed = CIF_BODY_NOT_AVAILABLE;
return false;
(i.e. the callgraph is cyclic and we did not process
the callee by early inliner, yet). We don't have CIF code for this
case; later we will re-do the decision in the real inliner. */
- if (!gimple_in_ssa_p (DECL_STRUCT_FUNCTION (e->caller->symbol.decl))
- || !gimple_in_ssa_p (DECL_STRUCT_FUNCTION (callee->symbol.decl)))
+ if (!gimple_in_ssa_p (DECL_STRUCT_FUNCTION (e->caller->decl))
+ || !gimple_in_ssa_p (DECL_STRUCT_FUNCTION (callee->decl)))
{
if (dump_file)
fprintf (dump_file, " edge not inlinable: not in SSA form\n");
int num = 0;
for (e = n->callees; e; e = e->next_callee)
- if (!is_inexpensive_builtin (e->callee->symbol.decl))
+ if (!is_inexpensive_builtin (e->callee->decl))
num++;
return num;
}
bool want_inline = true;
struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, NULL);
- if (DECL_DISREGARD_INLINE_LIMITS (callee->symbol.decl))
+ if (DECL_DISREGARD_INLINE_LIMITS (callee->decl))
;
- else if (!DECL_DECLARED_INLINE_P (callee->symbol.decl)
+ else if (!DECL_DECLARED_INLINE_P (callee->decl)
&& !flag_inline_small_functions)
{
e->inline_failed = CIF_FUNCTION_NOT_INLINE_CANDIDATE;
fprintf (dump_file, " will not early inline: %s/%i->%s/%i, "
"call is cold and code would grow by %i\n",
xstrdup (cgraph_node_name (e->caller)),
- e->caller->symbol.order,
- xstrdup (cgraph_node_name (callee)), callee->symbol.order,
+ e->caller->order,
+ xstrdup (cgraph_node_name (callee)), callee->order,
growth);
want_inline = false;
}
fprintf (dump_file, " will not early inline: %s/%i->%s/%i, "
"growth %i exceeds --param early-inlining-insns\n",
xstrdup (cgraph_node_name (e->caller)),
- e->caller->symbol.order,
- xstrdup (cgraph_node_name (callee)), callee->symbol.order,
+ e->caller->order,
+ xstrdup (cgraph_node_name (callee)), callee->order,
growth);
want_inline = false;
}
"growth %i exceeds --param early-inlining-insns "
"divided by number of calls\n",
xstrdup (cgraph_node_name (e->caller)),
- e->caller->symbol.order,
- xstrdup (cgraph_node_name (callee)), callee->symbol.order,
+ e->caller->order,
+ xstrdup (cgraph_node_name (callee)), callee->order,
growth);
want_inline = false;
}
bool want_inline = true;
struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, NULL);
- if (DECL_DISREGARD_INLINE_LIMITS (callee->symbol.decl))
+ if (DECL_DISREGARD_INLINE_LIMITS (callee->decl))
;
- else if (!DECL_DECLARED_INLINE_P (callee->symbol.decl)
+ else if (!DECL_DECLARED_INLINE_P (callee->decl)
&& !flag_inline_small_functions)
{
e->inline_failed = CIF_FUNCTION_NOT_INLINE_CANDIDATE;
;
/* Apply MAX_INLINE_INSNS_SINGLE limit. Do not do so when
hints suggests that inlining given function is very profitable. */
- else if (DECL_DECLARED_INLINE_P (callee->symbol.decl)
+ else if (DECL_DECLARED_INLINE_P (callee->decl)
&& growth >= MAX_INLINE_INSNS_SINGLE
&& !big_speedup
&& !(hints & (INLINE_HINT_indirect_call
Consequently we ask cgraph_can_remove_if_no_direct_calls_p
instead of
cgraph_will_be_removed_from_program_if_no_direct_calls */
- && !DECL_EXTERNAL (callee->symbol.decl)
+ && !DECL_EXTERNAL (callee->decl)
&& cgraph_can_remove_if_no_direct_calls_p (callee)
&& estimate_growth (callee) <= 0)
;
- else if (!DECL_DECLARED_INLINE_P (callee->symbol.decl)
+ else if (!DECL_DECLARED_INLINE_P (callee->decl)
&& !flag_inline_functions)
{
e->inline_failed = CIF_NOT_DECLARED_INLINED;
/* Apply MAX_INLINE_INSNS_AUTO limit for functions not declared inline
Upgrade it to MAX_INLINE_INSNS_SINGLE when hints suggests that
inlining given function is very profitable. */
- else if (!DECL_DECLARED_INLINE_P (callee->symbol.decl)
+ else if (!DECL_DECLARED_INLINE_P (callee->decl)
&& !big_speedup
&& growth >= ((hints & (INLINE_HINT_indirect_call
| INLINE_HINT_loop_iterations
int caller_freq = CGRAPH_FREQ_BASE;
int max_depth = PARAM_VALUE (PARAM_MAX_INLINE_RECURSIVE_DEPTH_AUTO);
- if (DECL_DECLARED_INLINE_P (edge->caller->symbol.decl))
+ if (DECL_DECLARED_INLINE_P (edge->caller->decl))
max_depth = PARAM_VALUE (PARAM_MAX_INLINE_RECURSIVE_DEPTH);
if (!cgraph_maybe_hot_edge_p (edge))
/* Inlining into extern inline function is not a win. */
if (DECL_EXTERNAL (edge->caller->global.inlined_to
- ? edge->caller->global.inlined_to->symbol.decl
- : edge->caller->symbol.decl))
+ ? edge->caller->global.inlined_to->decl
+ : edge->caller->decl))
return 1;
/* Watch overflows. */
struct inline_summary *callee_info = inline_summary (callee);
inline_hints hints;
- if (DECL_DISREGARD_INLINE_LIMITS (callee->symbol.decl))
+ if (DECL_DISREGARD_INLINE_LIMITS (callee->decl))
return INT_MIN;
growth = estimate_edge_growth (edge);
{
fprintf (dump_file, " Badness calculation for %s/%i -> %s/%i\n",
xstrdup (cgraph_node_name (edge->caller)),
- edge->caller->symbol.order,
+ edge->caller->order,
xstrdup (cgraph_node_name (callee)),
- edge->callee->symbol.order);
+ edge->callee->order);
fprintf (dump_file, " size growth %i, time %i ",
growth,
edge_time);
fprintf (dump_file,
" decreasing badness %s/%i -> %s/%i, %i to %i\n",
xstrdup (cgraph_node_name (edge->caller)),
- edge->caller->symbol.order,
+ edge->caller->order,
xstrdup (cgraph_node_name (edge->callee)),
- edge->callee->symbol.order,
+ edge->callee->order,
(int)n->key,
badness);
}
fprintf (dump_file,
" enqueuing call %s/%i -> %s/%i, badness %i\n",
xstrdup (cgraph_node_name (edge->caller)),
- edge->caller->symbol.order,
+ edge->caller->order,
xstrdup (cgraph_node_name (edge->callee)),
- edge->callee->symbol.order,
+ edge->callee->order,
badness);
}
edge->aux = fibheap_insert (heap, badness, edge);
for (edge = where->callers; edge; edge = edge->next_caller)
if (edge->inline_failed)
reset_edge_growth_cache (edge);
- for (i = 0; ipa_ref_list_referring_iterate (&where->symbol.ref_list,
+ for (i = 0; ipa_ref_list_referring_iterate (&where->ref_list,
i, ref); i++)
if (ref->use == IPA_REF_ALIAS)
reset_edge_caches (ipa_ref_referring_node (ref));
int i;
struct ipa_ref *ref;
- if ((!node->symbol.alias && !inline_summary (node)->inlinable)
+ if ((!node->alias && !inline_summary (node)->inlinable)
|| node->global.inlined_to)
return;
if (!bitmap_set_bit (updated_nodes, node->uid))
return;
- for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list,
+ for (i = 0; ipa_ref_list_referring_iterate (&node->ref_list,
i, ref); i++)
if (ref->use == IPA_REF_ALIAS)
{
if (node->global.inlined_to)
node = node->global.inlined_to;
- if (DECL_DECLARED_INLINE_P (node->symbol.decl))
+ if (DECL_DECLARED_INLINE_P (node->decl))
limit = PARAM_VALUE (PARAM_MAX_INLINE_INSNS_RECURSIVE);
/* Make sure that function is small enough to be considered for inlining. */
depth = 1;
for (cnode = curr->caller;
cnode->global.inlined_to; cnode = cnode->callers->caller)
- if (node->symbol.decl
- == cgraph_function_or_thunk_node (curr->callee, NULL)->symbol.decl)
+ if (node->decl
+ == cgraph_function_or_thunk_node (curr->callee, NULL)->decl)
depth++;
if (!want_inline_self_recursive_call_p (curr, node, false, depth))
if (!master_clone)
{
/* We need original clone to copy around. */
- master_clone = cgraph_clone_node (node, node->symbol.decl,
+ master_clone = cgraph_clone_node (node, node->decl,
node->count, CGRAPH_FREQ_BASE,
false, vNULL, true, NULL);
for (e = master_clone->callees; e; e = e->next_callee)
else we propagate is useless. */
if (avail >= AVAIL_AVAILABLE)
{
- int ecf_flags = flags_from_decl_or_type (target->symbol.decl);
+ int ecf_flags = flags_from_decl_or_type (target->decl);
if (ecf_flags & ECF_CONST)
{
cgraph_speculative_call_info (e, direct, indirect, ref);
|| node->thunk.thunk_p)
{
struct inline_summary *info = inline_summary (node);
- struct ipa_dfs_info *dfs = (struct ipa_dfs_info *) node->symbol.aux;
+ struct ipa_dfs_info *dfs = (struct ipa_dfs_info *) node->aux;
- if (!DECL_EXTERNAL (node->symbol.decl))
+ if (!DECL_EXTERNAL (node->decl))
initial_size += info->size;
info->growth = estimate_growth (node);
if (dfs && dfs->next_cycle)
struct cgraph_node *n2;
int id = dfs->scc_no + 1;
for (n2 = node; n2;
- n2 = ((struct ipa_dfs_info *) node->symbol.aux)->next_cycle)
+ n2 = ((struct ipa_dfs_info *) node->aux)->next_cycle)
{
struct inline_summary *info2 = inline_summary (n2);
if (info2->scc_no)
if (dump_file)
fprintf (dump_file, "Enqueueing calls in %s/%i.\n",
- cgraph_node_name (node), node->symbol.order);
+ cgraph_node_name (node), node->order);
for (edge = node->callees; edge; edge = next)
{
{
fprintf (dump_file,
"\nConsidering %s/%i with %i size\n",
- cgraph_node_name (callee), callee->symbol.order,
+ cgraph_node_name (callee), callee->order,
inline_summary (callee)->size);
fprintf (dump_file,
" to be inlined into %s/%i in %s:%i\n"
" Estimated growth after inlined into all is %+i insns.\n"
" Estimated badness is %i, frequency %.2f.\n",
- cgraph_node_name (edge->caller), edge->caller->symbol.order,
+ cgraph_node_name (edge->caller), edge->caller->order,
flag_wpa ? "unknown"
: gimple_filename ((const_gimple) edge->call_stmt),
flag_wpa ? -1
}
if (overall_size + growth > max_size
- && !DECL_DISREGARD_INLINE_LIMITS (callee->symbol.decl))
+ && !DECL_DISREGARD_INLINE_LIMITS (callee->decl))
{
edge->inline_failed = CIF_INLINE_UNIT_GROWTH_LIMIT;
report_inline_failed_reason (edge);
where = edge->caller;
while (where->global.inlined_to)
{
- if (where->symbol.decl == callee->symbol.decl)
+ if (where->decl == callee->decl)
outer_node = where, depth++;
where = where->callers->caller;
}
true, depth))
{
edge->inline_failed
- = (DECL_DISREGARD_INLINE_LIMITS (edge->callee->symbol.decl)
+ = (DECL_DISREGARD_INLINE_LIMITS (edge->callee->decl)
? CIF_RECURSIVE_INLINING : CIF_UNSPECIFIED);
resolve_noninline_speculation (edge_heap, edge);
continue;
struct cgraph_edge *e;
/* We shouldn't be called recursively when we are being processed. */
- gcc_assert (node->symbol.aux == NULL);
+ gcc_assert (node->aux == NULL);
- node->symbol.aux = (void *) node;
+ node->aux = (void *) node;
for (e = node->callees; e; e = e->next_callee)
{
struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, NULL);
/* We've hit cycle? It is time to give up. */
- if (callee->symbol.aux)
+ if (callee->aux)
{
if (dump_file)
fprintf (dump_file,
continue;
}
- if (gimple_in_ssa_p (DECL_STRUCT_FUNCTION (node->symbol.decl))
- != gimple_in_ssa_p (DECL_STRUCT_FUNCTION (callee->symbol.decl)))
+ if (gimple_in_ssa_p (DECL_STRUCT_FUNCTION (node->decl))
+ != gimple_in_ssa_p (DECL_STRUCT_FUNCTION (callee->decl)))
{
if (dump_file)
fprintf (dump_file, "Not inlining: SSA form does not match.\n");
orig_callee = callee;
inline_call (e, true, NULL, NULL, false);
if (e->callee != orig_callee)
- orig_callee->symbol.aux = (void *) node;
+ orig_callee->aux = (void *) node;
flatten_function (e->callee, early);
if (e->callee != orig_callee)
- orig_callee->symbol.aux = NULL;
+ orig_callee->aux = NULL;
}
- node->symbol.aux = NULL;
+ node->aux = NULL;
if (!node->global.inlined_to)
inline_update_overall_summary (node);
}
nnodes = ipa_reverse_postorder (order);
FOR_EACH_FUNCTION (node)
- node->symbol.aux = 0;
+ node->aux = 0;
if (dump_file)
fprintf (dump_file, "\nFlattening functions:\n");
try to flatten itself turning it into a self-recursive
function. */
if (lookup_attribute ("flatten",
- DECL_ATTRIBUTES (node->symbol.decl)) != NULL)
+ DECL_ATTRIBUTES (node->decl)) != NULL)
{
if (dump_file)
fprintf (dump_file,
for (e = node->callees; e; e = e->next_callee)
{
struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, NULL);
- if (!DECL_DISREGARD_INLINE_LIMITS (callee->symbol.decl))
+ if (!DECL_DISREGARD_INLINE_LIMITS (callee->decl))
continue;
if (cgraph_edge_recursive_p (e))
is not inlinable. This will allow flagging an error later in
expand_call_inline in tree-inline.c. */
if (lookup_attribute ("always_inline",
- DECL_ATTRIBUTES (callee->symbol.decl)) != NULL)
+ DECL_ATTRIBUTES (callee->decl)) != NULL)
inlined = true;
continue;
}
continue;
/* Do not consider functions not declared inline. */
- if (!DECL_DECLARED_INLINE_P (callee->symbol.decl)
+ if (!DECL_DECLARED_INLINE_P (callee->decl)
&& !flag_inline_small_functions
&& !flag_inline_functions)
continue;
#ifdef ENABLE_CHECKING
verify_cgraph_node (node);
#endif
- ipa_remove_all_references (&node->symbol.ref_list);
+ ipa_remove_all_references (&node->ref_list);
/* Even when not optimizing or not inlining inline always-inline
functions. */
cycles of edges to be always inlined in the callgraph.
We might want to be smarter and just avoid this type of inlining. */
- || DECL_DISREGARD_INLINE_LIMITS (node->symbol.decl))
+ || DECL_DISREGARD_INLINE_LIMITS (node->decl))
;
else if (lookup_attribute ("flatten",
- DECL_ATTRIBUTES (node->symbol.decl)) != NULL)
+ DECL_ATTRIBUTES (node->decl)) != NULL)
{
/* When the function is marked to be flattened, recursively inline
all calls in it. */
= estimate_num_insns (edge->call_stmt, &eni_size_weights);
es->call_stmt_time
= estimate_num_insns (edge->call_stmt, &eni_time_weights);
- if (edge->callee->symbol.decl
+ if (edge->callee->decl
&& !gimple_check_call_matching_types (
- edge->call_stmt, edge->callee->symbol.decl, false))
+ edge->call_stmt, edge->callee->decl, false))
edge->call_stmt_cannot_inline_p = true;
}
timevar_pop (TV_INTEGRATION);
10);
FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
- FOR_EACH_BB_FN (bb, DECL_STRUCT_FUNCTION (node->symbol.decl))
+ FOR_EACH_BB_FN (bb, DECL_STRUCT_FUNCTION (node->decl))
{
int time = 0;
int size = 0;
{
histogram_value h;
h = gimple_histogram_value_of_type
- (DECL_STRUCT_FUNCTION (node->symbol.decl),
+ (DECL_STRUCT_FUNCTION (node->decl),
stmt, HIST_TYPE_INDIR_CALL);
/* No need to do sanity check: gimple_ic_transform already
takes away bad histograms. */
e->indirect_info->common_target_probability = REG_BR_PROB_BASE;
}
}
- gimple_remove_histogram_value (DECL_STRUCT_FUNCTION (node->symbol.decl),
+ gimple_remove_histogram_value (DECL_STRUCT_FUNCTION (node->decl),
stmt, h);
}
}
/* It makes sense to put main() together with the static constructors.
It will be executed for sure, but rest of functions called from
main are definitely not at startup only. */
- if (MAIN_NAME_P (DECL_NAME (edge->caller->symbol.decl)))
+ if (MAIN_NAME_P (DECL_NAME (edge->caller->decl)))
d->only_called_at_startup = 0;
d->only_called_at_exit &= edge->caller->only_called_at_exit;
}
/* We can not propagate anything useful about externally visible functions
nor about virtuals. */
if (!node->local.local
- || node->symbol.alias
- || (flag_devirtualize && DECL_VIRTUAL_P (node->symbol.decl)))
+ || node->alias
+ || (flag_devirtualize && DECL_VIRTUAL_P (node->decl)))
return false;
- gcc_assert (node->symbol.analyzed);
+ gcc_assert (node->analyzed);
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "Processing frequency %s\n", cgraph_node_name (node));
{
fprintf (dump_file, "Indirect call -> direct call from"
" other module %s/%i => %s/%i, prob %3.2f\n",
- xstrdup (cgraph_node_name (n)), n->symbol.order,
- xstrdup (cgraph_node_name (n2)), n2->symbol.order,
+ xstrdup (cgraph_node_name (n)), n->order,
+ xstrdup (cgraph_node_name (n2)), n2->order,
e->indirect_info->common_target_probability
/ (float)REG_BR_PROB_BASE);
}
}
else if (cgraph_function_body_availability (n2)
<= AVAIL_OVERWRITABLE
- && symtab_can_be_discarded ((symtab_node) n2))
+ && symtab_can_be_discarded (n2))
{
nuseless++;
if (dump_file)
control flow goes to this particular implementation
of N2. Speculate on the local alias to allow inlining.
*/
- if (!symtab_can_be_discarded ((symtab_node) n2))
+ if (!symtab_can_be_discarded (n2))
{
cgraph_node *alias;
alias = cgraph (symtab_nonoverwritable_alias
- ((symtab_node)n2));
+ (n2));
if (alias)
n2 = alias;
}
if (order[i]->local.local && ipa_propagate_frequency (order[i]))
{
for (e = order[i]->callees; e; e = e->next_callee)
- if (e->callee->local.local && !e->callee->symbol.aux)
+ if (e->callee->local.local && !e->callee->aux)
{
something_changed = true;
- e->callee->symbol.aux = (void *)1;
+ e->callee->aux = (void *)1;
}
}
- order[i]->symbol.aux = NULL;
+ order[i]->aux = NULL;
}
while (something_changed)
something_changed = false;
for (i = order_pos - 1; i >= 0; i--)
{
- if (order[i]->symbol.aux && ipa_propagate_frequency (order[i]))
+ if (order[i]->aux && ipa_propagate_frequency (order[i]))
{
for (e = order[i]->callees; e; e = e->next_callee)
- if (e->callee->local.local && !e->callee->symbol.aux)
+ if (e->callee->local.local && !e->callee->aux)
{
something_changed = true;
- e->callee->symbol.aux = (void *)1;
+ e->callee->aux = (void *)1;
}
}
- order[i]->symbol.aux = NULL;
+ order[i]->aux = NULL;
}
}
free (order);
static bool
ipa_func_spec_opts_forbid_analysis_p (struct cgraph_node *node)
{
- tree fs_opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (node->symbol.decl);
+ tree fs_opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (node->decl);
struct cl_optimization *os;
if (!fs_opts)
tree parm;
int param_num;
- fndecl = node->symbol.decl;
+ fndecl = node->decl;
gcc_assert (gimple_has_body_p (fndecl));
fnargs = DECL_ARGUMENTS (fndecl);
param_num = 0;
if (!info->descriptors.exists ())
{
- ipa_alloc_node_params (node, count_formal_params (node->symbol.decl));
+ ipa_alloc_node_params (node, count_formal_params (node->decl));
ipa_populate_param_decls (node, info->descriptors);
}
}
struct cgraph_edge *cs;
fprintf (f, " Jump functions of caller %s/%i:\n", cgraph_node_name (node),
- node->symbol.order);
+ node->order);
for (cs = node->callees; cs; cs = cs->next_callee)
{
if (!ipa_edge_args_info_available_for_edge_p (cs))
continue;
fprintf (f, " callsite %s/%i -> %s/%i : \n",
- xstrdup (cgraph_node_name (node)), node->symbol.order,
+ xstrdup (cgraph_node_name (node)), node->order,
xstrdup (cgraph_node_name (cs->callee)),
- cs->callee->symbol.order);
+ cs->callee->order);
ipa_print_node_jump_functions_for_edge (f, cs);
}
{
int n;
tree type = (e->callee
- ? TREE_TYPE (e->callee->symbol.decl)
+ ? TREE_TYPE (e->callee->decl)
: gimple_call_fntype (e->call_stmt));
tree t = TYPE_ARG_TYPES (type);
return TREE_VALUE (t);
if (!e->callee)
return NULL;
- t = DECL_ARGUMENTS (e->callee->symbol.decl);
+ t = DECL_ARGUMENTS (e->callee->decl);
for (n = 0; n < i; n++)
{
if (!t)
NULL);
/* We do not need to bother analyzing calls to unknown
functions unless they may become known during lto/whopr. */
- if (!callee->symbol.definition && !flag_lto)
+ if (!callee->definition && !flag_lto)
continue;
ipa_compute_jump_functions_for_edge (parms_ainfo, cs);
}
ipa_analyze_params_uses (struct cgraph_node *node,
struct param_analysis_info *parms_ainfo)
{
- tree decl = node->symbol.decl;
+ tree decl = node->decl;
basic_block bb;
struct function *func;
gimple_stmt_iterator gsi;
the flag during modification analysis. */
if (is_gimple_reg (parm))
{
- tree ddef = ssa_default_def (DECL_STRUCT_FUNCTION (node->symbol.decl),
+ tree ddef = ssa_default_def (DECL_STRUCT_FUNCTION (node->decl),
parm);
if (ddef && !has_zero_uses (ddef))
{
ipa_check_create_node_params ();
ipa_check_create_edge_args ();
info = IPA_NODE_REF (node);
- push_cfun (DECL_STRUCT_FUNCTION (node->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
ipa_initialize_node_params (node);
param_count = ipa_get_param_count (info);
if (dump_file)
fprintf (dump_file, "ipa-prop: Discovered direct call to non-function"
" in %s/%i, making it unreachable.\n",
- cgraph_node_name (ie->caller), ie->caller->symbol.order);
+ cgraph_node_name (ie->caller), ie->caller->order);
target = builtin_decl_implicit (BUILT_IN_UNREACHABLE);
callee = cgraph_get_create_node (target);
unreachable = true;
fprintf (dump_file, "ipa-prop: Discovered call to a known target "
"(%s/%i -> %s/%i) but can not refer to it. Giving up.\n",
xstrdup (cgraph_node_name (ie->caller)),
- ie->caller->symbol.order,
+ ie->caller->order,
xstrdup (cgraph_node_name (ie->callee)),
- ie->callee->symbol.order);
+ ie->callee->order);
return NULL;
}
callee = cgraph_get_create_real_symbol_node (target);
"(%s/%i -> %s/%i), for stmt ",
ie->indirect_info->polymorphic ? "a virtual" : "an indirect",
xstrdup (cgraph_node_name (ie->caller)),
- ie->caller->symbol.order,
+ ie->caller->order,
xstrdup (cgraph_node_name (callee)),
- callee->symbol.order);
+ callee->order);
if (ie->call_stmt)
print_gimple_stmt (dump_file, ie->call_stmt, 2, TDF_SLIM);
else
origin = rdesc->cs;
if (!origin)
return false;
- to_del = ipa_find_reference ((symtab_node) origin->caller, symbol,
+ to_del = ipa_find_reference (origin->caller, symbol,
origin->call_stmt, origin->lto_stmt_uid);
if (!to_del)
return false;
if (dump_file)
fprintf (dump_file, "ipa-prop: Removed a reference from %s/%i to %s.\n",
xstrdup (cgraph_node_name (origin->caller)),
- origin->caller->symbol.order, xstrdup (symtab_node_name (symbol)));
+ origin->caller->order, xstrdup (symtab_node_name (symbol)));
return true;
}
&& (rdesc = jfunc_rdesc_usable (jfunc))
&& --rdesc->refcount == 0)
{
- symtab_node symbol = (symtab_node) cgraph_node_for_jfunc (jfunc);
+ symtab_node symbol = cgraph_node_for_jfunc (jfunc);
if (!symbol)
return false;
new_direct_edge->call_stmt_cannot_inline_p
= !gimple_check_call_matching_types (
new_direct_edge->call_stmt,
- new_direct_edge->callee->symbol.decl, false);
+ new_direct_edge->callee->decl, false);
if (new_edges)
{
new_edges->safe_push (new_direct_edge);
if (t && TREE_CODE (t) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (t, 0)) == FUNCTION_DECL
&& (n = cgraph_get_node (TREE_OPERAND (t, 0)))
- && (ref = ipa_find_reference ((symtab_node) new_root,
- (symtab_node) n, NULL, 0)))
+ && (ref = ipa_find_reference (new_root,
+ n, NULL, 0)))
{
if (dump_file)
fprintf (dump_file, "ipa-prop: Removing cloning-created "
"reference from %s/%i to %s/%i.\n",
xstrdup (cgraph_node_name (new_root)),
- new_root->symbol.order,
- xstrdup (cgraph_node_name (n)), n->symbol.order);
+ new_root->order,
+ xstrdup (cgraph_node_name (n)), n->order);
ipa_remove_reference (ref);
}
}
{
struct cgraph_node *clone;
bool ok;
- ok = remove_described_reference ((symtab_node) n, rdesc);
+ ok = remove_described_reference (n, rdesc);
gcc_checking_assert (ok);
clone = cs->caller;
&& IPA_NODE_REF (clone)->ipcp_orig_node)
{
struct ipa_ref *ref;
- ref = ipa_find_reference ((symtab_node) clone,
- (symtab_node) n, NULL, 0);
+ ref = ipa_find_reference (clone,
+ n, NULL, 0);
if (ref)
{
if (dump_file)
"cloning-created reference "
"from %s/%i to %s/%i.\n",
xstrdup (cgraph_node_name (clone)),
- clone->symbol.order,
+ clone->order,
xstrdup (cgraph_node_name (n)),
- n->symbol.order);
+ n->order);
ipa_remove_reference (ref);
}
clone = clone->callers->caller;
else if (src->caller == dst->caller)
{
struct ipa_ref *ref;
- symtab_node n = (symtab_node) cgraph_node_for_jfunc (src_jf);
+ symtab_node n = cgraph_node_for_jfunc (src_jf);
gcc_checking_assert (n);
- ref = ipa_find_reference ((symtab_node) src->caller, n,
+ ref = ipa_find_reference (src->caller, n,
src->call_stmt, src->lto_stmt_uid);
gcc_checking_assert (ref);
- ipa_clone_ref (ref, (symtab_node) dst->caller, ref->stmt);
+ ipa_clone_ref (ref, dst->caller, ref->stmt);
gcc_checking_assert (ipa_refdesc_pool);
struct ipa_cst_ref_desc *dst_rdesc
int i, count;
struct ipa_node_params *info;
- if (!node->symbol.definition)
+ if (!node->definition)
return;
info = IPA_NODE_REF (node);
fprintf (f, " function %s/%i parameter descriptors:\n",
- cgraph_node_name (node), node->symbol.order);
+ cgraph_node_name (node), node->order);
count = ipa_get_param_count (info);
for (i = 0; i < count; i++)
{
len = adjustments.length ();
vargs.create (len);
- callee_decl = !cs ? gimple_call_fndecl (stmt) : cs->callee->symbol.decl;
- ipa_remove_stmt_references ((symtab_node) current_node, stmt);
+ callee_decl = !cs ? gimple_call_fndecl (stmt) : cs->callee->decl;
+ ipa_remove_stmt_references (current_node, stmt);
gsi = gsi_for_stmt (stmt);
prev_gsi = gsi;
struct bitpack_d bp;
encoder = ob->decl_state->symtab_node_encoder;
- node_ref = lto_symtab_encoder_encode (encoder, (symtab_node) node);
+ node_ref = lto_symtab_encoder_encode (encoder, node);
streamer_write_uhwi (ob, node_ref);
streamer_write_uhwi (ob, ipa_get_param_count (info));
index = streamer_read_uhwi (&ib_main);
encoder = file_data->symtab_node_encoder;
node = cgraph (lto_symtab_encoder_deref (encoder, index));
- gcc_assert (node->symbol.definition);
+ gcc_assert (node->definition);
ipa_read_node_info (&ib_main, node, data_in);
}
lto_free_section_data (file_data, LTO_section_jump_functions, NULL, data,
aggvals = ipa_get_agg_replacements_for_node (node);
encoder = ob->decl_state->symtab_node_encoder;
- node_ref = lto_symtab_encoder_encode (encoder, (symtab_node) node);
+ node_ref = lto_symtab_encoder_encode (encoder, node);
streamer_write_uhwi (ob, node_ref);
for (av = aggvals; av; av = av->next)
index = streamer_read_uhwi (&ib_main);
encoder = file_data->symtab_node_encoder;
node = cgraph (lto_symtab_encoder_deref (encoder, index));
- gcc_assert (node->symbol.definition);
+ gcc_assert (node->definition);
read_agg_replacement_chain (&ib_main, node, data_in);
}
lto_free_section_data (file_data, LTO_section_jump_functions, NULL, data,
if (dump_file)
fprintf (dump_file, "Modification phase of node %s/%i\n",
- cgraph_node_name (node), node->symbol.order);
+ cgraph_node_name (node), node->order);
aggval = ipa_get_agg_replacements_for_node (node);
if (!aggval)
return 0;
- param_count = count_formal_params (node->symbol.decl);
+ param_count = count_formal_params (node->decl);
if (param_count == 0)
return 0;
adjust_agg_replacement_values (node, aggval);
static funct_state
analyze_function (struct cgraph_node *fn, bool ipa)
{
- tree decl = fn->symbol.decl;
+ tree decl = fn->decl;
funct_state l;
basic_block this_block;
l->looping = false;
l->can_throw = false;
state_from_flags (&l->state_previously_known, &l->looping_previously_known,
- flags_from_decl_or_type (fn->symbol.decl),
+ flags_from_decl_or_type (fn->decl),
cgraph_node_cannot_return (fn));
- if (fn->thunk.thunk_p || fn->symbol.alias)
+ if (fn->thunk.thunk_p || fn->alias)
{
/* Thunk gets propagated through, so nothing interesting happens. */
gcc_assert (ipa);
lsei_next_function_in_partition (&lsei))
{
node = lsei_cgraph_node (lsei);
- if (node->symbol.definition && has_function_state (node))
+ if (node->definition && has_function_state (node))
count++;
}
lsei_next_function_in_partition (&lsei))
{
node = lsei_cgraph_node (lsei);
- if (node->symbol.definition && has_function_state (node))
+ if (node->definition && has_function_state (node))
{
struct bitpack_d bp;
funct_state fs;
fs = get_function_state (node);
encoder = ob->decl_state->symtab_node_encoder;
- node_ref = lto_symtab_encoder_encode (encoder, (symtab_node)node);
+ node_ref = lto_symtab_encoder_encode (encoder, node);
streamer_write_uhwi_stream (ob->main_stream, node_ref);
/* Note that flags will need to be read in the opposite
fs->can_throw = bp_unpack_value (&bp, 1);
if (dump_file)
{
- int flags = flags_from_decl_or_type (node->symbol.decl);
+ int flags = flags_from_decl_or_type (node->decl);
fprintf (dump_file, "Read info for %s/%i ",
cgraph_node_name (node),
- node->symbol.order);
+ node->order);
if (flags & ECF_CONST)
fprintf (dump_file, " const");
if (flags & ECF_PURE)
int count = 0;
node = order[i];
- if (node->symbol.alias)
+ if (node->alias)
continue;
if (dump_file && (dump_flags & TDF_DETAILS))
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, " Visiting %s/%i state:%s looping %i\n",
cgraph_node_name (w),
- w->symbol.order,
+ w->order,
pure_const_names[w_l->pure_const_state],
w_l->looping);
fprintf (dump_file,
" Call to %s/%i",
cgraph_node_name (e->callee),
- e->callee->symbol.order);
+ e->callee->order);
}
if (avail > AVAIL_OVERWRITABLE)
{
}
}
else if (special_builtin_state (&edge_state, &edge_looping,
- y->symbol.decl))
+ y->decl))
;
else
state_from_flags (&edge_state, &edge_looping,
- flags_from_decl_or_type (y->symbol.decl),
+ flags_from_decl_or_type (y->decl),
cgraph_edge_cannot_lead_to_return (e));
/* Merge the results with what we already know. */
break;
/* And finally all loads and stores. */
- for (i = 0; ipa_ref_list_reference_iterate (&w->symbol.ref_list, i, ref); i++)
+ for (i = 0; ipa_ref_list_reference_iterate (&w->ref_list, i, ref); i++)
{
enum pure_const_state_e ref_state = IPA_CONST;
bool ref_looping = false;
{
case IPA_REF_LOAD:
/* readonly reads are safe. */
- if (TREE_READONLY (ipa_ref_varpool_node (ref)->symbol.decl))
+ if (TREE_READONLY (ipa_ref_varpool_node (ref)->decl))
break;
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, " nonreadonly global var read\n");
if (pure_const_state == IPA_NEITHER)
break;
}
- w_info = (struct ipa_dfs_info *) w->symbol.aux;
+ w_info = (struct ipa_dfs_info *) w->aux;
w = w_info->next_cycle;
}
if (dump_file && (dump_flags & TDF_DETAILS))
switch (this_state)
{
case IPA_CONST:
- if (!TREE_READONLY (w->symbol.decl))
+ if (!TREE_READONLY (w->decl))
{
- warn_function_const (w->symbol.decl, !this_looping);
+ warn_function_const (w->decl, !this_looping);
if (dump_file)
fprintf (dump_file, "Function found to be %sconst: %s\n",
this_looping ? "looping " : "",
break;
case IPA_PURE:
- if (!DECL_PURE_P (w->symbol.decl))
+ if (!DECL_PURE_P (w->decl))
{
- warn_function_pure (w->symbol.decl, !this_looping);
+ warn_function_pure (w->decl, !this_looping);
if (dump_file)
fprintf (dump_file, "Function found to be %spure: %s\n",
this_looping ? "looping " : "",
default:
break;
}
- w_info = (struct ipa_dfs_info *) w->symbol.aux;
+ w_info = (struct ipa_dfs_info *) w->aux;
w = w_info->next_cycle;
}
}
bool can_throw = false;
node = order[i];
- if (node->symbol.alias)
+ if (node->alias)
continue;
/* Find the worst state for any node in the cycle. */
if (can_throw)
break;
- if (y_l->can_throw && !TREE_NOTHROW (w->symbol.decl)
+ if (y_l->can_throw && !TREE_NOTHROW (w->decl)
&& e->can_throw_external)
can_throw = true;
}
- else if (e->can_throw_external && !TREE_NOTHROW (y->symbol.decl))
+ else if (e->can_throw_external && !TREE_NOTHROW (y->decl))
can_throw = true;
}
for (ie = node->indirect_calls; ie; ie = ie->next_callee)
can_throw = true;
break;
}
- w_info = (struct ipa_dfs_info *) w->symbol.aux;
+ w_info = (struct ipa_dfs_info *) w->aux;
w = w_info->next_cycle;
}
while (w)
{
funct_state w_l = get_function_state (w);
- if (!can_throw && !TREE_NOTHROW (w->symbol.decl))
+ if (!can_throw && !TREE_NOTHROW (w->decl))
{
cgraph_set_nothrow_flag (w, true);
if (dump_file)
fprintf (dump_file, "Function found to be nothrow: %s\n",
cgraph_node_name (w));
}
- else if (can_throw && !TREE_NOTHROW (w->symbol.decl))
+ else if (can_throw && !TREE_NOTHROW (w->decl))
w_l->can_throw = true;
- w_info = (struct ipa_dfs_info *) w->symbol.aux;
+ w_info = (struct ipa_dfs_info *) w->aux;
w = w_info->next_cycle;
}
}
static inline struct ipa_ref_list *
ipa_ref_referring_ref_list (struct ipa_ref *ref)
{
- return &ref->referring->symbol.ref_list;
+ return &ref->referring->ref_list;
}
/* Return reference list REF is in. */
static inline struct ipa_ref_list *
ipa_ref_referred_ref_list (struct ipa_ref *ref)
{
- return &ref->referred->symbol.ref_list;
+ return &ref->referred->ref_list;
}
/* Return first reference in LIST or NULL if empty. */
gcc_checking_assert (!stmt || is_a <cgraph_node> (referring_node));
gcc_checking_assert (use_type != IPA_REF_ALIAS || !stmt);
- list = &referring_node->symbol.ref_list;
+ list = &referring_node->ref_list;
old_references = vec_safe_address (list->references);
vec_safe_grow (list->references, vec_safe_length (list->references) + 1);
ref = &list->references->last ();
- list2 = &referred_node->symbol.ref_list;
+ list2 = &referred_node->ref_list;
list2->referring.safe_push (ref);
ref->referred_index = list2->referring.length () - 1;
ref->referring = referring_node;
{
fprintf (file, "%s/%i (%s)",
symtab_node_asm_name (ref->referred),
- ref->referred->symbol.order,
+ ref->referred->order,
ipa_ref_use_name [ref->use]);
if (ref->speculative)
fprintf (file, " (speculative)");
{
fprintf (file, "%s/%i (%s)",
symtab_node_asm_name (ref->referring),
- ref->referring->symbol.order,
+ ref->referring->order,
ipa_ref_use_name [ref->use]);
if (ref->speculative)
fprintf (file, " (speculative)");
struct ipa_ref *r = NULL;
int i;
- for (i = 0; ipa_ref_list_reference_iterate (&referring_node->symbol.ref_list, i, r); i++)
+ for (i = 0; ipa_ref_list_reference_iterate (&referring_node->ref_list, i, r); i++)
if (r->referred == referred_node
&& !r->speculative
&& ((stmt && r->stmt == stmt)
struct ipa_ref *r = NULL;
int i;
- for (i = 0; ipa_ref_list_reference_iterate (&referring_node->symbol.ref_list, i, r); i++)
+ for (i = 0; ipa_ref_list_reference_iterate (&referring_node->ref_list, i, r); i++)
if (r->stmt == stmt)
ipa_remove_reference (r);
}
struct ipa_ref *r = NULL;
int i;
- for (i = 0; ipa_ref_list_reference_iterate (&referring_node->symbol.ref_list, i, r); i++)
+ for (i = 0; ipa_ref_list_reference_iterate (&referring_node->ref_list, i, r); i++)
if (!r->speculative)
{
r->stmt = NULL;
get_reference_optimization_summary (cgraph_function_node (fn, NULL));
if (info)
return info->statics_not_read;
- else if (flags_from_decl_or_type (fn->symbol.decl) & ECF_LEAF)
+ else if (flags_from_decl_or_type (fn->decl) & ECF_LEAF)
return all_module_statics;
else
return NULL;
get_reference_optimization_summary (fn);
if (info)
return info->statics_not_written;
- else if (flags_from_decl_or_type (fn->symbol.decl) & ECF_LEAF)
+ else if (flags_from_decl_or_type (fn->decl) & ECF_LEAF)
return all_module_statics;
else
return NULL;
continue;
/* Only look into nodes we can propagate something. */
- int flags = flags_from_decl_or_type (y->symbol.decl);
+ int flags = flags_from_decl_or_type (y->decl);
if (avail > AVAIL_OVERWRITABLE
|| (avail == AVAIL_OVERWRITABLE && (flags & ECF_LEAF)))
{
tree var;
local = init_function_info (fn);
- for (i = 0; ipa_ref_list_reference_iterate (&fn->symbol.ref_list, i, ref); i++)
+ for (i = 0; ipa_ref_list_reference_iterate (&fn->ref_list, i, ref); i++)
{
if (!is_a <varpool_node> (ref->referred))
continue;
- var = ipa_ref_varpool_node (ref)->symbol.decl;
+ var = ipa_ref_varpool_node (ref)->decl;
if (!is_proper_for_analysis (var))
continue;
switch (ref->use)
l = &get_reference_vars_info (node)->local;
fprintf (dump_file,
"\nFunction name:%s/%i:",
- cgraph_node_asm_name (node), node->symbol.order);
+ cgraph_node_asm_name (node), node->order);
fprintf (dump_file, "\n locals read: ");
if (l->statics_read)
EXECUTE_IF_SET_IN_BITMAP (l->statics_read,
read_write_all_from_decl (struct cgraph_node *node,
bool &read_all, bool &write_all)
{
- tree decl = node->symbol.decl;
+ tree decl = node->decl;
int flags = flags_from_decl_or_type (decl);
if ((flags & ECF_LEAF)
&& cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE)
read_all = true;
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, " %s/%i -> read all\n",
- cgraph_node_asm_name (node), node->symbol.order);
+ cgraph_node_asm_name (node), node->order);
}
else
{
write_all = true;
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, " %s/%i -> read all, write all\n",
- cgraph_node_asm_name (node), node->symbol.order);
+ cgraph_node_asm_name (node), node->order);
}
}
/* Now we know what vars are really statics; prune out those that aren't. */
FOR_EACH_VARIABLE (vnode)
- if (vnode->symbol.externally_visible
- || TREE_ADDRESSABLE (vnode->symbol.decl)
- || TREE_READONLY (vnode->symbol.decl)
- || !is_proper_for_analysis (vnode->symbol.decl)
- || !vnode->symbol.definition)
- bitmap_clear_bit (all_module_statics, DECL_UID (vnode->symbol.decl));
+ if (vnode->externally_visible
+ || TREE_ADDRESSABLE (vnode->decl)
+ || TREE_READONLY (vnode->decl)
+ || !is_proper_for_analysis (vnode->decl)
+ || !vnode->definition)
+ bitmap_clear_bit (all_module_statics, DECL_UID (vnode->decl));
/* Forget info we collected "just for fun" on variables that turned out to be
non-local. */
bool write_all = false;
node = order[i];
- if (node->symbol.alias)
+ if (node->alias)
continue;
node_info = get_reference_vars_info (node);
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "Starting cycle with %s/%i\n",
- cgraph_node_asm_name (node), node->symbol.order);
+ cgraph_node_asm_name (node), node->order);
vec<cgraph_node_ptr> cycle_nodes = ipa_get_nodes_in_cycle (node);
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, " Visiting %s/%i\n",
- cgraph_node_asm_name (w), w->symbol.order);
+ cgraph_node_asm_name (w), w->order);
get_read_write_all_from_node (w, read_all, write_all);
if (read_all && write_all)
break;
{
ipa_reference_vars_info_t w_ri = get_reference_vars_info (w);
ipa_reference_local_vars_info_t w_l = &w_ri->local;
- int flags = flags_from_decl_or_type (w->symbol.decl);
+ int flags = flags_from_decl_or_type (w->decl);
if (!(flags & ECF_CONST))
read_all = union_static_var_sets (node_g->statics_read,
struct cgraph_node *w;
node = order[i];
- if (node->symbol.alias)
+ if (node->alias)
continue;
fprintf (dump_file,
"\nFunction name:%s/%i:",
- cgraph_node_asm_name (node), node->symbol.order);
+ cgraph_node_asm_name (node), node->order);
ipa_reference_vars_info_t node_info = get_reference_vars_info (node);
ipa_reference_global_vars_info_t node_g = &node_info->global;
ipa_reference_local_vars_info_t w_l = &w_ri->local;
if (w != node)
fprintf (dump_file, "\n next cycle: %s/%i ",
- cgraph_node_asm_name (w), w->symbol.order);
+ cgraph_node_asm_name (w), w->order);
fprintf (dump_file, "\n locals read: ");
dump_static_vars_set_to_file (dump_file, w_l->statics_read);
fprintf (dump_file, "\n locals written: ");
ipa_reference_optimization_summary_t opt;
node_info = get_reference_vars_info (node);
- if (!node->symbol.alias
+ if (!node->alias
&& (cgraph_function_body_availability (node) > AVAIL_OVERWRITABLE
- || (flags_from_decl_or_type (node->symbol.decl) & ECF_LEAF)))
+ || (flags_from_decl_or_type (node->decl) & ECF_LEAF)))
{
node_g = &node_info->global;
ipa_reference_optimization_summary_t info;
/* See if we have (non-empty) info. */
- if (!node->symbol.definition || node->global.inlined_to)
+ if (!node->definition || node->global.inlined_to)
return false;
info = get_reference_optimization_summary (node);
if (!info || (bitmap_empty_p (info->statics_not_read)
In future we might also want to include summaries of functions references
by initializers of constant variables references in current unit. */
if (!reachable_from_this_partition_p (node, encoder)
- && !referenced_from_this_partition_p (&node->symbol.ref_list, encoder))
+ && !referenced_from_this_partition_p (&node->ref_list, encoder))
return false;
/* See if the info has non-empty intersections with vars we want to encode. */
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->symbol.decl))
- && referenced_from_this_partition_p (&vnode->symbol.ref_list, encoder))
+ && bitmap_bit_p (all_module_statics, DECL_UID (vnode->decl))
+ && referenced_from_this_partition_p (&vnode->ref_list, encoder))
{
- tree decl = vnode->symbol.decl;
+ tree decl = vnode->decl;
bitmap_set_bit (ltrans_statics, DECL_UID (decl));
splay_tree_insert (reference_vars_to_consider,
DECL_UID (decl), (splay_tree_value)decl);
if (dump_file)
fprintf (dump_file,
"\nFunction name:%s/%i:\n static not read:",
- cgraph_node_asm_name (node), node->symbol.order);
+ cgraph_node_asm_name (node), node->order);
/* Set the statics not read. */
v_count = streamer_read_hwi (ib);
/* For usual cloning it is enough to clear builtin only when signature
changes. For partial inlining we however can not expect the part
of builtin implementation to have same semantic as the whole. */
- if (DECL_BUILT_IN (node->symbol.decl))
+ if (DECL_BUILT_IN (node->decl))
{
- DECL_BUILT_IN_CLASS (node->symbol.decl) = NOT_BUILT_IN;
- DECL_FUNCTION_CODE (node->symbol.decl) = (enum built_in_function) 0;
+ DECL_BUILT_IN_CLASS (node->decl) = NOT_BUILT_IN;
+ DECL_FUNCTION_CODE (node->decl) = (enum built_in_function) 0;
}
/* If the original function is declared inline, there is no point in issuing
a warning for the non-inlinable part. */
- DECL_NO_INLINE_WARNING_P (node->symbol.decl) = 1;
+ DECL_NO_INLINE_WARNING_P (node->decl) = 1;
cgraph_node_remove_callees (cur_node);
- ipa_remove_all_references (&cur_node->symbol.ref_list);
+ ipa_remove_all_references (&cur_node->ref_list);
if (!split_part_return_p)
- TREE_THIS_VOLATILE (node->symbol.decl) = 1;
+ TREE_THIS_VOLATILE (node->decl) = 1;
if (dump_file)
- dump_function_to_file (node->symbol.decl, dump_file, dump_flags);
+ dump_function_to_file (node->decl, dump_file, dump_flags);
/* Create the basic block we place call into. It is the entry basic block
split after last label. */
false, GSI_CONTINUE_LINKING);
args_to_pass[i] = arg;
}
- call = gimple_build_call_vec (node->symbol.decl, args_to_pass);
+ call = gimple_build_call_vec (node->decl, args_to_pass);
gimple_set_block (call, DECL_INITIAL (current_function_decl));
args_to_pass.release ();
continue;
if (debug_args == NULL)
- debug_args = decl_debug_args_insert (node->symbol.decl);
+ debug_args = decl_debug_args_insert (node->decl);
ddecl = make_node (DEBUG_EXPR_DECL);
DECL_ARTIFICIAL (ddecl) = 1;
TREE_TYPE (ddecl) = TREE_TYPE (parm);
gimple_stmt_iterator cgsi;
gimple def_temp;
- push_cfun (DECL_STRUCT_FUNCTION (node->symbol.decl));
- var = BLOCK_VARS (DECL_INITIAL (node->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
+ var = BLOCK_VARS (DECL_INITIAL (node->decl));
i = vec_safe_length (*debug_args);
cgsi = gsi_after_labels (single_succ (ENTRY_BLOCK_PTR));
do
fprintf (dump_file, "Not splitting: not inlinable.\n");
return 0;
}
- if (DECL_DISREGARD_INLINE_LIMITS (node->symbol.decl))
+ if (DECL_DISREGARD_INLINE_LIMITS (node->decl))
{
if (dump_file)
fprintf (dump_file, "Not splitting: disregarding inline limits.\n");
if ((!node->callers
/* Local functions called once will be completely inlined most of time. */
|| (!node->callers->next_caller && node->local.local))
- && !node->symbol.address_taken
- && (!flag_lto || !node->symbol.externally_visible))
+ && !node->address_taken
+ && (!flag_lto || !node->externally_visible))
{
if (dump_file)
fprintf (dump_file, "Not splitting: not called directly "
bool (*ignore_edge) (struct cgraph_edge *))
{
struct cgraph_edge *edge;
- struct ipa_dfs_info *v_info = (struct ipa_dfs_info *) v->symbol.aux;
+ struct ipa_dfs_info *v_info = (struct ipa_dfs_info *) v->aux;
/* mark node as old */
v_info->new_node = false;
if (!w || (ignore_edge && ignore_edge (edge)))
continue;
- if (w->symbol.aux
+ if (w->aux
&& (avail > AVAIL_OVERWRITABLE
|| (env->allow_overwritable && avail == AVAIL_OVERWRITABLE)))
{
- w_info = (struct ipa_dfs_info *) w->symbol.aux;
+ w_info = (struct ipa_dfs_info *) w->aux;
if (w_info->new_node)
{
searchc (env, w, ignore_edge);
struct ipa_dfs_info *x_info;
do {
x = env->stack[--(env->stack_size)];
- x_info = (struct ipa_dfs_info *) x->symbol.aux;
+ x_info = (struct ipa_dfs_info *) x->aux;
x_info->on_stack = false;
x_info->scc_no = v_info->dfn_number;
&& (avail == AVAIL_OVERWRITABLE)))
{
/* Reuse the info if it is already there. */
- struct ipa_dfs_info *info = (struct ipa_dfs_info *) node->symbol.aux;
+ struct ipa_dfs_info *info = (struct ipa_dfs_info *) node->aux;
if (!info)
info = XCNEW (struct ipa_dfs_info);
info->new_node = true;
info->on_stack = false;
info->next_cycle = NULL;
- node->symbol.aux = info;
+ node->aux = info;
splay_tree_insert (env.nodes_marked_new,
(splay_tree_key)node->uid,
(splay_tree_value)node);
}
else
- node->symbol.aux = NULL;
+ node->aux = NULL;
}
result = splay_tree_min (env.nodes_marked_new);
while (result)
FOR_EACH_DEFINED_FUNCTION (node)
{
/* Get rid of the aux information. */
- if (node->symbol.aux)
+ if (node->aux)
{
- free (node->symbol.aux);
- node->symbol.aux = NULL;
+ free (node->aux);
+ node->aux = NULL;
}
}
}
while (node)
{
v.safe_push (node);
- node_dfs_info = (struct ipa_dfs_info *) node->symbol.aux;
+ node_dfs_info = (struct ipa_dfs_info *) node->aux;
node = node_dfs_info->next_cycle;
}
return v;
bool
ipa_edge_within_scc (struct cgraph_edge *cs)
{
- struct ipa_dfs_info *caller_dfs = (struct ipa_dfs_info *) cs->caller->symbol.aux;
+ struct ipa_dfs_info *caller_dfs = (struct ipa_dfs_info *) cs->caller->aux;
struct ipa_dfs_info *callee_dfs;
struct cgraph_node *callee = cgraph_function_node (cs->callee, NULL);
- callee_dfs = (struct ipa_dfs_info *) callee->symbol.aux;
+ callee_dfs = (struct ipa_dfs_info *) callee->aux;
return (caller_dfs
&& callee_dfs
&& caller_dfs->scc_no == callee_dfs->scc_no);
to be output and put them into order as well, so we get dependencies
right through inline functions. */
FOR_EACH_FUNCTION (node)
- node->symbol.aux = NULL;
+ node->aux = NULL;
for (pass = 0; pass < 2; pass++)
FOR_EACH_FUNCTION (node)
- if (!node->symbol.aux
+ if (!node->aux
&& (pass
- || (!node->symbol.address_taken
+ || (!node->address_taken
&& !node->global.inlined_to
- && !node->symbol.alias && !node->thunk.thunk_p
+ && !node->alias && !node->thunk.thunk_p
&& !cgraph_only_called_directly_p (node))))
{
stack_size = 0;
stack[stack_size].node = node;
stack[stack_size].edge = node->callers;
stack[stack_size].ref = 0;
- node->symbol.aux = (void *)(size_t)1;
+ node->aux = (void *)(size_t)1;
while (stack_size >= 0)
{
while (true)
/* Break possible cycles involving always-inline
functions by ignoring edges from always-inline
functions to non-always-inline functions. */
- if (DECL_DISREGARD_INLINE_LIMITS (edge->caller->symbol.decl)
+ if (DECL_DISREGARD_INLINE_LIMITS (edge->caller->decl)
&& !DECL_DISREGARD_INLINE_LIMITS
- (cgraph_function_node (edge->callee, NULL)->symbol.decl))
+ (cgraph_function_node (edge->callee, NULL)->decl))
node2 = NULL;
}
- for (;ipa_ref_list_referring_iterate (&stack[stack_size].node->symbol.ref_list,
+ for (;ipa_ref_list_referring_iterate (&stack[stack_size].node->ref_list,
stack[stack_size].ref,
ref) && !node2;
stack[stack_size].ref++)
}
if (!node2)
break;
- if (!node2->symbol.aux)
+ if (!node2->aux)
{
stack[++stack_size].node = node2;
stack[stack_size].edge = node2->callers;
stack[stack_size].ref = 0;
- node2->symbol.aux = (void *)(size_t)1;
+ node2->aux = (void *)(size_t)1;
}
}
order[order_pos++] = stack[stack_size--].node;
}
free (stack);
FOR_EACH_FUNCTION (node)
- node->symbol.aux = NULL;
+ node->aux = NULL;
return order_pos;
}
for (iter = csi_start (set); !csi_end_p (iter); csi_next (&iter))
{
struct cgraph_node *node = csi_node (iter);
- fprintf (f, " %s/%i", cgraph_node_name (node), node->symbol.order);
+ fprintf (f, " %s/%i", cgraph_node_name (node), node->order);
}
fprintf (f, "\n");
}
ipa_merge_profiles (struct cgraph_node *dst,
struct cgraph_node *src)
{
- tree oldsrcdecl = src->symbol.decl;
+ tree oldsrcdecl = src->decl;
struct function *srccfun, *dstcfun;
bool match = true;
- if (!src->symbol.definition
- || !dst->symbol.definition)
+ if (!src->definition
+ || !dst->definition)
return;
if (src->frequency < dst->frequency)
src->frequency = dst->frequency;
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "Merging profiles of %s/%i to %s/%i\n",
- xstrdup (cgraph_node_name (src)), src->symbol.order,
- xstrdup (cgraph_node_name (dst)), dst->symbol.order);
+ xstrdup (cgraph_node_name (src)), src->order,
+ xstrdup (cgraph_node_name (dst)), dst->order);
}
dst->count += src->count;
If declaration is merged, we need to duplicate it to be able
to load body that is being replaced. This makes symbol table
temporarily inconsistent. */
- if (src->symbol.decl == dst->symbol.decl)
+ if (src->decl == dst->decl)
{
void **slot;
struct lto_in_decl_state temp;
/* We are going to move the decl, we want to remove its file decl data.
and link these with the new decl. */
- temp.fn_decl = src->symbol.decl;
- slot = htab_find_slot (src->symbol.lto_file_data->function_decl_states,
+ temp.fn_decl = src->decl;
+ slot = htab_find_slot (src->lto_file_data->function_decl_states,
&temp, NO_INSERT);
state = (lto_in_decl_state *)*slot;
- htab_clear_slot (src->symbol.lto_file_data->function_decl_states, slot);
+ htab_clear_slot (src->lto_file_data->function_decl_states, slot);
gcc_assert (state);
/* Duplicate the decl and be sure it does not link into body of DST. */
- src->symbol.decl = copy_node (src->symbol.decl);
- DECL_STRUCT_FUNCTION (src->symbol.decl) = NULL;
- DECL_ARGUMENTS (src->symbol.decl) = NULL;
- DECL_INITIAL (src->symbol.decl) = NULL;
- DECL_RESULT (src->symbol.decl) = NULL;
+ src->decl = copy_node (src->decl);
+ DECL_STRUCT_FUNCTION (src->decl) = NULL;
+ DECL_ARGUMENTS (src->decl) = NULL;
+ DECL_INITIAL (src->decl) = NULL;
+ DECL_RESULT (src->decl) = NULL;
/* Associate the decl state with new declaration, so LTO streamer
can look it up. */
- state->fn_decl = src->symbol.decl;
- slot = htab_find_slot (src->symbol.lto_file_data->function_decl_states,
+ state->fn_decl = src->decl;
+ slot = htab_find_slot (src->lto_file_data->function_decl_states,
state, INSERT);
gcc_assert (!*slot);
*slot = state;
}
cgraph_get_body (src);
cgraph_get_body (dst);
- srccfun = DECL_STRUCT_FUNCTION (src->symbol.decl);
- dstcfun = DECL_STRUCT_FUNCTION (dst->symbol.decl);
+ srccfun = DECL_STRUCT_FUNCTION (src->decl);
+ dstcfun = DECL_STRUCT_FUNCTION (dst->decl);
if (n_basic_blocks_for_function (srccfun)
!= n_basic_blocks_for_function (dstcfun))
{
gcc_assert (!e->speculative);
e->count = gimple_bb (e->call_stmt)->count;
e->frequency = compute_call_stmt_bb_frequency
- (dst->symbol.decl,
+ (dst->decl,
gimple_bb (e->call_stmt));
}
for (e = dst->indirect_calls; e; e = e->next_callee)
gcc_assert (!e->speculative);
e->count = gimple_bb (e->call_stmt)->count;
e->frequency = compute_call_stmt_bb_frequency
- (dst->symbol.decl,
+ (dst->decl,
gimple_bb (e->call_stmt));
}
cgraph_release_function_body (src);
inline_update_overall_summary (dst);
}
/* TODO: if there is no match, we can scale up. */
- src->symbol.decl = oldsrcdecl;
+ src->decl = oldsrcdecl;
}
/* Return true if call to DEST is known to be self-recusive call withing FUNC. */
struct cgraph_node *dest_node = cgraph_get_create_node (dest);
struct cgraph_node *cnode = cgraph_get_create_node (func);
- return symtab_semantically_equivalent_p ((symtab_node)dest_node,
- (symtab_node)cnode);
+ return symtab_semantically_equivalent_p (dest_node,
+ cnode);
}
{
/* FIXME: Aliases can be local, but i386 gets thunks wrong then. */
return !(cgraph_only_called_directly_or_aliased_p (node)
- && !ipa_ref_has_aliases_p (&node->symbol.ref_list)
- && node->symbol.definition
- && !DECL_EXTERNAL (node->symbol.decl)
- && !node->symbol.externally_visible
- && !node->symbol.used_from_other_partition
- && !node->symbol.in_other_partition);
+ && !ipa_ref_has_aliases_p (&node->ref_list)
+ && node->definition
+ && !DECL_EXTERNAL (node->decl)
+ && !node->externally_visible
+ && !node->used_from_other_partition
+ && !node->in_other_partition);
}
/* Return true when function can be marked local. */
int i;
struct ipa_ref *ref;
- for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list,
+ for (i = 0; ipa_ref_list_referring_iterate (&node->ref_list,
i, ref); i++)
if (ref->use == IPA_REF_ADDR)
return true;
struct pointer_set_t *reachable)
{
/* Node is still in queue; do nothing. */
- if (node->symbol.aux && node->symbol.aux != (void *) 2)
+ if (node->aux && node->aux != (void *) 2)
return;
/* Node was already processed as unreachable, re-enqueue
only if it became reachable now. */
- if (node->symbol.aux == (void *)2 && !pointer_set_contains (reachable, node))
+ if (node->aux == (void *)2 && !pointer_set_contains (reachable, node))
return;
- node->symbol.aux = *first;
+ node->aux = *first;
*first = node;
}
{
symtab_node node = ref->referred;
- if (node->symbol.definition && !node->symbol.in_other_partition
- && ((!DECL_EXTERNAL (node->symbol.decl) || node->symbol.alias)
+ if (node->definition && !node->in_other_partition
+ && ((!DECL_EXTERNAL (node->decl) || node->alias)
|| (before_inlining_p
/* We use variable constructors during late complation for
constant folding. Keep references alive so partitioning
knows about potential references. */
- || (TREE_CODE (node->symbol.decl) == VAR_DECL
+ || (TREE_CODE (node->decl) == VAR_DECL
&& flag_wpa
- && ctor_for_folding (node->symbol.decl)
+ && ctor_for_folding (node->decl)
!= error_mark_node))))
pointer_set_insert (reachable, node);
- enqueue_node ((symtab_node) node, first, reachable);
+ enqueue_node (node, first, reachable);
}
}
/* Do not bother to mark virtual methods in anonymous namespace;
either we will find use of virtual table defining it, or it is
unused. */
- if (TREE_CODE (TREE_TYPE (n->symbol.decl)) == METHOD_TYPE
+ if (TREE_CODE (TREE_TYPE (n->decl)) == METHOD_TYPE
&& type_in_anonymous_namespace_p
- (method_class_type (TREE_TYPE (n->symbol.decl))))
+ (method_class_type (TREE_TYPE (n->decl))))
continue;
/* Prior inlining, keep alive bodies of possible targets for
devirtualization. */
- if (n->symbol.definition
+ if (n->definition
&& before_inlining_p)
pointer_set_insert (reachable, n);
/* Even after inlining we want to keep the possible targets in the
boundary, so late passes can still produce direct call even if
the chance for inlining is lost. */
- enqueue_node ((symtab_node) n, first, reachable);
+ enqueue_node (n, first, reachable);
}
}
fprintf (dump_file,
"Devirtualizing call in %s/%i to %s/%i\n",
cgraph_node_name (edge->caller),
- edge->caller->symbol.order,
- cgraph_node_name (target), target->symbol.order);
+ edge->caller->order,
+ cgraph_node_name (target), target->order);
edge = cgraph_make_edge_direct (edge, target);
if (!inline_summary_vec && edge->call_stmt)
cgraph_redirect_edge_call_stmt_to_callee (edge);
fprintf (file, "\nReclaiming functions:");
#ifdef ENABLE_CHECKING
FOR_EACH_FUNCTION (node)
- gcc_assert (!node->symbol.aux);
+ gcc_assert (!node->aux);
FOR_EACH_VARIABLE (vnode)
- gcc_assert (!vnode->symbol.aux);
+ gcc_assert (!vnode->aux);
#endif
/* Mark functions whose bodies are obviously needed.
This is mostly when they can be referenced externally. Inline clones
FOR_EACH_FUNCTION (node)
{
node->used_as_abstract_origin = false;
- if (node->symbol.definition
+ if (node->definition
&& !node->global.inlined_to
- && !node->symbol.in_other_partition
+ && !node->in_other_partition
&& !cgraph_can_remove_if_no_direct_calls_and_refs_p (node))
{
gcc_assert (!node->global.inlined_to);
pointer_set_insert (reachable, node);
- enqueue_node ((symtab_node)node, &first, reachable);
+ enqueue_node (node, &first, reachable);
}
else
- gcc_assert (!node->symbol.aux);
+ gcc_assert (!node->aux);
}
/* Mark variables that are obviously needed. */
FOR_EACH_DEFINED_VARIABLE (vnode)
if (!varpool_can_remove_if_no_refs (vnode)
- && !vnode->symbol.in_other_partition)
+ && !vnode->in_other_partition)
{
pointer_set_insert (reachable, vnode);
- enqueue_node ((symtab_node)vnode, &first, reachable);
+ enqueue_node (vnode, &first, reachable);
}
/* Perform reachability analysis. */
bool in_boundary_p = !pointer_set_contains (reachable, first);
symtab_node node = first;
- first = (symtab_node)first->symbol.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. */
if (in_boundary_p)
- node->symbol.aux = (void *)2;
+ node->aux = (void *)2;
else
{
- if (DECL_ABSTRACT_ORIGIN (node->symbol.decl))
+ if (DECL_ABSTRACT_ORIGIN (node->decl))
{
struct cgraph_node *origin_node
- = cgraph_get_create_real_symbol_node (DECL_ABSTRACT_ORIGIN (node->symbol.decl));
+ = cgraph_get_create_real_symbol_node (DECL_ABSTRACT_ORIGIN (node->decl));
origin_node->used_as_abstract_origin = true;
- enqueue_node ((symtab_node) origin_node, &first, reachable);
+ enqueue_node (origin_node, &first, reachable);
}
/* If any symbol in a comdat group is reachable, force
all other in the same comdat group to be also reachable. */
- if (node->symbol.same_comdat_group)
+ if (node->same_comdat_group)
{
symtab_node next;
- for (next = node->symbol.same_comdat_group;
+ for (next = node->same_comdat_group;
next != node;
- next = next->symbol.same_comdat_group)
+ next = next->same_comdat_group)
if (!pointer_set_insert (reachable, next))
- enqueue_node ((symtab_node) next, &first, reachable);
+ enqueue_node (next, &first, reachable);
}
/* Mark references as reachable. */
- process_references (&node->symbol.ref_list, &first,
+ process_references (&node->ref_list, &first,
before_inlining_p, reachable);
}
}
for (e = cnode->callees; e; e = e->next_callee)
{
- if (e->callee->symbol.definition
- && !e->callee->symbol.in_other_partition
+ if (e->callee->definition
+ && !e->callee->in_other_partition
&& (!e->inline_failed
- || !DECL_EXTERNAL (e->callee->symbol.decl)
- || e->callee->symbol.alias
+ || !DECL_EXTERNAL (e->callee->decl)
+ || e->callee->alias
|| before_inlining_p))
pointer_set_insert (reachable, e->callee);
- enqueue_node ((symtab_node) e->callee, &first, reachable);
+ enqueue_node (e->callee, &first, reachable);
}
/* When inline clone exists, mark body to be preserved so when removing
offline copy of the function we don't kill it. */
if (cnode->global.inlined_to)
- pointer_set_insert (body_needed_for_clonning, cnode->symbol.decl);
+ pointer_set_insert (body_needed_for_clonning, cnode->decl);
/* For non-inline clones, force their origins to the boundary and ensure
that body is not removed. */
while (cnode->clone_of)
{
- bool noninline = cnode->clone_of->symbol.decl != cnode->symbol.decl;
+ bool noninline = cnode->clone_of->decl != cnode->decl;
cnode = cnode->clone_of;
if (noninline)
{
- pointer_set_insert (body_needed_for_clonning, cnode->symbol.decl);
- enqueue_node ((symtab_node)cnode, &first, reachable);
+ pointer_set_insert (body_needed_for_clonning, cnode->decl);
+ enqueue_node (cnode, &first, reachable);
}
}
}
refers to. */
varpool_node *vnode = dyn_cast <varpool_node> (node);
if (vnode
- && DECL_EXTERNAL (node->symbol.decl)
- && !vnode->symbol.alias
+ && DECL_EXTERNAL (node->decl)
+ && !vnode->alias
&& in_boundary_p)
{
struct ipa_ref *ref;
- for (int i = 0; ipa_ref_list_reference_iterate (&node->symbol.ref_list, i, ref); i++)
+ for (int i = 0; ipa_ref_list_reference_iterate (&node->ref_list, i, ref); i++)
enqueue_node (ref->referred, &first, reachable);
}
}
next = cgraph_next_function (node);
/* If node is not needed at all, remove it. */
- if (!node->symbol.aux)
+ if (!node->aux)
{
if (file)
fprintf (file, " %s", cgraph_node_name (node));
/* If node is unreachable, remove its body. */
else if (!pointer_set_contains (reachable, node))
{
- if (!pointer_set_contains (body_needed_for_clonning, node->symbol.decl))
+ if (!pointer_set_contains (body_needed_for_clonning, node->decl))
cgraph_release_function_body (node);
else if (!node->clone_of)
- gcc_assert (in_lto_p || DECL_RESULT (node->symbol.decl));
- if (node->symbol.definition)
+ gcc_assert (in_lto_p || DECL_RESULT (node->decl));
+ if (node->definition)
{
if (file)
fprintf (file, " %s", cgraph_node_name (node));
- node->symbol.analyzed = false;
- node->symbol.definition = false;
- node->symbol.cpp_implicit_alias = false;
- node->symbol.alias = false;
- node->symbol.weakref = false;
- if (!node->symbol.in_other_partition)
+ node->analyzed = false;
+ node->definition = false;
+ node->cpp_implicit_alias = false;
+ node->alias = false;
+ node->weakref = false;
+ if (!node->in_other_partition)
node->local.local = false;
cgraph_node_remove_callees (node);
- ipa_remove_all_references (&node->symbol.ref_list);
+ ipa_remove_all_references (&node->ref_list);
changed = true;
}
}
else
gcc_assert (node->clone_of || !cgraph_function_with_gimple_body_p (node)
- || in_lto_p || DECL_RESULT (node->symbol.decl));
+ || in_lto_p || DECL_RESULT (node->decl));
}
/* Inline clones might be kept around so their materializing allows further
node->global.inlined_to = NULL;
update_inlined_to_pointer (node, node);
}
- node->symbol.aux = NULL;
+ node->aux = NULL;
}
/* Remove unreachable variables. */
for (vnode = varpool_first_variable (); vnode; vnode = vnext)
{
vnext = varpool_next_variable (vnode);
- if (!vnode->symbol.aux
+ if (!vnode->aux
/* For can_refer_decl_in_current_unit_p we want to track for
all external variables if they are defined in other partition
or not. */
- && (!flag_ltrans || !DECL_EXTERNAL (vnode->symbol.decl)))
+ && (!flag_ltrans || !DECL_EXTERNAL (vnode->decl)))
{
if (file)
fprintf (file, " %s", varpool_node_name (vnode));
else if (!pointer_set_contains (reachable, vnode))
{
tree init;
- if (vnode->symbol.definition)
+ if (vnode->definition)
{
if (file)
fprintf (file, " %s", varpool_node_name (vnode));
changed = true;
}
- vnode->symbol.definition = false;
- vnode->symbol.analyzed = false;
- vnode->symbol.aux = NULL;
+ vnode->definition = false;
+ vnode->analyzed = false;
+ vnode->aux = NULL;
/* Keep body if it may be useful for constant folding. */
- if ((init = ctor_for_folding (vnode->symbol.decl)) == error_mark_node)
+ if ((init = ctor_for_folding (vnode->decl)) == error_mark_node)
varpool_remove_initializer (vnode);
else
- DECL_INITIAL (vnode->symbol.decl) = init;
- ipa_remove_all_references (&vnode->symbol.ref_list);
+ DECL_INITIAL (vnode->decl) = init;
+ ipa_remove_all_references (&vnode->ref_list);
}
else
- vnode->symbol.aux = NULL;
+ vnode->aux = NULL;
}
pointer_set_destroy (reachable);
if (file)
fprintf (file, "\nClearing address taken flags:");
FOR_EACH_DEFINED_FUNCTION (node)
- if (node->symbol.address_taken
- && !node->symbol.used_from_other_partition)
+ if (node->address_taken
+ && !node->used_from_other_partition)
{
if (!cgraph_for_node_and_aliases (node, has_addr_references_p, NULL, true))
{
if (file)
fprintf (file, " %s", cgraph_node_name (node));
- node->symbol.address_taken = false;
+ node->address_taken = false;
changed = true;
if (cgraph_local_node_p (node))
{
if (dump_file)
fprintf (dump_file, "Clearing variable flags:");
FOR_EACH_VARIABLE (vnode)
- if (vnode->symbol.definition && varpool_all_refs_explicit_p (vnode)
- && (TREE_ADDRESSABLE (vnode->symbol.decl)
- || !TREE_READONLY (vnode->symbol.decl)))
+ if (vnode->definition && varpool_all_refs_explicit_p (vnode)
+ && (TREE_ADDRESSABLE (vnode->decl)
+ || !TREE_READONLY (vnode->decl)))
{
bool written = false;
bool address_taken = false;
int i;
struct ipa_ref *ref;
- for (i = 0; ipa_ref_list_referring_iterate (&vnode->symbol.ref_list,
+ for (i = 0; ipa_ref_list_referring_iterate (&vnode->ref_list,
i, ref)
&& (!written || !address_taken); i++)
switch (ref->use)
written = true;
break;
}
- if (TREE_ADDRESSABLE (vnode->symbol.decl) && !address_taken)
+ if (TREE_ADDRESSABLE (vnode->decl) && !address_taken)
{
if (dump_file)
fprintf (dump_file, " %s (addressable)", varpool_node_name (vnode));
- TREE_ADDRESSABLE (vnode->symbol.decl) = 0;
+ TREE_ADDRESSABLE (vnode->decl) = 0;
}
- if (!TREE_READONLY (vnode->symbol.decl) && !address_taken && !written
+ if (!TREE_READONLY (vnode->decl) && !address_taken && !written
/* Making variable in explicit section readonly can cause section
type conflict.
See e.g. gcc.c-torture/compile/pr23237.c */
- && DECL_SECTION_NAME (vnode->symbol.decl) == NULL)
+ && DECL_SECTION_NAME (vnode->decl) == NULL)
{
if (dump_file)
fprintf (dump_file, " %s (read-only)", varpool_node_name (vnode));
- TREE_READONLY (vnode->symbol.decl) = 1;
+ TREE_READONLY (vnode->decl) = 1;
}
}
if (dump_file)
{
int i;
struct ipa_ref *ref;
- for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list,
+ for (i = 0; ipa_ref_list_referring_iterate (&node->ref_list,
i, ref); i++)
if (ref->use == IPA_REF_ADDR)
{
if (is_a <cgraph_node> (ref->referring))
return true;
node = ipa_ref_referring_varpool_node (ref);
- if (!DECL_VIRTUAL_P (node->symbol.decl))
+ if (!DECL_VIRTUAL_P (node->decl))
return true;
}
return false;
break eventually. Exception are virutal functions, C++
constructors/destructors and vtables, where this is not possible by
language standard. */
- if (!DECL_VIRTUAL_P (node->symbol.decl)
- && (TREE_CODE (node->symbol.decl) != FUNCTION_DECL
- || (!DECL_CXX_CONSTRUCTOR_P (node->symbol.decl)
- && !DECL_CXX_DESTRUCTOR_P (node->symbol.decl)))
+ if (!DECL_VIRTUAL_P (node->decl)
+ && (TREE_CODE (node->decl) != FUNCTION_DECL
+ || (!DECL_CXX_CONSTRUCTOR_P (node->decl)
+ && !DECL_CXX_DESTRUCTOR_P (node->decl)))
&& address_taken_from_non_vtable_p (node))
return false;
/* If the symbol is used in some weird way, better to not touch it. */
- if (node->symbol.force_output)
+ if (node->force_output)
return false;
/* Explicit instantiations needs to be output when possibly
used externally. */
- if (node->symbol.forced_by_abi
- && TREE_PUBLIC (node->symbol.decl)
- && (node->symbol.resolution != LDPR_PREVAILING_DEF_IRONLY
+ if (node->forced_by_abi
+ && TREE_PUBLIC (node->decl)
+ && (node->resolution != LDPR_PREVAILING_DEF_IRONLY
&& !flag_whole_program))
return false;
/* Non-readonly and volatile variables can not be duplicated. */
if (is_a <varpool_node> (node)
- && (!TREE_READONLY (node->symbol.decl)
- || TREE_THIS_VOLATILE (node->symbol.decl)))
+ && (!TREE_READONLY (node->decl)
+ || TREE_THIS_VOLATILE (node->decl)))
return false;
return true;
}
{
if (!comdat_can_be_unshared_p_1 (node))
return false;
- if (node->symbol.same_comdat_group)
+ if (node->same_comdat_group)
{
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
address taken. */
- for (next = node->symbol.same_comdat_group;
- next != node; next = next->symbol.same_comdat_group)
+ for (next = node->same_comdat_group;
+ next != node; next = next->same_comdat_group)
if (!comdat_can_be_unshared_p_1 (next))
return false;
}
cgraph_externally_visible_p (struct cgraph_node *node,
bool whole_program)
{
- if (!node->symbol.definition)
+ if (!node->definition)
return false;
- if (!TREE_PUBLIC (node->symbol.decl)
- || DECL_EXTERNAL (node->symbol.decl))
+ if (!TREE_PUBLIC (node->decl)
+ || DECL_EXTERNAL (node->decl))
return false;
/* Do not try to localize built-in functions yet. One of problems is that we
using the implicit built-in declarations anymore. Similarly this enables
us to remove them as unreachable before actual calls may appear during
expansion or folding. */
- if (DECL_BUILT_IN (node->symbol.decl))
+ if (DECL_BUILT_IN (node->decl))
return true;
/* If linker counts on us, we must preserve the function. */
- if (symtab_used_from_object_file_p ((symtab_node) node))
+ if (symtab_used_from_object_file_p (node))
return true;
- if (DECL_PRESERVE_P (node->symbol.decl))
+ if (DECL_PRESERVE_P (node->decl))
return true;
if (lookup_attribute ("externally_visible",
- DECL_ATTRIBUTES (node->symbol.decl)))
+ DECL_ATTRIBUTES (node->decl)))
return true;
if (TARGET_DLLIMPORT_DECL_ATTRIBUTES
&& lookup_attribute ("dllexport",
- DECL_ATTRIBUTES (node->symbol.decl)))
+ DECL_ATTRIBUTES (node->decl)))
return true;
- if (node->symbol.resolution == LDPR_PREVAILING_DEF_IRONLY)
+ if (node->resolution == LDPR_PREVAILING_DEF_IRONLY)
return false;
/* When doing LTO or whole program, we can bring COMDAT functoins static.
This improves code quality and we know we will duplicate them at most twice
(in the case that we are not using plugin and link with object file
implementing same COMDAT) */
if ((in_lto_p || whole_program)
- && DECL_COMDAT (node->symbol.decl)
- && comdat_can_be_unshared_p ((symtab_node) node))
+ && DECL_COMDAT (node->decl)
+ && comdat_can_be_unshared_p (node))
return false;
/* When doing link time optimizations, hidden symbols become local. */
if (in_lto_p
- && (DECL_VISIBILITY (node->symbol.decl) == VISIBILITY_HIDDEN
- || DECL_VISIBILITY (node->symbol.decl) == VISIBILITY_INTERNAL)
+ && (DECL_VISIBILITY (node->decl) == VISIBILITY_HIDDEN
+ || DECL_VISIBILITY (node->decl) == VISIBILITY_INTERNAL)
/* Be sure that node is defined in IR file, not in other object
file. In that case we don't set used_from_other_object_file. */
- && node->symbol.definition)
+ && node->definition)
;
else if (!whole_program)
return true;
- if (MAIN_NAME_P (DECL_NAME (node->symbol.decl)))
+ if (MAIN_NAME_P (DECL_NAME (node->decl)))
return true;
return false;
bool
varpool_externally_visible_p (struct varpool_node *vnode)
{
- if (DECL_EXTERNAL (vnode->symbol.decl))
+ if (DECL_EXTERNAL (vnode->decl))
return true;
- if (!TREE_PUBLIC (vnode->symbol.decl))
+ if (!TREE_PUBLIC (vnode->decl))
return false;
/* If linker counts on us, we must preserve the function. */
- if (symtab_used_from_object_file_p ((symtab_node) vnode))
+ if (symtab_used_from_object_file_p (vnode))
return true;
- if (DECL_HARD_REGISTER (vnode->symbol.decl))
+ if (DECL_HARD_REGISTER (vnode->decl))
return true;
- if (DECL_PRESERVE_P (vnode->symbol.decl))
+ if (DECL_PRESERVE_P (vnode->decl))
return true;
if (lookup_attribute ("externally_visible",
- DECL_ATTRIBUTES (vnode->symbol.decl)))
+ DECL_ATTRIBUTES (vnode->decl)))
return true;
if (TARGET_DLLIMPORT_DECL_ATTRIBUTES
&& lookup_attribute ("dllexport",
- DECL_ATTRIBUTES (vnode->symbol.decl)))
+ DECL_ATTRIBUTES (vnode->decl)))
return true;
/* See if we have linker information about symbol not being used or
Even if the linker clams the symbol is unused, never bring internal
symbols that are declared by user as used or externally visible.
This is needed for i.e. references from asm statements. */
- if (symtab_used_from_object_file_p ((symtab_node) vnode))
+ if (symtab_used_from_object_file_p (vnode))
return true;
- if (vnode->symbol.resolution == LDPR_PREVAILING_DEF_IRONLY)
+ if (vnode->resolution == LDPR_PREVAILING_DEF_IRONLY)
return false;
/* As a special case, the COMDAT virtual tables can be unshared.
is faster for dynamic linking. Also this match logic hidding vtables
from LTO symbol tables. */
if ((in_lto_p || flag_whole_program)
- && DECL_COMDAT (vnode->symbol.decl)
- && comdat_can_be_unshared_p ((symtab_node) vnode))
+ && DECL_COMDAT (vnode->decl)
+ && comdat_can_be_unshared_p (vnode))
return false;
/* When doing link time optimizations, hidden symbols become local. */
if (in_lto_p
- && (DECL_VISIBILITY (vnode->symbol.decl) == VISIBILITY_HIDDEN
- || DECL_VISIBILITY (vnode->symbol.decl) == VISIBILITY_INTERNAL)
+ && (DECL_VISIBILITY (vnode->decl) == VISIBILITY_HIDDEN
+ || DECL_VISIBILITY (vnode->decl) == VISIBILITY_INTERNAL)
/* Be sure that node is defined in IR file, not in other object
file. In that case we don't set used_from_other_object_file. */
- && vnode->symbol.definition)
+ && vnode->definition)
;
else if (!flag_whole_program)
return true;
FIXME: We can do so for readonly vars with no address taken and
possibly also for vtables since no direct pointer comparsion is done.
It might be interesting to do so to reduce linking overhead. */
- if (DECL_COMDAT (vnode->symbol.decl) || DECL_WEAK (vnode->symbol.decl))
+ if (DECL_COMDAT (vnode->decl) || DECL_WEAK (vnode->decl))
return true;
return false;
}
FOR_EACH_FUNCTION (node)
{
- int flags = flags_from_decl_or_type (node->symbol.decl);
+ int flags = flags_from_decl_or_type (node->decl);
/* Optimize away PURE and CONST constructors and destructors. */
if (optimize
&& (flags & (ECF_CONST | ECF_PURE))
&& !(flags & ECF_LOOPING_CONST_OR_PURE))
{
- DECL_STATIC_CONSTRUCTOR (node->symbol.decl) = 0;
- DECL_STATIC_DESTRUCTOR (node->symbol.decl) = 0;
+ DECL_STATIC_CONSTRUCTOR (node->decl) = 0;
+ DECL_STATIC_DESTRUCTOR (node->decl) = 0;
}
/* Frontends and alias code marks nodes as needed before parsing is finished.
We may end up marking as node external nodes where this flag is meaningless
strip it. */
- if (DECL_EXTERNAL (node->symbol.decl) || !node->symbol.definition)
+ if (DECL_EXTERNAL (node->decl) || !node->definition)
{
- node->symbol.force_output = 0;
- node->symbol.forced_by_abi = 0;
+ node->force_output = 0;
+ node->forced_by_abi = 0;
}
/* C++ FE on lack of COMDAT support create local COMDAT functions
(that ought to be shared but can not due to object format
limitations). It is necessary to keep the flag to make rest of C++ FE
happy. Clear the flag here to avoid confusion in middle-end. */
- if (DECL_COMDAT (node->symbol.decl) && !TREE_PUBLIC (node->symbol.decl))
- DECL_COMDAT (node->symbol.decl) = 0;
+ if (DECL_COMDAT (node->decl) && !TREE_PUBLIC (node->decl))
+ DECL_COMDAT (node->decl) = 0;
/* For external decls stop tracking same_comdat_group. It doesn't matter
what comdat group they are in when they won't be emitted in this TU. */
- if (node->symbol.same_comdat_group && DECL_EXTERNAL (node->symbol.decl))
+ if (node->same_comdat_group && DECL_EXTERNAL (node->decl))
{
#ifdef ENABLE_CHECKING
symtab_node n;
- for (n = node->symbol.same_comdat_group;
- n != (symtab_node)node;
- n = n->symbol.same_comdat_group)
+ for (n = node->same_comdat_group;
+ n != node;
+ n = n->same_comdat_group)
/* If at least one of same comdat group functions is external,
all of them have to be, otherwise it is a front-end bug. */
- gcc_assert (DECL_EXTERNAL (n->symbol.decl));
+ gcc_assert (DECL_EXTERNAL (n->decl));
#endif
- symtab_dissolve_same_comdat_group_list ((symtab_node) node);
+ symtab_dissolve_same_comdat_group_list (node);
}
- gcc_assert ((!DECL_WEAK (node->symbol.decl)
- && !DECL_COMDAT (node->symbol.decl))
- || TREE_PUBLIC (node->symbol.decl)
- || node->symbol.weakref
- || DECL_EXTERNAL (node->symbol.decl));
+ gcc_assert ((!DECL_WEAK (node->decl)
+ && !DECL_COMDAT (node->decl))
+ || TREE_PUBLIC (node->decl)
+ || node->weakref
+ || DECL_EXTERNAL (node->decl));
if (cgraph_externally_visible_p (node, whole_program))
{
gcc_assert (!node->global.inlined_to);
- node->symbol.externally_visible = true;
+ node->externally_visible = true;
}
else
{
- node->symbol.externally_visible = false;
- node->symbol.forced_by_abi = false;
+ node->externally_visible = false;
+ node->forced_by_abi = false;
}
- if (!node->symbol.externally_visible
- && node->symbol.definition && !node->symbol.weakref
- && !DECL_EXTERNAL (node->symbol.decl))
+ if (!node->externally_visible
+ && node->definition && !node->weakref
+ && !DECL_EXTERNAL (node->decl))
{
gcc_assert (whole_program || in_lto_p
- || !TREE_PUBLIC (node->symbol.decl));
- node->symbol.unique_name = ((node->symbol.resolution == LDPR_PREVAILING_DEF_IRONLY
- || node->symbol.resolution == LDPR_PREVAILING_DEF_IRONLY_EXP)
- && TREE_PUBLIC (node->symbol.decl));
- symtab_make_decl_local (node->symbol.decl);
- node->symbol.resolution = LDPR_PREVAILING_DEF_IRONLY;
- if (node->symbol.same_comdat_group)
+ || !TREE_PUBLIC (node->decl));
+ node->unique_name = ((node->resolution == LDPR_PREVAILING_DEF_IRONLY
+ || node->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP)
+ && TREE_PUBLIC (node->decl));
+ symtab_make_decl_local (node->decl);
+ node->resolution = LDPR_PREVAILING_DEF_IRONLY;
+ if (node->same_comdat_group)
/* cgraph_externally_visible_p has already checked all other nodes
in the group and they will all be made local. We need to
dissolve the group at once so that the predicate does not
segfault though. */
- symtab_dissolve_same_comdat_group_list ((symtab_node) node);
+ symtab_dissolve_same_comdat_group_list (node);
}
if (node->thunk.thunk_p
- && TREE_PUBLIC (node->symbol.decl))
+ && TREE_PUBLIC (node->decl))
{
struct cgraph_node *decl_node = node;
/* Thunks have the same visibility as function they are attached to.
Make sure the C++ front end set this up properly. */
- if (DECL_ONE_ONLY (decl_node->symbol.decl))
+ if (DECL_ONE_ONLY (decl_node->decl))
{
- gcc_checking_assert (DECL_COMDAT (node->symbol.decl)
- == DECL_COMDAT (decl_node->symbol.decl));
- gcc_checking_assert (DECL_COMDAT_GROUP (node->symbol.decl)
- == DECL_COMDAT_GROUP (decl_node->symbol.decl));
- gcc_checking_assert (node->symbol.same_comdat_group);
+ gcc_checking_assert (DECL_COMDAT (node->decl)
+ == DECL_COMDAT (decl_node->decl));
+ gcc_checking_assert (DECL_COMDAT_GROUP (node->decl)
+ == DECL_COMDAT_GROUP (decl_node->decl));
+ gcc_checking_assert (node->same_comdat_group);
}
- if (DECL_EXTERNAL (decl_node->symbol.decl))
- DECL_EXTERNAL (node->symbol.decl) = 1;
+ if (DECL_EXTERNAL (decl_node->decl))
+ DECL_EXTERNAL (node->decl) = 1;
}
}
FOR_EACH_DEFINED_FUNCTION (node)
cheaper and enable more optimization.
TODO: We can also update virtual tables. */
- if (node->callers && can_replace_by_local_alias ((symtab_node)node))
+ if (node->callers && can_replace_by_local_alias (node))
{
- struct cgraph_node *alias = cgraph (symtab_nonoverwritable_alias ((symtab_node) node));
+ struct cgraph_node *alias = cgraph (symtab_nonoverwritable_alias (node));
if (alias && alias != node)
{
struct cgraph_edge *e = node->callers;
cgraph_redirect_edge_callee (e, alias);
- if (gimple_has_body_p (e->caller->symbol.decl))
+ if (gimple_has_body_p (e->caller->decl))
{
- push_cfun (DECL_STRUCT_FUNCTION (e->caller->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (e->caller->decl));
cgraph_redirect_edge_call_stmt_to_callee (e);
pop_cfun ();
}
FOR_EACH_VARIABLE (vnode)
{
/* weak flag makes no sense on local variables. */
- gcc_assert (!DECL_WEAK (vnode->symbol.decl)
- || vnode->symbol.weakref
- || TREE_PUBLIC (vnode->symbol.decl)
- || DECL_EXTERNAL (vnode->symbol.decl));
+ gcc_assert (!DECL_WEAK (vnode->decl)
+ || vnode->weakref
+ || TREE_PUBLIC (vnode->decl)
+ || DECL_EXTERNAL (vnode->decl));
/* In several cases declarations can not be common:
- when declaration has initializer
static int a __attribute__ ((common))
Canonicalize things here and clear the redundant flag. */
- if (DECL_COMMON (vnode->symbol.decl)
- && (!(TREE_PUBLIC (vnode->symbol.decl)
- || DECL_EXTERNAL (vnode->symbol.decl))
- || (DECL_INITIAL (vnode->symbol.decl)
- && DECL_INITIAL (vnode->symbol.decl) != error_mark_node)
- || DECL_WEAK (vnode->symbol.decl)
- || DECL_SECTION_NAME (vnode->symbol.decl) != NULL
+ if (DECL_COMMON (vnode->decl)
+ && (!(TREE_PUBLIC (vnode->decl)
+ || DECL_EXTERNAL (vnode->decl))
+ || (DECL_INITIAL (vnode->decl)
+ && DECL_INITIAL (vnode->decl) != error_mark_node)
+ || DECL_WEAK (vnode->decl)
+ || DECL_SECTION_NAME (vnode->decl) != NULL
|| ! (ADDR_SPACE_GENERIC_P
- (TYPE_ADDR_SPACE (TREE_TYPE (vnode->symbol.decl))))))
- DECL_COMMON (vnode->symbol.decl) = 0;
+ (TYPE_ADDR_SPACE (TREE_TYPE (vnode->decl))))))
+ DECL_COMMON (vnode->decl) = 0;
}
FOR_EACH_DEFINED_VARIABLE (vnode)
{
- if (!vnode->symbol.definition)
+ if (!vnode->definition)
continue;
if (varpool_externally_visible_p (vnode))
- vnode->symbol.externally_visible = true;
+ vnode->externally_visible = true;
else
{
- vnode->symbol.externally_visible = false;
- vnode->symbol.forced_by_abi = false;
+ vnode->externally_visible = false;
+ vnode->forced_by_abi = false;
}
- if (!vnode->symbol.externally_visible
- && !vnode->symbol.weakref)
+ if (!vnode->externally_visible
+ && !vnode->weakref)
{
- gcc_assert (in_lto_p || whole_program || !TREE_PUBLIC (vnode->symbol.decl));
- vnode->symbol.unique_name = ((vnode->symbol.resolution == LDPR_PREVAILING_DEF_IRONLY
- || vnode->symbol.resolution == LDPR_PREVAILING_DEF_IRONLY_EXP)
- && TREE_PUBLIC (vnode->symbol.decl));
- symtab_make_decl_local (vnode->symbol.decl);
- if (vnode->symbol.same_comdat_group)
- symtab_dissolve_same_comdat_group_list ((symtab_node) vnode);
- vnode->symbol.resolution = LDPR_PREVAILING_DEF_IRONLY;
+ gcc_assert (in_lto_p || whole_program || !TREE_PUBLIC (vnode->decl));
+ vnode->unique_name = ((vnode->resolution == LDPR_PREVAILING_DEF_IRONLY
+ || vnode->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP)
+ && TREE_PUBLIC (vnode->decl));
+ symtab_make_decl_local (vnode->decl);
+ if (vnode->same_comdat_group)
+ symtab_dissolve_same_comdat_group_list (vnode);
+ vnode->resolution = LDPR_PREVAILING_DEF_IRONLY;
}
}
fprintf (dump_file, "\n\n");
fprintf (dump_file, "\nMarking externally visible functions:");
FOR_EACH_DEFINED_FUNCTION (node)
- if (node->symbol.externally_visible)
+ if (node->externally_visible)
fprintf (dump_file, " %s", cgraph_node_name (node));
fprintf (dump_file, "\n\n");
fprintf (dump_file, "\nMarking externally visible variables:");
FOR_EACH_DEFINED_VARIABLE (vnode)
- if (vnode->symbol.externally_visible)
+ if (vnode->externally_visible)
fprintf (dump_file, " %s", varpool_node_name (vnode));
fprintf (dump_file, "\n\n");
}
static void
record_cdtor_fn (struct cgraph_node *node)
{
- if (DECL_STATIC_CONSTRUCTOR (node->symbol.decl))
- static_ctors.safe_push (node->symbol.decl);
- if (DECL_STATIC_DESTRUCTOR (node->symbol.decl))
- static_dtors.safe_push (node->symbol.decl);
- node = cgraph_get_node (node->symbol.decl);
- DECL_DISREGARD_INLINE_LIMITS (node->symbol.decl) = 1;
+ if (DECL_STATIC_CONSTRUCTOR (node->decl))
+ static_ctors.safe_push (node->decl);
+ if (DECL_STATIC_DESTRUCTOR (node->decl))
+ static_dtors.safe_push (node->decl);
+ node = cgraph_get_node (node->decl);
+ DECL_DISREGARD_INLINE_LIMITS (node->decl) = 1;
}
/* Define global constructors/destructor functions for the CDTORS, of
{
struct cgraph_node *node;
FOR_EACH_DEFINED_FUNCTION (node)
- if (DECL_STATIC_CONSTRUCTOR (node->symbol.decl)
- || DECL_STATIC_DESTRUCTOR (node->symbol.decl))
+ if (DECL_STATIC_CONSTRUCTOR (node->decl)
+ || DECL_STATIC_DESTRUCTOR (node->decl))
record_cdtor_fn (node);
build_cdtor_fns ();
static_ctors.release ();
inline bool
is_a_helper <cgraph_node>::test (symtab_node_base *p)
{
- return p->symbol.type == SYMTAB_FUNCTION;
+ return p->type == SYMTAB_FUNCTION;
}
If a simple reinterpret_cast between the pointer types is incorrect, then you
+2013-10-29 David Malcolm <dmalcolm@redhat.com>
+
+ Patch autogenerated by refactor_symtab.py from
+ https://github.com/davidmalcolm/gcc-refactoring-scripts
+ revision 58bb219cc090b2f4516a9297d868c245495ee622
+
+ * decl.c (java_mark_decl_local): Update for conversion of symtab types
+ to a true class hierarchy.
+
2013-10-14 David Malcolm <dmalcolm@redhat.com>
* lang.c (java_handle_option): Update for introduction of
if (TREE_CODE (decl) == FUNCTION_DECL)
{
struct cgraph_node *node = cgraph_get_node (decl);
- gcc_assert (!node || !node->symbol.definition);
+ gcc_assert (!node || !node->definition);
}
#endif
gcc_assert (!DECL_RTL_SET_P (decl));
lto_symtab_encoder_encode_body_p (lto_symtab_encoder_t encoder,
struct cgraph_node *node)
{
- int index = lto_symtab_encoder_lookup (encoder, (symtab_node)node);
+ int index = lto_symtab_encoder_lookup (encoder, node);
return encoder->nodes[index].body;
}
lto_set_symtab_encoder_encode_body (lto_symtab_encoder_t encoder,
struct cgraph_node *node)
{
- int index = lto_symtab_encoder_encode (encoder, (symtab_node)node);
- gcc_checking_assert (encoder->nodes[index].node == (symtab_node)node);
+ int index = lto_symtab_encoder_encode (encoder, node);
+ gcc_checking_assert (encoder->nodes[index].node == node);
encoder->nodes[index].body = true;
}
lto_symtab_encoder_encode_initializer_p (lto_symtab_encoder_t encoder,
struct varpool_node *node)
{
- int index = lto_symtab_encoder_lookup (encoder, (symtab_node)node);
+ int index = lto_symtab_encoder_lookup (encoder, node);
if (index == LCC_NOT_FOUND)
return false;
return encoder->nodes[index].initializer;
lto_set_symtab_encoder_encode_initializer (lto_symtab_encoder_t encoder,
struct varpool_node *node)
{
- int index = lto_symtab_encoder_lookup (encoder, (symtab_node)node);
+ int index = lto_symtab_encoder_lookup (encoder, node);
encoder->nodes[index].initializer = true;
}
lto_symtab_encoder_in_partition_p (lto_symtab_encoder_t encoder,
symtab_node node)
{
- int index = lto_symtab_encoder_lookup (encoder, (symtab_node)node);
+ int index = lto_symtab_encoder_lookup (encoder, node);
if (index == LCC_NOT_FOUND)
return false;
return encoder->nodes[index].in_partition;
lto_set_symtab_encoder_in_partition (lto_symtab_encoder_t encoder,
symtab_node node)
{
- int index = lto_symtab_encoder_encode (encoder, (symtab_node)node);
+ int index = lto_symtab_encoder_encode (encoder, node);
encoder->nodes[index].in_partition = true;
}
streamer_write_enum (ob->main_stream, LTO_symtab_tags, LTO_symtab_last_tag,
LTO_symtab_edge);
- ref = lto_symtab_encoder_lookup (encoder, (symtab_node)edge->caller);
+ ref = lto_symtab_encoder_lookup (encoder, edge->caller);
gcc_assert (ref != LCC_NOT_FOUND);
streamer_write_hwi_stream (ob->main_stream, ref);
if (!edge->indirect_unknown_callee)
{
- ref = lto_symtab_encoder_lookup (encoder, (symtab_node)edge->callee);
+ ref = lto_symtab_encoder_lookup (encoder, edge->callee);
gcc_assert (ref != LCC_NOT_FOUND);
streamer_write_hwi_stream (ob->main_stream, ref);
}
streamer_write_gcov_count_stream (ob->main_stream, edge->count);
bp = bitpack_create (ob->main_stream);
- uid = (!gimple_has_body_p (edge->caller->symbol.decl)
+ uid = (!gimple_has_body_p (edge->caller->decl)
? edge->lto_stmt_uid : gimple_uid (edge->call_stmt) + 1);
bp_pack_enum (&bp, cgraph_inline_failed_enum,
CIF_N_REASONS, edge->inline_failed);
struct ipa_ref *ref;
for (i = 0; ipa_ref_list_referring_iterate (list, i, ref); i++)
{
- if (ref->referring->symbol.in_other_partition
+ if (ref->referring->in_other_partition
|| !lto_symtab_encoder_in_partition_p (encoder, ref->referring))
return true;
}
reachable_from_other_partition_p (struct cgraph_node *node, lto_symtab_encoder_t encoder)
{
struct cgraph_edge *e;
- if (!node->symbol.definition)
+ if (!node->definition)
return false;
if (node->global.inlined_to)
return false;
for (e = node->callers; e; e = e->next_caller)
- if (e->caller->symbol.in_other_partition
- || !lto_symtab_encoder_in_partition_p (encoder, (symtab_node)e->caller))
+ if (e->caller->in_other_partition
+ || !lto_symtab_encoder_in_partition_p (encoder, e->caller))
return true;
return false;
}
{
struct cgraph_edge *e;
for (e = node->callers; e; e = e->next_caller)
- if (lto_symtab_encoder_in_partition_p (encoder, (symtab_node)e->caller))
+ if (lto_symtab_encoder_in_partition_p (encoder, e->caller))
return true;
return false;
}
int i;
bool alias_p;
- boundary_p = !lto_symtab_encoder_in_partition_p (encoder, (symtab_node)node);
+ boundary_p = !lto_symtab_encoder_in_partition_p (encoder, node);
- if (node->symbol.analyzed && !boundary_p)
+ if (node->analyzed && !boundary_p)
tag = LTO_symtab_analyzed_node;
else
tag = LTO_symtab_unavail_node;
streamer_write_enum (ob->main_stream, LTO_symtab_tags, LTO_symtab_last_tag,
tag);
- streamer_write_hwi_stream (ob->main_stream, node->symbol.order);
+ streamer_write_hwi_stream (ob->main_stream, node->order);
/* In WPA mode, we only output part of the call-graph. Also, we
fake cgraph node attributes. There are two cases that we care.
Cherry-picked nodes: These are nodes we pulled from other
translation units into SET during IPA-inlining. We make them as
local static nodes to prevent clashes with other local statics. */
- if (boundary_p && node->symbol.analyzed && !DECL_EXTERNAL (node->symbol.decl))
+ if (boundary_p && node->analyzed && !DECL_EXTERNAL (node->decl))
{
/* Inline clones can not be part of boundary.
gcc_assert (!node->global.inlined_to);
clone_of = node->clone_of;
while (clone_of
- && (ref = lto_symtab_encoder_lookup (encoder, (symtab_node)clone_of)) == LCC_NOT_FOUND)
+ && (ref = lto_symtab_encoder_lookup (encoder, clone_of)) == LCC_NOT_FOUND)
if (clone_of->prev_sibling_clone)
clone_of = clone_of->prev_sibling_clone;
else
streamer_write_hwi_stream (ob->main_stream, ref);
- lto_output_fn_decl_index (ob->decl_state, ob->main_stream, node->symbol.decl);
+ lto_output_fn_decl_index (ob->decl_state, ob->main_stream, node->decl);
streamer_write_gcov_count_stream (ob->main_stream, node->count);
streamer_write_hwi_stream (ob->main_stream, node->count_materialization_scale);
{
if (node->global.inlined_to)
{
- ref = lto_symtab_encoder_lookup (encoder, (symtab_node)node->global.inlined_to);
+ ref = lto_symtab_encoder_lookup (encoder, node->global.inlined_to);
gcc_assert (ref != LCC_NOT_FOUND);
}
else
streamer_write_hwi_stream (ob->main_stream, ref);
}
- if (node->symbol.same_comdat_group && !boundary_p)
+ if (node->same_comdat_group && !boundary_p)
{
ref = lto_symtab_encoder_lookup (encoder,
- node->symbol.same_comdat_group);
+ node->same_comdat_group);
gcc_assert (ref != LCC_NOT_FOUND);
}
else
bp = bitpack_create (ob->main_stream);
bp_pack_value (&bp, node->local.local, 1);
- bp_pack_value (&bp, node->symbol.externally_visible, 1);
- bp_pack_value (&bp, node->symbol.definition, 1);
+ bp_pack_value (&bp, node->externally_visible, 1);
+ bp_pack_value (&bp, node->definition, 1);
bp_pack_value (&bp, node->local.versionable, 1);
bp_pack_value (&bp, node->local.can_change_signature, 1);
bp_pack_value (&bp, node->local.redefined_extern_inline, 1);
- bp_pack_value (&bp, node->symbol.force_output, 1);
- bp_pack_value (&bp, node->symbol.forced_by_abi, 1);
- bp_pack_value (&bp, node->symbol.unique_name, 1);
- bp_pack_value (&bp, node->symbol.address_taken, 1);
+ bp_pack_value (&bp, node->force_output, 1);
+ bp_pack_value (&bp, node->forced_by_abi, 1);
+ bp_pack_value (&bp, node->unique_name, 1);
+ bp_pack_value (&bp, node->address_taken, 1);
bp_pack_value (&bp, tag == LTO_symtab_analyzed_node
- && !DECL_EXTERNAL (node->symbol.decl)
- && !DECL_COMDAT (node->symbol.decl)
+ && !DECL_EXTERNAL (node->decl)
+ && !DECL_COMDAT (node->decl)
&& (reachable_from_other_partition_p (node, encoder)
- || referenced_from_other_partition_p (&node->symbol.ref_list,
+ || referenced_from_other_partition_p (&node->ref_list,
encoder)), 1);
bp_pack_value (&bp, node->lowered, 1);
bp_pack_value (&bp, in_other_partition, 1);
defined in other unit, we may use the info on aliases to resolve
symbol1 != symbol2 type tests that we can do only for locally defined objects
otherwise. */
- alias_p = node->symbol.alias && (!boundary_p || node->symbol.weakref);
+ alias_p = node->alias && (!boundary_p || node->weakref);
bp_pack_value (&bp, alias_p, 1);
- bp_pack_value (&bp, node->symbol.weakref, 1);
+ bp_pack_value (&bp, node->weakref, 1);
bp_pack_value (&bp, node->frequency, 2);
bp_pack_value (&bp, node->only_called_at_startup, 1);
bp_pack_value (&bp, node->only_called_at_exit, 1);
bp_pack_value (&bp, node->tm_clone, 1);
bp_pack_value (&bp, node->thunk.thunk_p && !boundary_p, 1);
bp_pack_enum (&bp, ld_plugin_symbol_resolution,
- LDPR_NUM_KNOWN, node->symbol.resolution);
+ LDPR_NUM_KNOWN, node->resolution);
streamer_write_bitpack (&bp);
if (node->thunk.thunk_p && !boundary_p)
lto_output_varpool_node (struct lto_simple_output_block *ob, struct varpool_node *node,
lto_symtab_encoder_t encoder)
{
- bool boundary_p = !lto_symtab_encoder_in_partition_p (encoder, (symtab_node)node);
+ bool boundary_p = !lto_symtab_encoder_in_partition_p (encoder, node);
struct bitpack_d bp;
int ref;
bool alias_p;
streamer_write_enum (ob->main_stream, LTO_symtab_tags, LTO_symtab_last_tag,
LTO_symtab_variable);
- streamer_write_hwi_stream (ob->main_stream, node->symbol.order);
- lto_output_var_decl_index (ob->decl_state, ob->main_stream, node->symbol.decl);
+ streamer_write_hwi_stream (ob->main_stream, node->order);
+ lto_output_var_decl_index (ob->decl_state, ob->main_stream, node->decl);
bp = bitpack_create (ob->main_stream);
- bp_pack_value (&bp, node->symbol.externally_visible, 1);
- bp_pack_value (&bp, node->symbol.force_output, 1);
- bp_pack_value (&bp, node->symbol.forced_by_abi, 1);
- bp_pack_value (&bp, node->symbol.unique_name, 1);
- bp_pack_value (&bp, node->symbol.definition, 1);
- alias_p = node->symbol.alias && (!boundary_p || node->symbol.weakref);
+ bp_pack_value (&bp, node->externally_visible, 1);
+ bp_pack_value (&bp, node->force_output, 1);
+ bp_pack_value (&bp, node->forced_by_abi, 1);
+ bp_pack_value (&bp, node->unique_name, 1);
+ bp_pack_value (&bp, node->definition, 1);
+ alias_p = node->alias && (!boundary_p || node->weakref);
bp_pack_value (&bp, alias_p, 1);
- bp_pack_value (&bp, node->symbol.weakref, 1);
- bp_pack_value (&bp, node->symbol.analyzed && !boundary_p, 1);
- gcc_assert (node->symbol.definition || !node->symbol.analyzed);
+ bp_pack_value (&bp, node->weakref, 1);
+ bp_pack_value (&bp, node->analyzed && !boundary_p, 1);
+ gcc_assert (node->definition || !node->analyzed);
/* Constant pool initializers can be de-unified into individual ltrans units.
FIXME: Alternatively at -Os we may want to avoid generating for them the local
labels and share them across LTRANS partitions. */
- if (DECL_IN_CONSTANT_POOL (node->symbol.decl)
- && !DECL_EXTERNAL (node->symbol.decl)
- && !DECL_COMDAT (node->symbol.decl))
+ if (DECL_IN_CONSTANT_POOL (node->decl)
+ && !DECL_EXTERNAL (node->decl)
+ && !DECL_COMDAT (node->decl))
{
bp_pack_value (&bp, 0, 1); /* used_from_other_parition. */
bp_pack_value (&bp, 0, 1); /* in_other_partition. */
}
else
{
- bp_pack_value (&bp, node->symbol.definition
- && referenced_from_other_partition_p (&node->symbol.ref_list,
+ bp_pack_value (&bp, node->definition
+ && referenced_from_other_partition_p (&node->ref_list,
encoder), 1);
- bp_pack_value (&bp, node->symbol.analyzed
- && boundary_p && !DECL_EXTERNAL (node->symbol.decl), 1);
+ bp_pack_value (&bp, node->analyzed
+ && boundary_p && !DECL_EXTERNAL (node->decl), 1);
/* in_other_partition. */
}
streamer_write_bitpack (&bp);
- if (node->symbol.same_comdat_group && !boundary_p)
+ if (node->same_comdat_group && !boundary_p)
{
ref = lto_symtab_encoder_lookup (encoder,
- node->symbol.same_comdat_group);
+ node->same_comdat_group);
gcc_assert (ref != LCC_NOT_FOUND);
}
else
ref = LCC_NOT_FOUND;
streamer_write_hwi_stream (ob->main_stream, ref);
streamer_write_enum (ob->main_stream, ld_plugin_symbol_resolution,
- LDPR_NUM_KNOWN, node->symbol.resolution);
+ LDPR_NUM_KNOWN, node->resolution);
}
/* Output the varpool NODE to OB.
{
symtab_node node = lsei_node (lsei);
- count = ipa_ref_list_nreferences (&node->symbol.ref_list);
+ count = ipa_ref_list_nreferences (&node->ref_list);
if (count)
{
streamer_write_gcov_count_stream (ob->main_stream, count);
streamer_write_uhwi_stream (ob->main_stream,
lto_symtab_encoder_lookup (encoder, node));
- for (i = 0; ipa_ref_list_reference_iterate (&node->symbol.ref_list,
+ for (i = 0; ipa_ref_list_reference_iterate (&node->ref_list,
i, ref); i++)
lto_output_ref (ob, ref, encoder);
}
add_node_to (encoder, node->clone_of, include_body);
else if (include_body)
lto_set_symtab_encoder_encode_body (encoder, node);
- lto_symtab_encoder_encode (encoder, (symtab_node)node);
+ lto_symtab_encoder_encode (encoder, node);
}
/* Add all references in LIST to encoders. */
{
node = lsei_cgraph_node (lsei);
add_node_to (encoder, node, true);
- lto_set_symtab_encoder_in_partition (encoder, (symtab_node)node);
- add_references (encoder, &node->symbol.ref_list);
+ lto_set_symtab_encoder_in_partition (encoder, node);
+ add_references (encoder, &node->ref_list);
/* For proper debug info, we need to ship the origins, too. */
- if (DECL_ABSTRACT_ORIGIN (node->symbol.decl))
+ if (DECL_ABSTRACT_ORIGIN (node->decl))
{
struct cgraph_node *origin_node
- = cgraph_get_node (DECL_ABSTRACT_ORIGIN (node->symbol.decl));
+ = cgraph_get_node (DECL_ABSTRACT_ORIGIN (node->decl));
add_node_to (encoder, origin_node, true);
}
}
{
struct varpool_node *vnode = lsei_varpool_node (lsei);
- lto_set_symtab_encoder_in_partition (encoder, (symtab_node)vnode);
+ lto_set_symtab_encoder_in_partition (encoder, vnode);
lto_set_symtab_encoder_encode_initializer (encoder, vnode);
- add_references (encoder, &vnode->symbol.ref_list);
+ add_references (encoder, &vnode->ref_list);
/* For proper debug info, we need to ship the origins, too. */
- if (DECL_ABSTRACT_ORIGIN (vnode->symbol.decl))
+ if (DECL_ABSTRACT_ORIGIN (vnode->decl))
{
struct varpool_node *origin_node
- = varpool_get_node (DECL_ABSTRACT_ORIGIN (node->symbol.decl));
- lto_set_symtab_encoder_in_partition (encoder, (symtab_node)origin_node);
+ = varpool_get_node (DECL_ABSTRACT_ORIGIN (node->decl));
+ lto_set_symtab_encoder_in_partition (encoder, origin_node);
}
}
/* Pickle in also the initializer of all referenced readonly variables
{
if (!lto_symtab_encoder_encode_initializer_p (encoder,
vnode)
- && ctor_for_folding (vnode->symbol.decl) != error_mark_node)
+ && ctor_for_folding (vnode->decl) != error_mark_node)
{
lto_set_symtab_encoder_encode_initializer (encoder, vnode);
- add_references (encoder, &vnode->symbol.ref_list);
+ add_references (encoder, &vnode->ref_list);
}
}
}
for (edge = node->callees; edge; edge = edge->next_callee)
{
struct cgraph_node *callee = edge->callee;
- if (!lto_symtab_encoder_in_partition_p (encoder, (symtab_node)callee))
+ if (!lto_symtab_encoder_in_partition_p (encoder, callee))
{
/* We should have moved all the inlines. */
gcc_assert (!callee->global.inlined_to);
/* Adding an external declarations into the unit serves
no purpose and just increases its boundary. */
- if (callee->symbol.definition
+ if (callee->definition
&& !lto_symtab_encoder_in_partition_p
- (encoder, (symtab_node)callee))
+ (encoder, callee))
{
gcc_assert (!callee->global.inlined_to);
add_node_to (encoder, callee, false);
enum LTO_symtab_tags tag,
struct bitpack_d *bp)
{
- node->symbol.aux = (void *) tag;
- node->symbol.lto_file_data = file_data;
+ node->aux = (void *) tag;
+ node->lto_file_data = file_data;
node->local.local = bp_unpack_value (bp, 1);
- node->symbol.externally_visible = bp_unpack_value (bp, 1);
- node->symbol.definition = bp_unpack_value (bp, 1);
+ node->externally_visible = bp_unpack_value (bp, 1);
+ node->definition = bp_unpack_value (bp, 1);
node->local.versionable = bp_unpack_value (bp, 1);
node->local.can_change_signature = bp_unpack_value (bp, 1);
node->local.redefined_extern_inline = bp_unpack_value (bp, 1);
- node->symbol.force_output = bp_unpack_value (bp, 1);
- node->symbol.forced_by_abi = bp_unpack_value (bp, 1);
- node->symbol.unique_name = bp_unpack_value (bp, 1);
- node->symbol.address_taken = bp_unpack_value (bp, 1);
- node->symbol.used_from_other_partition = bp_unpack_value (bp, 1);
+ node->force_output = bp_unpack_value (bp, 1);
+ node->forced_by_abi = bp_unpack_value (bp, 1);
+ node->unique_name = bp_unpack_value (bp, 1);
+ node->address_taken = bp_unpack_value (bp, 1);
+ node->used_from_other_partition = bp_unpack_value (bp, 1);
node->lowered = bp_unpack_value (bp, 1);
- node->symbol.analyzed = tag == LTO_symtab_analyzed_node;
- node->symbol.in_other_partition = bp_unpack_value (bp, 1);
- if (node->symbol.in_other_partition
+ node->analyzed = tag == LTO_symtab_analyzed_node;
+ node->in_other_partition = bp_unpack_value (bp, 1);
+ if (node->in_other_partition
/* Avoid updating decl when we are seeing just inline clone.
When inlining function that has functions already inlined into it,
we produce clones of inline clones.
we might end up streaming inline clone from other partition
to support clone we are interested in. */
&& (!node->clone_of
- || node->clone_of->symbol.decl != node->symbol.decl))
+ || node->clone_of->decl != node->decl))
{
- DECL_EXTERNAL (node->symbol.decl) = 1;
- TREE_STATIC (node->symbol.decl) = 0;
+ DECL_EXTERNAL (node->decl) = 1;
+ TREE_STATIC (node->decl) = 0;
}
- node->symbol.alias = bp_unpack_value (bp, 1);
- node->symbol.weakref = bp_unpack_value (bp, 1);
+ node->alias = bp_unpack_value (bp, 1);
+ node->weakref = bp_unpack_value (bp, 1);
node->frequency = (enum node_frequency)bp_unpack_value (bp, 2);
node->only_called_at_startup = bp_unpack_value (bp, 1);
node->only_called_at_exit = bp_unpack_value (bp, 1);
node->tm_clone = bp_unpack_value (bp, 1);
node->thunk.thunk_p = bp_unpack_value (bp, 1);
- node->symbol.resolution = bp_unpack_enum (bp, ld_plugin_symbol_resolution,
+ node->resolution = bp_unpack_enum (bp, ld_plugin_symbol_resolution,
LDPR_NUM_KNOWN);
}
from other input file. We keep cgraph unmerged until after streaming
of ipa passes is done. Alays forcingly create a fresh node. */
node = cgraph_create_empty_node ();
- node->symbol.decl = fn_decl;
- symtab_register_node ((symtab_node)node);
+ node->decl = fn_decl;
+ symtab_register_node (node);
}
- node->symbol.order = order;
+ node->order = order;
if (order >= symtab_order)
symtab_order = order + 1;
have already been read will have their tag stored in the 'aux'
field. Since built-in functions can be referenced in multiple
functions, they are expected to be read more than once. */
- if (node->symbol.aux && !DECL_BUILT_IN (node->symbol.decl))
+ if (node->aux && !DECL_BUILT_IN (node->decl))
internal_error ("bytecode stream: found multiple instances of cgraph "
"node with uid %d", node->uid);
node->global.inlined_to = (cgraph_node_ptr) (intptr_t) ref;
/* Store a reference for now, and fix up later to be a pointer. */
- node->symbol.same_comdat_group = (symtab_node) (intptr_t) ref2;
+ node->same_comdat_group = (symtab_node) (intptr_t) ref2;
if (node->thunk.thunk_p)
{
node->thunk.virtual_value = virtual_value;
node->thunk.virtual_offset_p = (type & 4);
}
- if (node->symbol.alias && !node->symbol.analyzed && node->symbol.weakref)
- node->symbol.alias_target = get_alias_symbol (node->symbol.decl);
+ if (node->alias && !node->analyzed && node->weakref)
+ node->alias_target = get_alias_symbol (node->decl);
node->profile_id = streamer_read_hwi (ib);
return node;
}
from other input file. We keep cgraph unmerged until after streaming
of ipa passes is done. Alays forcingly create a fresh node. */
node = varpool_create_empty_node ();
- node->symbol.decl = var_decl;
- symtab_register_node ((symtab_node)node);
+ node->decl = var_decl;
+ symtab_register_node (node);
- node->symbol.order = order;
+ node->order = order;
if (order >= symtab_order)
symtab_order = order + 1;
- node->symbol.lto_file_data = file_data;
+ node->lto_file_data = file_data;
bp = streamer_read_bitpack (ib);
- node->symbol.externally_visible = bp_unpack_value (&bp, 1);
- node->symbol.force_output = bp_unpack_value (&bp, 1);
- node->symbol.forced_by_abi = bp_unpack_value (&bp, 1);
- node->symbol.unique_name = bp_unpack_value (&bp, 1);
- node->symbol.definition = bp_unpack_value (&bp, 1);
- node->symbol.alias = bp_unpack_value (&bp, 1);
- node->symbol.weakref = bp_unpack_value (&bp, 1);
- node->symbol.analyzed = bp_unpack_value (&bp, 1);
- node->symbol.used_from_other_partition = bp_unpack_value (&bp, 1);
- node->symbol.in_other_partition = bp_unpack_value (&bp, 1);
- if (node->symbol.in_other_partition)
+ node->externally_visible = bp_unpack_value (&bp, 1);
+ node->force_output = bp_unpack_value (&bp, 1);
+ node->forced_by_abi = bp_unpack_value (&bp, 1);
+ node->unique_name = bp_unpack_value (&bp, 1);
+ node->definition = bp_unpack_value (&bp, 1);
+ node->alias = bp_unpack_value (&bp, 1);
+ node->weakref = bp_unpack_value (&bp, 1);
+ node->analyzed = bp_unpack_value (&bp, 1);
+ node->used_from_other_partition = bp_unpack_value (&bp, 1);
+ node->in_other_partition = bp_unpack_value (&bp, 1);
+ if (node->in_other_partition)
{
- DECL_EXTERNAL (node->symbol.decl) = 1;
- TREE_STATIC (node->symbol.decl) = 0;
+ DECL_EXTERNAL (node->decl) = 1;
+ TREE_STATIC (node->decl) = 0;
}
- if (node->symbol.alias && !node->symbol.analyzed && node->symbol.weakref)
- node->symbol.alias_target = get_alias_symbol (node->symbol.decl);
+ if (node->alias && !node->analyzed && node->weakref)
+ 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->symbol.same_comdat_group = (symtab_node) (intptr_t) ref;
- node->symbol.resolution = streamer_read_enum (ib, ld_plugin_symbol_resolution,
+ node->same_comdat_group = (symtab_node) (intptr_t) ref;
+ node->resolution = streamer_read_enum (ib, ld_plugin_symbol_resolution,
LDPR_NUM_KNOWN);
return node;
int ecf_flags = 0;
caller = cgraph (nodes[streamer_read_hwi (ib)]);
- if (caller == NULL || caller->symbol.decl == NULL_TREE)
+ if (caller == NULL || caller->decl == NULL_TREE)
internal_error ("bytecode stream: no caller found while reading edge");
if (!indirect)
{
callee = cgraph (nodes[streamer_read_hwi (ib)]);
- if (callee == NULL || callee->symbol.decl == NULL_TREE)
+ if (callee == NULL || callee->decl == NULL_TREE)
internal_error ("bytecode stream: no callee found while reading edge");
}
else
input_edge (ib, nodes, true);
else if (tag == LTO_symtab_variable)
{
- node = (symtab_node)input_varpool_node (file_data, ib);
+ node = input_varpool_node (file_data, ib);
nodes.safe_push (node);
lto_symtab_encoder_encode (file_data->symtab_node_encoder, node);
}
else
{
- node = (symtab_node)input_node (file_data, ib, tag, nodes);
- if (node == NULL || node->symbol.decl == NULL_TREE)
+ node = input_node (file_data, ib, tag, nodes);
+ if (node == NULL || node->decl == NULL_TREE)
internal_error ("bytecode stream: found empty cgraph node");
nodes.safe_push (node);
lto_symtab_encoder_encode (file_data->symtab_node_encoder, node);
/* AUX pointers should be all non-zero for function nodes read from the stream. */
#ifdef ENABLE_CHECKING
FOR_EACH_VEC_ELT (nodes, i, node)
- gcc_assert (node->symbol.aux || !is_a <cgraph_node> (node));
+ gcc_assert (node->aux || !is_a <cgraph_node> (node));
#endif
FOR_EACH_VEC_ELT (nodes, i, node)
{
ref = (int) (intptr_t) cnode->global.inlined_to;
/* We share declaration of builtins, so we may read same node twice. */
- if (!node->symbol.aux)
+ if (!node->aux)
continue;
- node->symbol.aux = NULL;
+ node->aux = NULL;
/* Fixup inlined_to from reference to pointer. */
if (ref != LCC_NOT_FOUND)
cnode->global.inlined_to = NULL;
}
- ref = (int) (intptr_t) node->symbol.same_comdat_group;
+ ref = (int) (intptr_t) node->same_comdat_group;
/* Fixup same_comdat_group from reference to pointer. */
if (ref != LCC_NOT_FOUND)
- node->symbol.same_comdat_group = nodes[ref];
+ node->same_comdat_group = nodes[ref];
else
- node->symbol.same_comdat_group = NULL;
+ node->same_comdat_group = NULL;
}
FOR_EACH_VEC_ELT (nodes, i, node)
- node->symbol.aux = is_a <cgraph_node> (node) ? (void *)1 : NULL;
+ node->aux = is_a <cgraph_node> (node) ? (void *)1 : NULL;
return nodes;
}
During LTRANS we already have values of count_materialization_scale
computed, so just update them. */
FOR_EACH_FUNCTION (node)
- if (node->symbol.lto_file_data
- && node->symbol.lto_file_data->profile_info.runs)
+ if (node->lto_file_data
+ && node->lto_file_data->profile_info.runs)
{
int scale;
scale = RDIV (node->count_materialization_scale * max_runs,
- node->symbol.lto_file_data->profile_info.runs);
+ node->lto_file_data->profile_info.runs);
node->count_materialization_scale = scale;
if (scale < 0)
fatal_error ("Profile information in %s corrupted",
node for the parent function was never emitted to the gimple
file, cgraph_node will create a node for it when setting the
context of the nested function. */
- if (node->symbol.lto_file_data)
- node->symbol.aux = NULL;
+ if (node->lto_file_data)
+ node->aux = NULL;
}
}
streamer_write_bitpack (&bp);
}
- if (lto_symtab_encoder_in_partition_p (encoder, (symtab_node) node))
+ if (lto_symtab_encoder_in_partition_p (encoder, node))
{
for (e = node->callees; e; e = e->next_callee)
output_edge_opt_summary (ob, e);
struct lto_in_decl_state temp;
void **slot;
- if (!node->symbol.lto_file_data)
+ if (!node->lto_file_data)
return;
- temp.fn_decl = node->symbol.decl;
- slot = htab_find_slot (node->symbol.lto_file_data->function_decl_states,
+ temp.fn_decl = node->decl;
+ slot = htab_find_slot (node->lto_file_data->function_decl_states,
&temp, NO_INSERT);
if (slot && *slot)
{
lto_free_function_in_decl_state ((struct lto_in_decl_state*) *slot);
- htab_clear_slot (node->symbol.lto_file_data->function_decl_states,
+ htab_clear_slot (node->lto_file_data->function_decl_states,
slot);
}
- node->symbol.lto_file_data = NULL;
+ node->lto_file_data = NULL;
}
fatal_error ("Cgraph edge statement index not found");
}
for (i = 0;
- ipa_ref_list_reference_iterate (&node->symbol.ref_list, i, ref);
+ ipa_ref_list_reference_iterate (&node->ref_list, i, ref);
i++)
if (ref->lto_stmt_uid)
{
while (orig->clone_of)
orig = orig->clone_of;
- fn = DECL_STRUCT_FUNCTION (orig->symbol.decl);
+ fn = DECL_STRUCT_FUNCTION (orig->decl);
fixup_call_stmt_edges_1 (orig, stmts, fn);
if (orig->clones)
int string_offset;
struct lto_input_block ib_cfg;
struct lto_input_block ib_main;
- tree fn_decl = node->symbol.decl;
+ tree fn_decl = node->decl;
header = (const struct lto_function_header *) data;
cfg_offset = sizeof (struct lto_function_header);
basic_block bb;
struct output_block *ob;
- function = node->symbol.decl;
+ function = node->decl;
fn = DECL_STRUCT_FUNCTION (function);
ob = create_output_block (LTO_section_function_body);
static void
copy_function (struct cgraph_node *node)
{
- tree function = node->symbol.decl;
- struct lto_file_decl_data *file_data = node->symbol.lto_file_data;
+ tree function = node->decl;
+ struct lto_file_decl_data *file_data = node->lto_file_data;
struct lto_output_stream *output_stream = XCNEW (struct lto_output_stream);
const char *data;
size_t len;
/* Copy decls. */
in_state =
- lto_get_function_in_decl_state (node->symbol.lto_file_data, function);
+ lto_get_function_in_decl_state (node->lto_file_data, function);
gcc_assert (in_state);
for (i = 0; i < LTO_N_DECL_STREAMS; i++)
cgraph_node *node = dyn_cast <cgraph_node> (snode);
if (node
&& lto_symtab_encoder_encode_body_p (encoder, node)
- && !node->symbol.alias)
+ && !node->alias)
{
#ifdef ENABLE_CHECKING
- gcc_assert (!bitmap_bit_p (output, DECL_UID (node->symbol.decl)));
- bitmap_set_bit (output, DECL_UID (node->symbol.decl));
+ gcc_assert (!bitmap_bit_p (output, DECL_UID (node->decl)));
+ bitmap_set_bit (output, DECL_UID (node->decl));
#endif
decl_state = lto_new_out_decl_state ();
lto_push_out_decl_state (decl_state);
- if (gimple_has_body_p (node->symbol.decl) || !flag_wpa)
+ if (gimple_has_body_p (node->decl) || !flag_wpa)
output_function (node);
else
copy_function (node);
gcc_assert (lto_get_out_decl_state () == decl_state);
lto_pop_out_decl_state ();
- lto_record_function_out_decl_state (node->symbol.decl, decl_state);
+ lto_record_function_out_decl_state (node->decl, decl_state);
}
}
/* When something is defined, it should have node attached. */
gcc_assert (alias || TREE_CODE (t) != VAR_DECL
- || varpool_get_node (t)->symbol.definition);
+ || varpool_get_node (t)->definition);
gcc_assert (alias || TREE_CODE (t) != FUNCTION_DECL
|| (cgraph_get_node (t)
- && cgraph_get_node (t)->symbol.definition));
+ && cgraph_get_node (t)->definition));
}
/* Imitate what default_elf_asm_output_external do.
and devirtualization. We do not want to see them in symbol table as
references unless they are really used. */
cnode = dyn_cast <cgraph_node> (node);
- if (cnode && (!node->symbol.definition || DECL_EXTERNAL (cnode->symbol.decl))
+ if (cnode && (!node->definition || DECL_EXTERNAL (cnode->decl))
&& cnode->callers)
return true;
part of the compilation unit until they are used by folding. Some symbols,
like references to external construction vtables can not be referred to at all.
We decide this at can_refer_decl_in_current_unit_p. */
- if (!node->symbol.definition || DECL_EXTERNAL (node->symbol.decl))
+ if (!node->definition || DECL_EXTERNAL (node->decl))
{
int i;
struct ipa_ref *ref;
- for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list,
+ for (i = 0; ipa_ref_list_referring_iterate (&node->ref_list,
i, ref); i++)
{
if (ref->use == IPA_REF_ALIAS)
continue;
if (is_a <cgraph_node> (ref->referring))
return true;
- if (!DECL_EXTERNAL (ref->referring->symbol.decl))
+ if (!DECL_EXTERNAL (ref->referring->decl))
return true;
}
return false;
{
symtab_node node = lsei_node (lsei);
- if (!output_symbol_p (node) || DECL_EXTERNAL (node->symbol.decl))
+ if (!output_symbol_p (node) || DECL_EXTERNAL (node->decl))
continue;
- write_symbol (cache, &stream, node->symbol.decl, seen, false);
+ write_symbol (cache, &stream, node->decl, seen, false);
}
for (lsei = lsei_start (encoder);
!lsei_end_p (lsei); lsei_next (&lsei))
{
symtab_node node = lsei_node (lsei);
- if (!output_symbol_p (node) || !DECL_EXTERNAL (node->symbol.decl))
+ if (!output_symbol_p (node) || !DECL_EXTERNAL (node->decl))
continue;
- write_symbol (cache, &stream, node->symbol.decl, seen, false);
+ write_symbol (cache, &stream, node->decl, seen, false);
}
lto_write_stream (&stream);
+2013-10-29 David Malcolm <dmalcolm@redhat.com>
+
+ Patch autogenerated by refactor_symtab.py from
+ https://github.com/davidmalcolm/gcc-refactoring-scripts
+ revision 58bb219cc090b2f4516a9297d868c245495ee622
+
+ * lto-partition.c (lto_promote_cross_file_statics): Update for
+ conversion of symtab types to a true class hierarchy.
+ (rename_statics): Likewise.
+ (promote_symbol): Likewise.
+ (privatize_symbol_name): Likewise.
+ (lto_balanced_map): Likewise.
+ (varpool_node_cmp): Likewise.
+ (node_cmp): Likewise.
+ (lto_1_to_1_map): Likewise.
+ (undo_partition): Likewise.
+ (add_symbol_to_partition): Likewise.
+ (contained_in_symbol): Likewise.
+ (add_symbol_to_partition_1): Likewise.
+ (add_references_to_partition): Likewise.
+ (symbol_partitioned_p): Likewise.
+ (get_symbol_class): Likewise.
+ (lto_max_map): Likewise.
+ * lto-symtab.c (lto_symtab_prevailing_decl): Likewise.
+ (lto_symtab_merge_symbols): Likewise.
+ (lto_symtab_merge_symbols_1): Likewise.
+ (lto_symtab_merge_decls): Likewise.
+ (lto_symtab_merge_decls_1): Likewise.
+ (lto_symtab_merge_decls_2): Likewise.
+ (lto_symtab_resolve_symbols): Likewise.
+ (lto_symtab_resolve_can_prevail_p): Likewise.
+ (lto_symtab_symbol_p): Likewise.
+ (lto_symtab_resolve_replaceable_p): Likewise.
+ (lto_symtab_merge): Likewise.
+ (lto_varpool_replace_node): Likewise.
+ (lto_cgraph_replace_node): Likewise.
+ * lto.c (lto_main): Likewise.
+ (do_whole_program_analysis): Likewise.
+ (materialize_cgraph): Likewise.
+ (read_cgraph_and_symbols): Likewise.
+ (cmp_partitions_order): Likewise.
+ (lto_materialize_function): Likewise.
+ (has_analyzed_clone_p): Likewise.
+
2013-10-29 Andrew MacLeod <amacleod@redhat.com>
* lto/lto-object.c: Add gimple.h to include list.
This include external delcarations. */
cgraph_node *cnode = dyn_cast <cgraph_node> (node);
- if (DECL_ABSTRACT (node->symbol.decl))
+ if (DECL_ABSTRACT (node->decl))
return SYMBOL_EXTERNAL;
if (cnode && cnode->global.inlined_to)
return SYMBOL_DUPLICATE;
/* Weakref aliases are always duplicated. */
- if (node->symbol.weakref)
+ if (node->weakref)
return SYMBOL_DUPLICATE;
/* External declarations are external. */
- if (DECL_EXTERNAL (node->symbol.decl))
+ if (DECL_EXTERNAL (node->decl))
return SYMBOL_EXTERNAL;
if (varpool_node *vnode = dyn_cast <varpool_node> (node))
/* Constant pool references use local symbol names that can not
be promoted global. We should never put into a constant pool
objects that can not be duplicated across partitions. */
- if (DECL_IN_CONSTANT_POOL (node->symbol.decl))
+ if (DECL_IN_CONSTANT_POOL (node->decl))
return SYMBOL_DUPLICATE;
- gcc_checking_assert (vnode->symbol.definition);
+ gcc_checking_assert (vnode->definition);
}
/* Functions that are cloned may stay in callgraph even if they are unused.
Handle them as external; compute_ltrans_boundary take care to make
proper things to happen (i.e. to make them appear in the boundary but
with body streamed, so clone can me materialized). */
- else if (!cgraph (node)->symbol.definition)
+ else if (!cgraph (node)->definition)
return SYMBOL_EXTERNAL;
/* Comdats are duplicated to every use unless they are keyed.
Those do not need duplication. */
- if (DECL_COMDAT (node->symbol.decl)
- && !node->symbol.force_output
- && !symtab_used_from_object_file_p ((symtab_node) node))
+ if (DECL_COMDAT (node->decl)
+ && !node->force_output
+ && !symtab_used_from_object_file_p (node))
return SYMBOL_DUPLICATE;
return SYMBOL_PARTITION;
static inline bool
symbol_partitioned_p (symtab_node node)
{
- return node->symbol.aux;
+ return node->aux;
}
/* Add references into the partition. */
struct ipa_ref *ref;
/* Add all duplicated references to the partition. */
- for (i = 0; ipa_ref_list_reference_iterate (&node->symbol.ref_list, i, ref); i++)
+ for (i = 0; ipa_ref_list_reference_iterate (&node->ref_list, i, ref); i++)
if (get_symbol_class (ref->referred) == SYMBOL_DUPLICATE)
add_symbol_to_partition (part, ref->referred);
/* References to a readonly variable may be constant foled into its value.
Recursively look into the initializers of the constant variable and add
references, too. */
else if (is_a <varpool_node> (ref->referred)
- && ctor_for_folding (ref->referred->symbol.decl) != error_mark_node
+ && ctor_for_folding (ref->referred->decl) != error_mark_node
&& !lto_symtab_encoder_in_partition_p (part->encoder, ref->referred))
{
if (!part->initializers_visited)
symtab_node node1;
/* If NODE is already there, we have nothing to do. */
- if (lto_symtab_encoder_in_partition_p (part->encoder, (symtab_node) node))
+ if (lto_symtab_encoder_in_partition_p (part->encoder, node))
return true;
/* non-duplicated aliases or tunks of a duplicated symbol needs to be output
Be lax about comdats; they may or may not be duplicated and we may
end up in need to duplicate keyed comdat because it has unkeyed alias. */
- if (c == SYMBOL_PARTITION && !DECL_COMDAT (node->symbol.decl)
+ if (c == SYMBOL_PARTITION && !DECL_COMDAT (node->decl)
&& symbol_partitioned_p (node))
return false;
gcc_assert (c != SYMBOL_EXTERNAL
&& (c == SYMBOL_DUPLICATE || !symbol_partitioned_p (node)));
- lto_set_symtab_encoder_in_partition (part->encoder, (symtab_node) node);
+ lto_set_symtab_encoder_in_partition (part->encoder, node);
if (symbol_partitioned_p (node))
{
- node->symbol.in_other_partition = 1;
+ node->in_other_partition = 1;
if (cgraph_dump_file)
fprintf (cgraph_dump_file, "Symbol node %s now used in multiple partitions\n",
symtab_node_name (node));
}
- node->symbol.aux = (void *)((size_t)node->symbol.aux + 1);
+ node->aux = (void *)((size_t)node->aux + 1);
if (cgraph_node *cnode = dyn_cast <cgraph_node> (node))
{
/* Add all inline clones and callees that are duplicated. */
for (e = cnode->callees; e; e = e->next_callee)
if (!e->inline_failed)
- add_symbol_to_partition_1 (part, (symtab_node) e->callee);
- else if (get_symbol_class ((symtab_node) e->callee) == SYMBOL_DUPLICATE)
- add_symbol_to_partition (part, (symtab_node) e->callee);
+ add_symbol_to_partition_1 (part, e->callee);
+ else if (get_symbol_class (e->callee) == SYMBOL_DUPLICATE)
+ add_symbol_to_partition (part, e->callee);
/* Add all thunks associated with the function. */
for (e = cnode->callers; e; e = e->next_caller)
if (e->caller->thunk.thunk_p)
- add_symbol_to_partition_1 (part, (symtab_node) e->caller);
+ add_symbol_to_partition_1 (part, e->caller);
}
add_references_to_partition (part, node);
/* Add all aliases associated with the symbol. */
- for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list, i, ref); i++)
- if (ref->use == IPA_REF_ALIAS && !node->symbol.weakref)
+ for (i = 0; ipa_ref_list_referring_iterate (&node->ref_list, i, ref); i++)
+ if (ref->use == IPA_REF_ALIAS && !node->weakref)
add_symbol_to_partition_1 (part, ref->referring);
/* Ensure that SAME_COMDAT_GROUP lists all allways added in a group. */
- if (node->symbol.same_comdat_group)
- for (node1 = node->symbol.same_comdat_group;
- node1 != node; node1 = node1->symbol.same_comdat_group)
+ if (node->same_comdat_group)
+ for (node1 = node->same_comdat_group;
+ node1 != node; node1 = node1->same_comdat_group)
{
bool added = add_symbol_to_partition_1 (part, node1);
gcc_assert (added);
contained_in_symbol (symtab_node node)
{
/* Weakrefs are never contained in anything. */
- if (node->symbol.weakref)
+ if (node->weakref)
return node;
if (cgraph_node *cnode = dyn_cast <cgraph_node> (node))
{
cnode = cgraph_function_node (cnode, NULL);
if (cnode->global.inlined_to)
cnode = cnode->global.inlined_to;
- return (symtab_node) cnode;
+ return cnode;
}
else if (varpool_node *vnode = dyn_cast <varpool_node> (node))
- return (symtab_node) varpool_variable_node (vnode, NULL);
+ return varpool_variable_node (vnode, NULL);
return node;
}
Be lax about comdats; they may or may not be duplicated and we may
end up in need to duplicate keyed comdat because it has unkeyed alias. */
gcc_assert (get_symbol_class (node) == SYMBOL_DUPLICATE
- || DECL_COMDAT (node->symbol.decl)
+ || DECL_COMDAT (node->decl)
|| !symbol_partitioned_p (node));
add_symbol_to_partition_1 (part, node);
}
if (cgraph_node *cnode = dyn_cast <cgraph_node> (node))
partition->insns -= inline_summary (cnode)->self_size;
lto_symtab_encoder_delete_node (partition->encoder, node);
- node->symbol.aux = (void *)((size_t)node->symbol.aux - 1);
+ node->aux = (void *)((size_t)node->aux - 1);
}
}
|| symbol_partitioned_p (node))
continue;
- file_data = node->symbol.lto_file_data;
+ file_data = node->lto_file_data;
if (file_data)
{
npartitions++;
}
- add_symbol_to_partition (partition, (symtab_node) node);
+ add_symbol_to_partition (partition, node);
}
/* If the cgraph is empty, create one cgraph node set so that there is still
|| symbol_partitioned_p (node))
continue;
partition = new_partition (symtab_node_asm_name (node));
- add_symbol_to_partition (partition, (symtab_node) node);
+ add_symbol_to_partition (partition, node);
npartitions++;
}
if (!npartitions)
{
const struct cgraph_node *a = *(const struct cgraph_node * const *) pa;
const struct cgraph_node *b = *(const struct cgraph_node * const *) pb;
- return b->symbol.order - a->symbol.order;
+ return b->order - a->order;
}
/* Helper function for qsort; sort nodes by order. */
{
const struct varpool_node *a = *(const struct varpool_node * const *) pa;
const struct varpool_node *b = *(const struct varpool_node * const *) pb;
- return b->symbol.order - a->symbol.order;
+ return b->order - a->order;
}
/* Group cgraph nodes into equally-sized partitions.
int current_order = -1;
FOR_EACH_VARIABLE (vnode)
- gcc_assert (!vnode->symbol.aux);
+ gcc_assert (!vnode->aux);
FOR_EACH_DEFINED_FUNCTION (node)
- if (get_symbol_class ((symtab_node) node) == SYMBOL_PARTITION)
+ if (get_symbol_class (node) == SYMBOL_PARTITION)
{
order[n_nodes++] = node;
total_size += inline_summary (node)->size;
qsort (order, n_nodes, sizeof (struct cgraph_node *), node_cmp);
FOR_EACH_VARIABLE (vnode)
- if (get_symbol_class ((symtab_node) vnode) == SYMBOL_PARTITION)
+ if (get_symbol_class (vnode) == SYMBOL_PARTITION)
n_varpool_nodes++;
varpool_order = XNEWVEC (struct varpool_node *, n_varpool_nodes);
n_varpool_nodes = 0;
FOR_EACH_VARIABLE (vnode)
- if (get_symbol_class ((symtab_node) vnode) == SYMBOL_PARTITION)
+ if (get_symbol_class (vnode) == SYMBOL_PARTITION)
varpool_order[n_varpool_nodes++] = vnode;
qsort (varpool_order, n_varpool_nodes, sizeof (struct varpool_node *),
varpool_node_cmp);
for (i = 0; i < n_nodes; i++)
{
- if (symbol_partitioned_p ((symtab_node) order[i]))
+ if (symbol_partitioned_p (order[i]))
continue;
- current_order = order[i]->symbol.order;
+ current_order = order[i]->order;
if (!flag_toplevel_reorder)
while (varpool_pos < n_varpool_nodes
- && varpool_order[varpool_pos]->symbol.order < current_order)
+ && varpool_order[varpool_pos]->order < current_order)
{
- if (!symbol_partitioned_p ((symtab_node) varpool_order[varpool_pos]))
- add_symbol_to_partition (partition, (symtab_node) varpool_order[varpool_pos]);
+ if (!symbol_partitioned_p (varpool_order[varpool_pos]))
+ add_symbol_to_partition (partition, varpool_order[varpool_pos]);
varpool_pos++;
}
- add_symbol_to_partition (partition, (symtab_node) order[i]);
+ add_symbol_to_partition (partition, order[i]);
total_size -= inline_summary (order[i])->size;
{
struct cgraph_edge *edge;
- refs = &node->symbol.ref_list;
+ refs = &node->ref_list;
last_visited_node++;
- gcc_assert (node->symbol.definition || node->symbol.weakref);
+ gcc_assert (node->definition || node->weakref);
/* Compute boundary cost of callgraph edges. */
for (edge = node->callees; edge; edge = edge->next_callee)
- if (edge->callee->symbol.definition)
+ if (edge->callee->definition)
{
int edge_cost = edge->frequency;
int index;
edge_cost = 1;
gcc_assert (edge_cost > 0);
index = lto_symtab_encoder_lookup (partition->encoder,
- (symtab_node)edge->callee);
+ edge->callee);
if (index != LCC_NOT_FOUND
&& index < last_visited_node - 1)
cost -= edge_cost, internal += edge_cost;
int edge_cost = edge->frequency;
int index;
- gcc_assert (edge->caller->symbol.definition);
+ gcc_assert (edge->caller->definition);
if (!edge_cost)
edge_cost = 1;
gcc_assert (edge_cost > 0);
index = lto_symtab_encoder_lookup (partition->encoder,
- (symtab_node)edge->caller);
+ edge->caller);
if (index != LCC_NOT_FOUND
&& index < last_visited_node - 1)
cost -= edge_cost;
}
else
{
- refs = &snode->symbol.ref_list;
+ refs = &snode->ref_list;
last_visited_node++;
}
int index;
vnode = ipa_ref_varpool_node (ref);
- if (!vnode->symbol.definition)
+ if (!vnode->definition)
continue;
- if (!symbol_partitioned_p ((symtab_node) vnode) && flag_toplevel_reorder
- && get_symbol_class ((symtab_node) vnode) == SYMBOL_PARTITION)
- add_symbol_to_partition (partition, (symtab_node) vnode);
+ if (!symbol_partitioned_p (vnode) && flag_toplevel_reorder
+ && get_symbol_class (vnode) == SYMBOL_PARTITION)
+ add_symbol_to_partition (partition, vnode);
index = lto_symtab_encoder_lookup (partition->encoder,
- (symtab_node)vnode);
+ vnode);
if (index != LCC_NOT_FOUND
&& index < last_visited_node - 1)
cost--, internal++;
int index;
node = ipa_ref_node (ref);
- if (!node->symbol.definition)
+ if (!node->definition)
continue;
index = lto_symtab_encoder_lookup (partition->encoder,
- (symtab_node)node);
+ node);
if (index != LCC_NOT_FOUND
&& index < last_visited_node - 1)
cost--, internal++;
int index;
vnode = ipa_ref_referring_varpool_node (ref);
- gcc_assert (vnode->symbol.definition);
- if (!symbol_partitioned_p ((symtab_node) vnode) && flag_toplevel_reorder
- && get_symbol_class ((symtab_node) vnode) == SYMBOL_PARTITION)
- add_symbol_to_partition (partition, (symtab_node) vnode);
+ gcc_assert (vnode->definition);
+ if (!symbol_partitioned_p (vnode) && flag_toplevel_reorder
+ && get_symbol_class (vnode) == SYMBOL_PARTITION)
+ add_symbol_to_partition (partition, vnode);
index = lto_symtab_encoder_lookup (partition->encoder,
- (symtab_node)vnode);
+ vnode);
if (index != LCC_NOT_FOUND
&& index < last_visited_node - 1)
cost--;
int index;
node = ipa_ref_referring_node (ref);
- gcc_assert (node->symbol.definition);
+ gcc_assert (node->definition);
index = lto_symtab_encoder_lookup (partition->encoder,
- (symtab_node)node);
+ node);
if (index != LCC_NOT_FOUND
&& index < last_visited_node - 1)
cost--;
if (cgraph_dump_file)
fprintf (cgraph_dump_file, "Step %i: added %s/%i, size %i, cost %i/%i "
"best %i/%i, step %i\n", i,
- cgraph_node_name (order[i]), order[i]->symbol.order,
+ cgraph_node_name (order[i]), order[i]->order,
partition->insns, cost, internal,
best_cost, best_internal, best_i);
/* Partition is too large, unwind into step when best cost was reached and
}
i = best_i;
/* When we are finished, avoid creating empty partition. */
- while (i < n_nodes - 1 && symbol_partitioned_p ((symtab_node) order[i + 1]))
+ while (i < n_nodes - 1 && symbol_partitioned_p (order[i + 1]))
i++;
if (i == n_nodes - 1)
break;
if (flag_toplevel_reorder)
{
FOR_EACH_VARIABLE (vnode)
- if (get_symbol_class ((symtab_node) vnode) == SYMBOL_PARTITION
- && !symbol_partitioned_p ((symtab_node) vnode))
- add_symbol_to_partition (partition, (symtab_node) vnode);
+ if (get_symbol_class (vnode) == SYMBOL_PARTITION
+ && !symbol_partitioned_p (vnode))
+ add_symbol_to_partition (partition, vnode);
}
else
{
while (varpool_pos < n_varpool_nodes)
{
- if (!symbol_partitioned_p ((symtab_node) varpool_order[varpool_pos]))
- add_symbol_to_partition (partition, (symtab_node) varpool_order[varpool_pos]);
+ if (!symbol_partitioned_p (varpool_order[varpool_pos]))
+ add_symbol_to_partition (partition, varpool_order[varpool_pos]);
varpool_pos++;
}
free (varpool_order);
static bool
privatize_symbol_name (symtab_node node)
{
- tree decl = node->symbol.decl;
+ tree decl = node->decl;
const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
/* Our renaming machinery do not handle more than one change of assembler name.
We should not need more than one anyway. */
- if (node->symbol.lto_file_data
- && lto_get_decl_name_mapping (node->symbol.lto_file_data, name) != name)
+ if (node->lto_file_data
+ && lto_get_decl_name_mapping (node->lto_file_data, name) != name)
{
if (cgraph_dump_file)
fprintf (cgraph_dump_file,
??? should have a flag whether a symbol has a 'private' name already,
since we produce some symbols like that i.e. for global constructors
that are not really clones. */
- if (node->symbol.unique_name)
+ if (node->unique_name)
{
if (cgraph_dump_file)
fprintf (cgraph_dump_file,
return false;
}
change_decl_assembler_name (decl, clone_function_name (decl, "lto_priv"));
- if (node->symbol.lto_file_data)
- lto_record_renamed_decl (node->symbol.lto_file_data, name,
+ if (node->lto_file_data)
+ lto_record_renamed_decl (node->lto_file_data, name,
IDENTIFIER_POINTER
(DECL_ASSEMBLER_NAME (decl)));
if (cgraph_dump_file)
promote_symbol (symtab_node node)
{
/* We already promoted ... */
- if (DECL_VISIBILITY (node->symbol.decl) == VISIBILITY_HIDDEN
- && DECL_VISIBILITY_SPECIFIED (node->symbol.decl)
- && TREE_PUBLIC (node->symbol.decl))
+ if (DECL_VISIBILITY (node->decl) == VISIBILITY_HIDDEN
+ && DECL_VISIBILITY_SPECIFIED (node->decl)
+ && TREE_PUBLIC (node->decl))
return;
- gcc_checking_assert (!TREE_PUBLIC (node->symbol.decl)
- && !DECL_EXTERNAL (node->symbol.decl));
+ gcc_checking_assert (!TREE_PUBLIC (node->decl)
+ && !DECL_EXTERNAL (node->decl));
/* Be sure that newly public symbol does not conflict with anything already
defined by the non-LTO part. */
privatize_symbol_name (node);
- TREE_PUBLIC (node->symbol.decl) = 1;
- DECL_VISIBILITY (node->symbol.decl) = VISIBILITY_HIDDEN;
- DECL_VISIBILITY_SPECIFIED (node->symbol.decl) = true;
+ TREE_PUBLIC (node->decl) = 1;
+ DECL_VISIBILITY (node->decl) = VISIBILITY_HIDDEN;
+ DECL_VISIBILITY_SPECIFIED (node->decl) = true;
if (cgraph_dump_file)
fprintf (cgraph_dump_file,
"Promoting as hidden: %s\n", symtab_node_name (node));
static void
rename_statics (lto_symtab_encoder_t encoder, symtab_node node)
{
- tree decl = node->symbol.decl;
+ tree decl = node->decl;
symtab_node s;
tree name = DECL_ASSEMBLER_NAME (decl);
/* See if this is static symbol. */
- if ((node->symbol.externally_visible
+ if ((node->externally_visible
/* FIXME: externally_visible is somewhat illogically not set for
external symbols (i.e. those not defined). Remove this test
once this is fixed. */
- || DECL_EXTERNAL (node->symbol.decl)
+ || DECL_EXTERNAL (node->decl)
|| !symtab_real_symbol_p (node))
&& !may_need_named_section_p (encoder, node))
return;
(all types of symbols counts here, since we can not have static of the
same name as external or public symbol.) */
for (s = symtab_node_for_asm (name);
- s; s = s->symbol.next_sharing_asm_name)
+ s; s = s->next_sharing_asm_name)
if ((symtab_real_symbol_p (s) || may_need_named_section_p (encoder, s))
- && s->symbol.decl != node->symbol.decl
+ && s->decl != node->decl
&& (!encoder
|| lto_symtab_encoder_lookup (encoder, s) != LCC_NOT_FOUND))
break;
/* Assign every symbol in the set that shares the same ASM name an unique
mangled name. */
for (s = symtab_node_for_asm (name); s;)
- if (!s->symbol.externally_visible
+ if (!s->externally_visible
&& ((symtab_real_symbol_p (s)
- && !DECL_EXTERNAL (node->symbol.decl)
- && !TREE_PUBLIC (node->symbol.decl))
+ && !DECL_EXTERNAL (node->decl)
+ && !TREE_PUBLIC (node->decl))
|| may_need_named_section_p (encoder, s))
&& (!encoder
|| lto_symtab_encoder_lookup (encoder, s) != LCC_NOT_FOUND))
if (privatize_symbol_name (s))
/* Re-start from beginning since we do not know how many symbols changed a name. */
s = symtab_node_for_asm (name);
- else s = s->symbol.next_sharing_asm_name;
+ else s = s->next_sharing_asm_name;
}
- else s = s->symbol.next_sharing_asm_name;
+ else s = s->next_sharing_asm_name;
}
/* Find out all static decls that need to be promoted to global because
rename_statics (encoder, node);
/* No need to promote if symbol already is externally visible ... */
- if (node->symbol.externally_visible
+ if (node->externally_visible
/* ... or if it is part of current partition ... */
|| lto_symtab_encoder_in_partition_p (encoder, node)
/* ... or if we do not partition it. This mean that it will
appear in every partition refernecing it. */
- || get_symbol_class ((symtab_node) node) != SYMBOL_PARTITION)
+ || get_symbol_class (node) != SYMBOL_PARTITION)
continue;
promote_symbol (node);
{
fprintf (cgraph_dump_file, "Replacing cgraph node %s/%i by %s/%i"
" for symbol %s\n",
- cgraph_node_name (node), node->symbol.order,
+ cgraph_node_name (node), node->order,
cgraph_node_name (prevailing_node),
- prevailing_node->symbol.order,
+ prevailing_node->order,
IDENTIFIER_POINTER ((*targetm.asm_out.mangle_assembler_name)
- (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->symbol.decl)))));
+ (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->decl)))));
}
/* Merge node flags. */
- if (node->symbol.force_output)
+ if (node->force_output)
cgraph_mark_force_output_node (prevailing_node);
- if (node->symbol.address_taken)
+ if (node->address_taken)
{
gcc_assert (!prevailing_node->global.inlined_to);
cgraph_mark_address_taken_node (prevailing_node);
/* Redirect all incoming edges. */
compatible_p
- = types_compatible_p (TREE_TYPE (TREE_TYPE (prevailing_node->symbol.decl)),
- TREE_TYPE (TREE_TYPE (node->symbol.decl)));
+ = types_compatible_p (TREE_TYPE (TREE_TYPE (prevailing_node->decl)),
+ TREE_TYPE (TREE_TYPE (node->decl)));
for (e = node->callers; e; e = next)
{
next = e->next_caller;
e->call_stmt_cannot_inline_p = 1;
}
/* Redirect incomming references. */
- ipa_clone_referring ((symtab_node)prevailing_node, &node->symbol.ref_list);
+ ipa_clone_referring (prevailing_node, &node->ref_list);
ipa_merge_profiles (prevailing_node, node);
- lto_free_function_in_decl_state_for_node ((symtab_node)node);
+ lto_free_function_in_decl_state_for_node (node);
- if (node->symbol.decl != prevailing_node->symbol.decl)
+ if (node->decl != prevailing_node->decl)
cgraph_release_function_body (node);
/* Finally remove the replaced node. */
lto_varpool_replace_node (struct varpool_node *vnode,
struct varpool_node *prevailing_node)
{
- gcc_assert (!vnode->symbol.definition || prevailing_node->symbol.definition);
- gcc_assert (!vnode->symbol.analyzed || prevailing_node->symbol.analyzed);
+ gcc_assert (!vnode->definition || prevailing_node->definition);
+ gcc_assert (!vnode->analyzed || prevailing_node->analyzed);
- ipa_clone_referring ((symtab_node)prevailing_node, &vnode->symbol.ref_list);
+ ipa_clone_referring (prevailing_node, &vnode->ref_list);
/* Be sure we can garbage collect the initializer. */
- if (DECL_INITIAL (vnode->symbol.decl)
- && vnode->symbol.decl != prevailing_node->symbol.decl)
- DECL_INITIAL (vnode->symbol.decl) = error_mark_node;
+ if (DECL_INITIAL (vnode->decl)
+ && vnode->decl != prevailing_node->decl)
+ DECL_INITIAL (vnode->decl) = error_mark_node;
/* Finally remove the replaced node. */
varpool_remove_node (vnode);
}
static bool
lto_symtab_merge (symtab_node prevailing, symtab_node entry)
{
- tree prevailing_decl = prevailing->symbol.decl;
- tree decl = entry->symbol.decl;
+ tree prevailing_decl = prevailing->decl;
+ tree decl = entry->decl;
tree prevailing_type, type;
if (prevailing_decl == decl)
static bool
lto_symtab_resolve_replaceable_p (symtab_node e)
{
- if (DECL_EXTERNAL (e->symbol.decl)
- || DECL_COMDAT (e->symbol.decl)
- || DECL_ONE_ONLY (e->symbol.decl)
- || DECL_WEAK (e->symbol.decl))
+ if (DECL_EXTERNAL (e->decl)
+ || DECL_COMDAT (e->decl)
+ || DECL_ONE_ONLY (e->decl)
+ || DECL_WEAK (e->decl))
return true;
- if (TREE_CODE (e->symbol.decl) == VAR_DECL)
- return (DECL_COMMON (e->symbol.decl)
- || (!flag_no_common && !DECL_INITIAL (e->symbol.decl)));
+ if (TREE_CODE (e->decl) == VAR_DECL)
+ return (DECL_COMMON (e->decl)
+ || (!flag_no_common && !DECL_INITIAL (e->decl)));
return false;
}
static bool
lto_symtab_symbol_p (symtab_node e)
{
- if (!TREE_PUBLIC (e->symbol.decl) && !DECL_EXTERNAL (e->symbol.decl))
+ if (!TREE_PUBLIC (e->decl) && !DECL_EXTERNAL (e->decl))
return false;
return symtab_real_symbol_p (e);
}
/* The C++ frontend ends up neither setting TREE_STATIC nor
DECL_EXTERNAL on virtual methods but only TREE_PUBLIC.
So do not reject !TREE_STATIC here but only DECL_EXTERNAL. */
- if (DECL_EXTERNAL (e->symbol.decl))
+ if (DECL_EXTERNAL (e->decl))
return false;
- return e->symbol.definition;
+ return e->definition;
}
/* Resolve the symbol with the candidates in the chain *SLOT and store
symtab_node prevailing = NULL;
/* Always set e->node so that edges are updated to reflect decl merging. */
- for (e = first; e; e = e->symbol.next_sharing_asm_name)
+ for (e = first; e; e = e->next_sharing_asm_name)
if (lto_symtab_symbol_p (e)
- && (e->symbol.resolution == LDPR_PREVAILING_DEF_IRONLY
- || e->symbol.resolution == LDPR_PREVAILING_DEF_IRONLY_EXP
- || e->symbol.resolution == LDPR_PREVAILING_DEF))
+ && (e->resolution == LDPR_PREVAILING_DEF_IRONLY
+ || e->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP
+ || e->resolution == LDPR_PREVAILING_DEF))
{
prevailing = e;
break;
if (prevailing)
{
/* Assert it's the only one. */
- for (e = prevailing->symbol.next_sharing_asm_name; e; e = e->symbol.next_sharing_asm_name)
+ for (e = prevailing->next_sharing_asm_name; e; e = e->next_sharing_asm_name)
if (lto_symtab_symbol_p (e)
- && (e->symbol.resolution == LDPR_PREVAILING_DEF_IRONLY
- || e->symbol.resolution == LDPR_PREVAILING_DEF_IRONLY_EXP
- || e->symbol.resolution == LDPR_PREVAILING_DEF))
+ && (e->resolution == LDPR_PREVAILING_DEF_IRONLY
+ || e->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP
+ || e->resolution == LDPR_PREVAILING_DEF))
fatal_error ("multiple prevailing defs for %qE",
- DECL_NAME (prevailing->symbol.decl));
+ DECL_NAME (prevailing->decl));
return prevailing;
}
/* Find the single non-replaceable prevailing symbol and
diagnose ODR violations. */
- for (e = first; e; e = e->symbol.next_sharing_asm_name)
+ for (e = first; e; e = e->next_sharing_asm_name)
{
if (!lto_symtab_resolve_can_prevail_p (e))
continue;
{
if (prevailing)
{
- error_at (DECL_SOURCE_LOCATION (e->symbol.decl),
- "%qD has already been defined", e->symbol.decl);
- inform (DECL_SOURCE_LOCATION (prevailing->symbol.decl),
+ error_at (DECL_SOURCE_LOCATION (e->decl),
+ "%qD has already been defined", e->decl);
+ inform (DECL_SOURCE_LOCATION (prevailing->decl),
"previously defined here");
}
prevailing = e;
return prevailing;
/* Do a second round choosing one from the replaceable prevailing decls. */
- for (e = first; e; e = e->symbol.next_sharing_asm_name)
+ for (e = first; e; e = e->next_sharing_asm_name)
{
if (!lto_symtab_resolve_can_prevail_p (e))
continue;
/* Choose the first function that can prevail as prevailing. */
- if (TREE_CODE (e->symbol.decl) == FUNCTION_DECL)
+ if (TREE_CODE (e->decl) == FUNCTION_DECL)
{
prevailing = e;
break;
/* From variables that can prevail choose the largest one. */
if (!prevailing
- || tree_int_cst_lt (DECL_SIZE (prevailing->symbol.decl),
- DECL_SIZE (e->symbol.decl))
+ || tree_int_cst_lt (DECL_SIZE (prevailing->decl),
+ DECL_SIZE (e->decl))
/* When variables are equivalent try to chose one that has useful
DECL_INITIAL. This makes sense for keyed vtables that are
DECL_EXTERNAL but initialized. In units that do not need them
We know that the vtable is keyed outside the LTO unit - otherwise
the keyed instance would prevail. We still can preserve useful
info in the initializer. */
- || (DECL_SIZE (prevailing->symbol.decl) == DECL_SIZE (e->symbol.decl)
- && (DECL_INITIAL (e->symbol.decl)
- && DECL_INITIAL (e->symbol.decl) != error_mark_node)
- && (!DECL_INITIAL (prevailing->symbol.decl)
- || DECL_INITIAL (prevailing->symbol.decl) == error_mark_node)))
+ || (DECL_SIZE (prevailing->decl) == DECL_SIZE (e->decl)
+ && (DECL_INITIAL (e->decl)
+ && DECL_INITIAL (e->decl) != error_mark_node)
+ && (!DECL_INITIAL (prevailing->decl)
+ || DECL_INITIAL (prevailing->decl) == error_mark_node)))
prevailing = e;
}
/* Nothing to do for a single entry. */
prevailing = first;
- if (!prevailing->symbol.next_sharing_asm_name)
+ if (!prevailing->next_sharing_asm_name)
return;
/* Try to merge each entry with the prevailing one. */
- for (e = prevailing->symbol.next_sharing_asm_name;
- e; e = e->symbol.next_sharing_asm_name)
- if (TREE_PUBLIC (e->symbol.decl))
+ for (e = prevailing->next_sharing_asm_name;
+ e; e = e->next_sharing_asm_name)
+ if (TREE_PUBLIC (e->decl))
{
if (!lto_symtab_merge (prevailing, e)
&& !diagnosed_p)
- mismatches.safe_push (e->symbol.decl);
+ mismatches.safe_push (e->decl);
}
if (mismatches.is_empty ())
return;
/* Diagnose all mismatched re-declarations. */
FOR_EACH_VEC_ELT (mismatches, i, decl)
{
- if (!types_compatible_p (TREE_TYPE (prevailing->symbol.decl),
+ if (!types_compatible_p (TREE_TYPE (prevailing->decl),
TREE_TYPE (decl)))
diagnosed_p |= warning_at (DECL_SOURCE_LOCATION (decl), 0,
"type of %qD does not match original "
"declaration", decl);
- else if ((DECL_USER_ALIGN (prevailing->symbol.decl)
+ else if ((DECL_USER_ALIGN (prevailing->decl)
&& DECL_USER_ALIGN (decl))
- && DECL_ALIGN (prevailing->symbol.decl) < DECL_ALIGN (decl))
+ && DECL_ALIGN (prevailing->decl) < DECL_ALIGN (decl))
{
diagnosed_p |= warning_at (DECL_SOURCE_LOCATION (decl), 0,
"alignment of %qD is bigger than "
}
}
if (diagnosed_p)
- inform (DECL_SOURCE_LOCATION (prevailing->symbol.decl),
+ inform (DECL_SOURCE_LOCATION (prevailing->decl),
"previously declared here");
mismatches.release ();
{
fprintf (cgraph_dump_file, "Merging nodes for %s. Candidates:\n",
symtab_node_asm_name (first));
- for (e = first; e; e = e->symbol.next_sharing_asm_name)
- if (TREE_PUBLIC (e->symbol.decl))
+ for (e = first; e; e = e->next_sharing_asm_name)
+ if (TREE_PUBLIC (e->decl))
dump_symtab_node (cgraph_dump_file, e);
}
This is needed for C++ typeinfos, for example in
lto/20081204-1 there are typeifos in both units, just
one of them do have size. */
- if (TREE_CODE (prevailing->symbol.decl) == VAR_DECL)
+ if (TREE_CODE (prevailing->decl) == VAR_DECL)
{
- for (e = prevailing->symbol.next_sharing_asm_name;
- e; e = e->symbol.next_sharing_asm_name)
- if (!COMPLETE_TYPE_P (TREE_TYPE (prevailing->symbol.decl))
- && COMPLETE_TYPE_P (TREE_TYPE (e->symbol.decl))
+ for (e = prevailing->next_sharing_asm_name;
+ e; e = e->next_sharing_asm_name)
+ if (!COMPLETE_TYPE_P (TREE_TYPE (prevailing->decl))
+ && COMPLETE_TYPE_P (TREE_TYPE (e->decl))
&& lto_symtab_symbol_p (e))
prevailing = e;
}
/* For variables prefer the non-builtin if one is available. */
- else if (TREE_CODE (prevailing->symbol.decl) == FUNCTION_DECL)
+ else if (TREE_CODE (prevailing->decl) == FUNCTION_DECL)
{
- for (e = first; e; e = e->symbol.next_sharing_asm_name)
- if (TREE_CODE (e->symbol.decl) == FUNCTION_DECL
- && !DECL_BUILT_IN (e->symbol.decl)
+ for (e = first; e; e = e->next_sharing_asm_name)
+ if (TREE_CODE (e->decl) == FUNCTION_DECL
+ && !DECL_BUILT_IN (e->decl)
&& lto_symtab_symbol_p (e))
{
prevailing = e;
symtab_prevail_in_asm_name_hash (prevailing);
/* Diagnose mismatched objects. */
- for (e = prevailing->symbol.next_sharing_asm_name;
- e; e = e->symbol.next_sharing_asm_name)
+ for (e = prevailing->next_sharing_asm_name;
+ e; e = e->next_sharing_asm_name)
{
- if (TREE_CODE (prevailing->symbol.decl)
- == TREE_CODE (e->symbol.decl))
+ if (TREE_CODE (prevailing->decl)
+ == TREE_CODE (e->decl))
continue;
if (!lto_symtab_symbol_p (e))
continue;
- switch (TREE_CODE (prevailing->symbol.decl))
+ switch (TREE_CODE (prevailing->decl))
{
case VAR_DECL:
- gcc_assert (TREE_CODE (e->symbol.decl) == FUNCTION_DECL);
- error_at (DECL_SOURCE_LOCATION (e->symbol.decl),
+ gcc_assert (TREE_CODE (e->decl) == FUNCTION_DECL);
+ error_at (DECL_SOURCE_LOCATION (e->decl),
"variable %qD redeclared as function",
- prevailing->symbol.decl);
+ prevailing->decl);
break;
case FUNCTION_DECL:
- gcc_assert (TREE_CODE (e->symbol.decl) == VAR_DECL);
- error_at (DECL_SOURCE_LOCATION (e->symbol.decl),
+ gcc_assert (TREE_CODE (e->decl) == VAR_DECL);
+ error_at (DECL_SOURCE_LOCATION (e->decl),
"function %qD redeclared as variable",
- prevailing->symbol.decl);
+ prevailing->decl);
break;
default:
diagnosed_p = true;
}
if (diagnosed_p)
- inform (DECL_SOURCE_LOCATION (prevailing->symbol.decl),
+ inform (DECL_SOURCE_LOCATION (prevailing->decl),
"previously declared here");
/* Merge the chain to the single prevailing decl and diagnose
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "After resolution:\n");
- for (e = prevailing; e; e = e->symbol.next_sharing_asm_name)
+ for (e = prevailing; e; e = e->next_sharing_asm_name)
dump_symtab_node (cgraph_dump_file, e);
}
}
symtab_initialize_asm_name_hash ();
FOR_EACH_SYMBOL (node)
- if (!node->symbol.previous_sharing_asm_name
- && node->symbol.next_sharing_asm_name)
+ if (!node->previous_sharing_asm_name
+ && node->next_sharing_asm_name)
lto_symtab_merge_decls_1 (node);
}
symtab_node e, next;
/* Replace the cgraph node of each entry with the prevailing one. */
- for (e = prevailing->symbol.next_sharing_asm_name; e;
+ for (e = prevailing->next_sharing_asm_name; e;
e = next)
{
- next = e->symbol.next_sharing_asm_name;
+ next = e->next_sharing_asm_name;
if (!lto_symtab_symbol_p (e))
continue;
cgraph_node *ce = dyn_cast <cgraph_node> (e);
- if (ce && !DECL_BUILT_IN (e->symbol.decl))
+ if (ce && !DECL_BUILT_IN (e->decl))
lto_cgraph_replace_node (ce, cgraph (prevailing));
if (varpool_node *ve = dyn_cast <varpool_node> (e))
lto_varpool_replace_node (ve, varpool (prevailing));
updated to the ohter dupliate. */
FOR_EACH_SYMBOL (node)
if (lto_symtab_symbol_p (node)
- && node->symbol.next_sharing_asm_name
- && !node->symbol.previous_sharing_asm_name)
+ && node->next_sharing_asm_name
+ && !node->previous_sharing_asm_name)
lto_symtab_merge_symbols_1 (node);
/* Resolve weakref aliases whose target are now in the compilation unit.
varpool_node *vnode;
symtab_node node2;
- if (!node->symbol.analyzed && node->symbol.alias_target)
+ if (!node->analyzed && node->alias_target)
{
- symtab_node tgt = symtab_node_for_asm (node->symbol.alias_target);
- gcc_assert (node->symbol.weakref);
+ symtab_node tgt = symtab_node_for_asm (node->alias_target);
+ gcc_assert (node->weakref);
if (tgt)
symtab_resolve_alias (node, tgt);
}
- node->symbol.aux = NULL;
+ node->aux = NULL;
if (!(cnode = dyn_cast <cgraph_node> (node))
|| !cnode->clone_of
- || cnode->clone_of->symbol.decl != cnode->symbol.decl)
+ || cnode->clone_of->decl != cnode->decl)
{
/* Builtins are not merged via decl merging. It is however
possible that tree merging unified the declaration. We
do not want duplicate entries in symbol table. */
- if (cnode && DECL_BUILT_IN (node->symbol.decl)
- && (cnode2 = cgraph_get_node (node->symbol.decl))
+ if (cnode && DECL_BUILT_IN (node->decl)
+ && (cnode2 = cgraph_get_node (node->decl))
&& cnode2 != cnode)
lto_cgraph_replace_node (cnode2, cnode);
symbol name (since it is irrelevant), but we need to unify symbol
nodes if tree merging occured. */
if ((vnode = dyn_cast <varpool_node> (node))
- && DECL_HARD_REGISTER (vnode->symbol.decl)
- && (node2 = symtab_get_node (vnode->symbol.decl))
+ && DECL_HARD_REGISTER (vnode->decl)
+ && (node2 = symtab_get_node (vnode->decl))
&& node2 != node)
lto_varpool_replace_node (dyn_cast <varpool_node> (node2),
vnode);
/* Abstract functions may have duplicated cgraph nodes attached;
remove them. */
- else if (cnode && DECL_ABSTRACT (cnode->symbol.decl)
- && (cnode2 = cgraph_get_node (node->symbol.decl))
+ else if (cnode && DECL_ABSTRACT (cnode->decl)
+ && (cnode2 = cgraph_get_node (node->decl))
&& cnode2 != cnode)
cgraph_remove_node (cnode2);
- symtab_insert_node_to_hashtable ((symtab_node)node);
+ symtab_insert_node_to_hashtable (node);
}
}
}
if (!ret)
return decl;
- return ret->symbol.decl;
+ return ret->decl;
}
if (node)
while (node != orig)
{
- if (node->symbol.analyzed)
+ if (node->analyzed)
return true;
if (node->clones)
node = node->clones;
{
tree decl;
- decl = node->symbol.decl;
+ decl = node->decl;
/* Read in functions with body (analyzed nodes)
and also functions that are needed to produce virtual clones. */
- if ((cgraph_function_with_gimple_body_p (node) && node->symbol.analyzed)
+ if ((cgraph_function_with_gimple_body_p (node) && node->analyzed)
|| node->used_as_abstract_origin
|| has_analyzed_clone_p (node))
{
int ordera = -1, orderb = -1;
if (lto_symtab_encoder_size (pa->encoder))
- ordera = lto_symtab_encoder_deref (pa->encoder, 0)->symbol.order;
+ ordera = lto_symtab_encoder_deref (pa->encoder, 0)->order;
if (lto_symtab_encoder_size (pb->encoder))
- orderb = lto_symtab_encoder_deref (pb->encoder, 0)->symbol.order;
+ orderb = lto_symtab_encoder_deref (pb->encoder, 0)->order;
return orderb - ordera;
}
FOR_EACH_SYMBOL (snode)
if (symtab_real_symbol_p (snode)
- && snode->symbol.lto_file_data
- && snode->symbol.lto_file_data->resolution_map
- && (res = pointer_map_contains (snode->symbol.lto_file_data->resolution_map,
- snode->symbol.decl)))
- snode->symbol.resolution
+ && snode->lto_file_data
+ && snode->lto_file_data->resolution_map
+ && (res = pointer_map_contains (snode->lto_file_data->resolution_map,
+ snode->decl)))
+ snode->resolution
= (enum ld_plugin_symbol_resolution)(size_t)*res;
for (i = 0; all_file_decl_data[i]; i++)
if (all_file_decl_data[i]->resolution_map)
FOR_EACH_FUNCTION (node)
{
- if (node->symbol.lto_file_data)
+ if (node->lto_file_data)
{
lto_materialize_function (node);
lto_stats.num_input_cgraph_nodes++;
/* AUX pointers are used by partitioning code to bookkeep number of
partitions symbol is in. This is no longer needed. */
FOR_EACH_SYMBOL (node)
- node->symbol.aux = NULL;
+ node->aux = NULL;
lto_stats.num_cgraph_partitions += ltrans_partitions.length ();
timevar_pop (TV_WHOPR_PARTITIONING);
/* Record the global variables. */
FOR_EACH_DEFINED_VARIABLE (vnode)
- vec_safe_push (lto_global_var_decls, vnode->symbol.decl);
+ vec_safe_push (lto_global_var_decls, vnode->decl);
}
}
create_pass_tab ();
FOR_EACH_FUNCTION (n)
- if (DECL_STRUCT_FUNCTION (n->symbol.decl))
+ if (DECL_STRUCT_FUNCTION (n->decl))
{
node = n;
break;
if (!node)
return;
- push_cfun (DECL_STRUCT_FUNCTION (node->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
dump_pass_list (all_lowering_passes, 1);
dump_pass_list (all_small_ipa_passes, 1);
{
struct cgraph_node *node;
FOR_EACH_DEFINED_FUNCTION (node)
- if (node->symbol.analyzed && gimple_has_body_p (node->symbol.decl)
- && (!node->clone_of || node->symbol.decl != node->clone_of->symbol.decl))
+ if (node->analyzed && gimple_has_body_p (node->decl)
+ && (!node->clone_of || node->decl != node->clone_of->decl))
{
- push_cfun (DECL_STRUCT_FUNCTION (node->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
callback (data);
if (!flag_wpa)
{
if (cgraph_function_with_gimple_body_p (node))
{
cgraph_get_body (node);
- push_cfun (DECL_STRUCT_FUNCTION (node->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
callback (data);
free_dominance_info (CDI_DOMINATORS);
free_dominance_info (CDI_POST_DOMINATORS);
ordering then matches the one IPA-passes get in their stmt_fixup
hooks. */
- push_cfun (DECL_STRUCT_FUNCTION (node->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
renumber_gimple_stmt_uids ();
pop_cfun ();
}
- if (node->symbol.definition)
- lto_set_symtab_encoder_in_partition (encoder, (symtab_node)node);
+ if (node->definition)
+ lto_set_symtab_encoder_in_partition (encoder, node);
}
FOR_EACH_DEFINED_FUNCTION (node)
- if (node->symbol.alias)
- lto_set_symtab_encoder_in_partition (encoder, (symtab_node)node);
+ if (node->alias)
+ lto_set_symtab_encoder_in_partition (encoder, node);
FOR_EACH_DEFINED_VARIABLE (vnode)
- lto_set_symtab_encoder_in_partition (encoder, (symtab_node)vnode);
+ lto_set_symtab_encoder_in_partition (encoder, vnode);
ipa_write_summaries_1 (compute_ltrans_boundary (encoder));
For functions newly born at WPA stage we need to initialize
the uids here. */
- if (node->symbol.definition
- && gimple_has_body_p (node->symbol.decl))
+ if (node->definition
+ && gimple_has_body_p (node->decl))
{
- push_cfun (DECL_STRUCT_FUNCTION (node->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
renumber_gimple_stmt_uids ();
pop_cfun ();
}
e;
e = e->next_caller)
{
- if (e->caller->symbol.decl == current_function_decl)
+ if (e->caller->decl == current_function_decl)
continue;
if (!cgraph_function_with_gimple_body_p (e->caller))
continue;
- if (TREE_ASM_WRITTEN (e->caller->symbol.decl))
+ if (TREE_ASM_WRITTEN (e->caller->decl))
continue;
if (!e->caller->process && !e->caller->global.inlined_to)
break;
hash_node (const void *p)
{
const_symtab_node n = (const_symtab_node ) p;
- return (hashval_t) DECL_UID (n->symbol.decl);
+ return (hashval_t) DECL_UID (n->decl);
}
{
const_symtab_node n1 = (const_symtab_node) p1;
const_symtab_node n2 = (const_symtab_node) p2;
- return DECL_UID (n1->symbol.decl) == DECL_UID (n2->symbol.decl);
+ return DECL_UID (n1->decl) == DECL_UID (n2->decl);
}
/* Returns a hash code for P. */
hash_node_by_assembler_name (const void *p)
{
const_symtab_node n = (const_symtab_node) p;
- return (hashval_t) decl_assembler_name_hash (DECL_ASSEMBLER_NAME (n->symbol.decl));
+ return (hashval_t) decl_assembler_name_hash (DECL_ASSEMBLER_NAME (n->decl));
}
/* Returns nonzero if P1 and P2 are equal. */
{
const_symtab_node n1 = (const_symtab_node) p1;
const_tree name = (const_tree)p2;
- return (decl_assembler_name_equal (n1->symbol.decl, name));
+ 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)
{
- if (is_a <varpool_node> (node) && DECL_HARD_REGISTER (node->symbol.decl))
+ if (is_a <varpool_node> (node) && DECL_HARD_REGISTER (node->decl))
return;
- gcc_checking_assert (!node->symbol.previous_sharing_asm_name
- && !node->symbol.next_sharing_asm_name);
+ gcc_checking_assert (!node->previous_sharing_asm_name
+ && !node->next_sharing_asm_name);
if (assembler_name_hash)
{
void **aslot;
struct cgraph_node *cnode;
- tree decl = node->symbol.decl;
+ tree decl = node->decl;
- tree name = DECL_ASSEMBLER_NAME (node->symbol.decl);
+ tree name = DECL_ASSEMBLER_NAME (node->decl);
aslot = htab_find_slot_with_hash (assembler_name_hash, name,
decl_assembler_name_hash (name),
INSERT);
gcc_assert (*aslot != node);
- node->symbol.next_sharing_asm_name = (symtab_node)*aslot;
+ node->next_sharing_asm_name = (symtab_node)*aslot;
if (*aslot != NULL)
- ((symtab_node)*aslot)->symbol.previous_sharing_asm_name = node;
+ ((symtab_node)*aslot)->previous_sharing_asm_name = node;
*aslot = node;
/* Update also possible inline clones sharing a decl. */
cnode = dyn_cast <cgraph_node> (node);
if (cnode && cnode->clones && with_clones)
for (cnode = cnode->clones; cnode; cnode = cnode->next_sibling_clone)
- if (cnode->symbol.decl == decl)
- insert_to_assembler_name_hash ((symtab_node) cnode, true);
+ if (cnode->decl == decl)
+ insert_to_assembler_name_hash (cnode, true);
}
}
if (assembler_name_hash)
{
struct cgraph_node *cnode;
- tree decl = node->symbol.decl;
+ tree decl = node->decl;
- if (node->symbol.next_sharing_asm_name)
- node->symbol.next_sharing_asm_name->symbol.previous_sharing_asm_name
- = node->symbol.previous_sharing_asm_name;
- if (node->symbol.previous_sharing_asm_name)
+ if (node->next_sharing_asm_name)
+ node->next_sharing_asm_name->previous_sharing_asm_name
+ = node->previous_sharing_asm_name;
+ if (node->previous_sharing_asm_name)
{
- node->symbol.previous_sharing_asm_name->symbol.next_sharing_asm_name
- = node->symbol.next_sharing_asm_name;
+ node->previous_sharing_asm_name->next_sharing_asm_name
+ = node->next_sharing_asm_name;
}
else
{
- tree name = DECL_ASSEMBLER_NAME (node->symbol.decl);
+ tree name = DECL_ASSEMBLER_NAME (node->decl);
void **slot;
slot = htab_find_slot_with_hash (assembler_name_hash, name,
decl_assembler_name_hash (name),
NO_INSERT);
gcc_assert (*slot == node);
- if (!node->symbol.next_sharing_asm_name)
+ if (!node->next_sharing_asm_name)
htab_clear_slot (assembler_name_hash, slot);
else
- *slot = node->symbol.next_sharing_asm_name;
+ *slot = node->next_sharing_asm_name;
}
- node->symbol.next_sharing_asm_name = NULL;
- node->symbol.previous_sharing_asm_name = NULL;
+ node->next_sharing_asm_name = NULL;
+ node->previous_sharing_asm_name = NULL;
/* Update also possible inline clones sharing a decl. */
cnode = dyn_cast <cgraph_node> (node);
if (cnode && cnode->clones && with_clones)
for (cnode = cnode->clones; cnode; cnode = cnode->next_sibling_clone)
- if (cnode->symbol.decl == decl)
- unlink_from_assembler_name_hash ((symtab_node) cnode, true);
+ if (cnode->decl == decl)
+ unlink_from_assembler_name_hash (cnode, true);
}
}
struct symtab_node_base key;
symtab_node *slot;
- node->symbol.next = symtab_nodes;
- node->symbol.previous = NULL;
+ node->next = symtab_nodes;
+ node->previous = NULL;
if (symtab_nodes)
- symtab_nodes->symbol.previous = node;
+ symtab_nodes->previous = node;
symtab_nodes = node;
if (!symtab_hash)
symtab_hash = htab_create_ggc (10, hash_node, eq_node, NULL);
- key.decl = node->symbol.decl;
+ key.decl = node->decl;
slot = (symtab_node *) htab_find_slot (symtab_hash, &key, INSERT);
if (*slot == NULL)
*slot = node;
- ipa_empty_ref_list (&node->symbol.ref_list);
+ ipa_empty_ref_list (&node->ref_list);
- node->symbol.order = symtab_order++;
+ node->order = symtab_order++;
/* Be sure to do this last; C++ FE might create new nodes via
DECL_ASSEMBLER_NAME langhook! */
if (!symtab_hash)
symtab_hash = htab_create_ggc (10, hash_node, eq_node, NULL);
- key.decl = node->symbol.decl;
+ key.decl = node->decl;
slot = (symtab_node *) htab_find_slot (symtab_hash, &key, INSERT);
*slot = node;
}
symtab_unregister_node (symtab_node node)
{
void **slot;
- ipa_remove_all_references (&node->symbol.ref_list);
- ipa_remove_all_referring (&node->symbol.ref_list);
+ ipa_remove_all_references (&node->ref_list);
+ ipa_remove_all_referring (&node->ref_list);
- if (node->symbol.same_comdat_group)
+ if (node->same_comdat_group)
{
symtab_node prev;
- for (prev = node->symbol.same_comdat_group;
- prev->symbol.same_comdat_group != node;
- prev = prev->symbol.same_comdat_group)
+ for (prev = node->same_comdat_group;
+ prev->same_comdat_group != node;
+ prev = prev->same_comdat_group)
;
- if (node->symbol.same_comdat_group == prev)
- prev->symbol.same_comdat_group = NULL;
+ if (node->same_comdat_group == prev)
+ prev->same_comdat_group = NULL;
else
- prev->symbol.same_comdat_group = node->symbol.same_comdat_group;
- node->symbol.same_comdat_group = NULL;
+ prev->same_comdat_group = node->same_comdat_group;
+ node->same_comdat_group = NULL;
}
- if (node->symbol.previous)
- node->symbol.previous->symbol.next = node->symbol.next;
+ if (node->previous)
+ node->previous->next = node->next;
else
- symtab_nodes = node->symbol.next;
- if (node->symbol.next)
- node->symbol.next->symbol.previous = node->symbol.previous;
- node->symbol.next = NULL;
- node->symbol.previous = NULL;
+ symtab_nodes = node->next;
+ if (node->next)
+ node->next->previous = node->previous;
+ node->next = NULL;
+ node->previous = NULL;
slot = htab_find_slot (symtab_hash, node, NO_INSERT);
{
symtab_node replacement_node = NULL;
if (cgraph_node *cnode = dyn_cast <cgraph_node> (node))
- replacement_node = (symtab_node)cgraph_find_replacement_node (cnode);
+ replacement_node = cgraph_find_replacement_node (cnode);
if (!replacement_node)
htab_clear_slot (symtab_hash, slot);
else
*slot = replacement_node;
}
- if (!is_a <varpool_node> (node) || !DECL_HARD_REGISTER (node->symbol.decl))
+ if (!is_a <varpool_node> (node) || !DECL_HARD_REGISTER (node->decl))
unlink_from_assembler_name_hash (node, false);
}
symtab_add_to_same_comdat_group (symtab_node new_node,
symtab_node old_node)
{
- gcc_assert (DECL_ONE_ONLY (old_node->symbol.decl));
- gcc_assert (!new_node->symbol.same_comdat_group);
+ gcc_assert (DECL_ONE_ONLY (old_node->decl));
+ gcc_assert (!new_node->same_comdat_group);
gcc_assert (new_node != old_node);
- DECL_COMDAT_GROUP (new_node->symbol.decl) = DECL_COMDAT_GROUP (old_node->symbol.decl);
- new_node->symbol.same_comdat_group = old_node;
- if (!old_node->symbol.same_comdat_group)
- old_node->symbol.same_comdat_group = new_node;
+ DECL_COMDAT_GROUP (new_node->decl) = DECL_COMDAT_GROUP (old_node->decl);
+ new_node->same_comdat_group = old_node;
+ if (!old_node->same_comdat_group)
+ old_node->same_comdat_group = new_node;
else
{
symtab_node n;
- for (n = old_node->symbol.same_comdat_group;
- n->symbol.same_comdat_group != old_node;
- n = n->symbol.same_comdat_group)
+ for (n = old_node->same_comdat_group;
+ n->same_comdat_group != old_node;
+ n = n->same_comdat_group)
;
- n->symbol.same_comdat_group = new_node;
+ n->same_comdat_group = new_node;
}
}
{
symtab_node n = node, next;
- if (!node->symbol.same_comdat_group)
+ if (!node->same_comdat_group)
return;
do
{
- next = n->symbol.same_comdat_group;
- n->symbol.same_comdat_group = NULL;
+ next = n->same_comdat_group;
+ n->same_comdat_group = NULL;
n = next;
}
while (n != node);
const char *
symtab_node_asm_name (symtab_node node)
{
- if (!DECL_ASSEMBLER_NAME_SET_P (node->symbol.decl))
- return lang_hooks.decl_printable_name (node->symbol.decl, 2);
- return IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->symbol.decl));
+ if (!DECL_ASSEMBLER_NAME_SET_P (node->decl))
+ return lang_hooks.decl_printable_name (node->decl, 2);
+ return IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->decl));
}
/* Return printable identifier name. */
const char *
symtab_node_name (symtab_node node)
{
- return lang_hooks.decl_printable_name (node->symbol.decl, 2);
+ return lang_hooks.decl_printable_name (node->decl, 2);
}
static const char * const symtab_type_names[] = {"symbol", "function", "variable"};
fprintf (f, "%s/%i (%s)",
symtab_node_asm_name (node),
- node->symbol.order,
+ node->order,
symtab_node_name (node));
dump_addr (f, " @", (void *)node);
- fprintf (f, "\n Type: %s", symtab_type_names[node->symbol.type]);
+ fprintf (f, "\n Type: %s", symtab_type_names[node->type]);
- if (node->symbol.definition)
+ if (node->definition)
fprintf (f, " definition");
- if (node->symbol.analyzed)
+ if (node->analyzed)
fprintf (f, " analyzed");
- if (node->symbol.alias)
+ if (node->alias)
fprintf (f, " alias");
- if (node->symbol.weakref)
+ if (node->weakref)
fprintf (f, " weakref");
- if (node->symbol.cpp_implicit_alias)
+ if (node->cpp_implicit_alias)
fprintf (f, " cpp_implicit_alias");
- if (node->symbol.alias_target)
+ if (node->alias_target)
fprintf (f, " target:%s",
- DECL_P (node->symbol.alias_target)
+ DECL_P (node->alias_target)
? IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME
- (node->symbol.alias_target))
- : IDENTIFIER_POINTER (node->symbol.alias_target));
+ (node->alias_target))
+ : IDENTIFIER_POINTER (node->alias_target));
fprintf (f, "\n Visibility:");
- if (node->symbol.in_other_partition)
+ if (node->in_other_partition)
fprintf (f, " in_other_partition");
- if (node->symbol.used_from_other_partition)
+ if (node->used_from_other_partition)
fprintf (f, " used_from_other_partition");
- if (node->symbol.force_output)
+ if (node->force_output)
fprintf (f, " force_output");
- if (node->symbol.forced_by_abi)
+ if (node->forced_by_abi)
fprintf (f, " forced_by_abi");
- if (node->symbol.externally_visible)
+ if (node->externally_visible)
fprintf (f, " externally_visible");
- if (node->symbol.resolution != LDPR_UNKNOWN)
+ if (node->resolution != LDPR_UNKNOWN)
fprintf (f, " %s",
- ld_plugin_symbol_resolution_names[(int)node->symbol.resolution]);
- if (TREE_ASM_WRITTEN (node->symbol.decl))
+ ld_plugin_symbol_resolution_names[(int)node->resolution]);
+ if (TREE_ASM_WRITTEN (node->decl))
fprintf (f, " asm_written");
- if (DECL_EXTERNAL (node->symbol.decl))
+ if (DECL_EXTERNAL (node->decl))
fprintf (f, " external");
- if (TREE_PUBLIC (node->symbol.decl))
+ if (TREE_PUBLIC (node->decl))
fprintf (f, " public");
- if (DECL_COMMON (node->symbol.decl))
+ if (DECL_COMMON (node->decl))
fprintf (f, " common");
- if (DECL_WEAK (node->symbol.decl))
+ if (DECL_WEAK (node->decl))
fprintf (f, " weak");
- if (DECL_DLLIMPORT_P (node->symbol.decl))
+ if (DECL_DLLIMPORT_P (node->decl))
fprintf (f, " dll_import");
- if (DECL_COMDAT (node->symbol.decl))
+ if (DECL_COMDAT (node->decl))
fprintf (f, " comdat");
- if (DECL_COMDAT_GROUP (node->symbol.decl))
+ if (DECL_COMDAT_GROUP (node->decl))
fprintf (f, " comdat_group:%s",
- IDENTIFIER_POINTER (DECL_COMDAT_GROUP (node->symbol.decl)));
- if (DECL_ONE_ONLY (node->symbol.decl))
+ IDENTIFIER_POINTER (DECL_COMDAT_GROUP (node->decl)));
+ if (DECL_ONE_ONLY (node->decl))
fprintf (f, " one_only");
- if (DECL_SECTION_NAME (node->symbol.decl))
+ if (DECL_SECTION_NAME (node->decl))
fprintf (f, " section_name:%s",
- TREE_STRING_POINTER (DECL_SECTION_NAME (node->symbol.decl)));
- if (DECL_VISIBILITY_SPECIFIED (node->symbol.decl))
+ TREE_STRING_POINTER (DECL_SECTION_NAME (node->decl)));
+ if (DECL_VISIBILITY_SPECIFIED (node->decl))
fprintf (f, " visibility_specified");
- if (DECL_VISIBILITY (node->symbol.decl))
+ if (DECL_VISIBILITY (node->decl))
fprintf (f, " visibility:%s",
- visibility_types [DECL_VISIBILITY (node->symbol.decl)]);
- if (DECL_VIRTUAL_P (node->symbol.decl))
+ visibility_types [DECL_VISIBILITY (node->decl)]);
+ if (DECL_VIRTUAL_P (node->decl))
fprintf (f, " virtual");
- if (DECL_ARTIFICIAL (node->symbol.decl))
+ if (DECL_ARTIFICIAL (node->decl))
fprintf (f, " artificial");
- if (TREE_CODE (node->symbol.decl) == FUNCTION_DECL)
+ if (TREE_CODE (node->decl) == FUNCTION_DECL)
{
- if (DECL_STATIC_CONSTRUCTOR (node->symbol.decl))
+ if (DECL_STATIC_CONSTRUCTOR (node->decl))
fprintf (f, " constructor");
- if (DECL_STATIC_DESTRUCTOR (node->symbol.decl))
+ if (DECL_STATIC_DESTRUCTOR (node->decl))
fprintf (f, " destructor");
}
fprintf (f, "\n");
- if (node->symbol.same_comdat_group)
+ if (node->same_comdat_group)
fprintf (f, " Same comdat group as: %s/%i\n",
- symtab_node_asm_name (node->symbol.same_comdat_group),
- node->symbol.same_comdat_group->symbol.order);
- if (node->symbol.next_sharing_asm_name)
+ symtab_node_asm_name (node->same_comdat_group),
+ node->same_comdat_group->order);
+ if (node->next_sharing_asm_name)
fprintf (f, " next sharing asm name: %i\n",
- node->symbol.next_sharing_asm_name->symbol.order);
- if (node->symbol.previous_sharing_asm_name)
+ node->next_sharing_asm_name->order);
+ if (node->previous_sharing_asm_name)
fprintf (f, " previous sharing asm name: %i\n",
- node->symbol.previous_sharing_asm_name->symbol.order);
+ node->previous_sharing_asm_name->order);
- if (node->symbol.address_taken)
+ if (node->address_taken)
fprintf (f, " Address is taken.\n");
- if (node->symbol.aux)
+ if (node->aux)
{
fprintf (f, " Aux:");
- dump_addr (f, " @", (void *)node->symbol.aux);
+ dump_addr (f, " @", (void *)node->aux);
}
fprintf (f, " References: ");
- ipa_dump_references (f, &node->symbol.ref_list);
+ ipa_dump_references (f, &node->ref_list);
fprintf (f, " Referring: ");
- ipa_dump_referring (f, &node->symbol.ref_list);
- if (node->symbol.lto_file_data)
+ ipa_dump_referring (f, &node->ref_list);
+ if (node->lto_file_data)
fprintf (f, " Read from file: %s\n",
- node->symbol.lto_file_data->file_name);
+ node->lto_file_data->file_name);
}
/* Dump symtab node. */
if (is_a <cgraph_node> (node))
{
- if (TREE_CODE (node->symbol.decl) != FUNCTION_DECL)
+ if (TREE_CODE (node->decl) != FUNCTION_DECL)
{
error ("function symbol is not function");
error_found = true;
}
else if (is_a <varpool_node> (node))
{
- if (TREE_CODE (node->symbol.decl) != VAR_DECL)
+ if (TREE_CODE (node->decl) != VAR_DECL)
{
error ("variable symbol is not variable");
error_found = true;
if (cgraph_state != CGRAPH_LTO_STREAMING)
{
- hashed_node = symtab_get_node (node->symbol.decl);
+ hashed_node = symtab_get_node (node->decl);
if (!hashed_node)
{
error ("node not found in symtab decl hashtable");
if (hashed_node != node
&& (!is_a <cgraph_node> (node)
|| !dyn_cast <cgraph_node> (node)->clone_of
- || dyn_cast <cgraph_node> (node)->clone_of->symbol.decl
- != node->symbol.decl))
+ || dyn_cast <cgraph_node> (node)->clone_of->decl
+ != node->decl))
{
error ("node differs from symtab decl hashtable");
error_found = true;
}
if (assembler_name_hash)
{
- hashed_node = symtab_node_for_asm (DECL_ASSEMBLER_NAME (node->symbol.decl));
- if (hashed_node && hashed_node->symbol.previous_sharing_asm_name)
+ hashed_node = symtab_node_for_asm (DECL_ASSEMBLER_NAME (node->decl));
+ if (hashed_node && hashed_node->previous_sharing_asm_name)
{
error ("assembler name hash list corrupted");
error_found = true;
{
if (hashed_node == node)
break;
- hashed_node = hashed_node->symbol.next_sharing_asm_name;
+ hashed_node = hashed_node->next_sharing_asm_name;
}
if (!hashed_node
&& !(is_a <varpool_node> (node)
- || DECL_HARD_REGISTER (node->symbol.decl)))
+ || DECL_HARD_REGISTER (node->decl)))
{
error ("node not found in symtab assembler name hash");
error_found = true;
}
}
- if (node->symbol.previous_sharing_asm_name
- && node->symbol.previous_sharing_asm_name->symbol.next_sharing_asm_name != node)
+ if (node->previous_sharing_asm_name
+ && node->previous_sharing_asm_name->next_sharing_asm_name != node)
{
error ("double linked list of assembler names corrupted");
error_found = true;
}
- if (node->symbol.analyzed && !node->symbol.definition)
+ if (node->analyzed && !node->definition)
{
error ("node is analyzed byt it is not a definition");
error_found = true;
}
- if (node->symbol.cpp_implicit_alias && !node->symbol.alias)
+ if (node->cpp_implicit_alias && !node->alias)
{
error ("node is alias but not implicit alias");
error_found = true;
}
- if (node->symbol.alias && !node->symbol.definition
- && !node->symbol.weakref)
+ if (node->alias && !node->definition
+ && !node->weakref)
{
error ("node is alias but not definition");
error_found = true;
}
- if (node->symbol.weakref && !node->symbol.alias)
+ if (node->weakref && !node->alias)
{
error ("node is weakref but not an alias");
error_found = true;
}
- if (node->symbol.same_comdat_group)
+ if (node->same_comdat_group)
{
- symtab_node n = node->symbol.same_comdat_group;
+ symtab_node n = node->same_comdat_group;
- if (!DECL_ONE_ONLY (n->symbol.decl))
+ if (!DECL_ONE_ONLY (n->decl))
{
error ("non-DECL_ONE_ONLY node in a same_comdat_group list");
error_found = true;
}
- if (n->symbol.type != node->symbol.type)
+ if (n->type != node->type)
{
error ("mixing different types of symbol in same comdat groups is not supported");
error_found = true;
}
do
{
- if (!n->symbol.same_comdat_group)
+ if (!n->same_comdat_group)
{
error ("same_comdat_group is not a circular list");
error_found = true;
break;
}
- n = n->symbol.same_comdat_group;
+ n = n->same_comdat_group;
}
while (n != node);
}
bool
symtab_used_from_object_file_p (symtab_node node)
{
- if (!TREE_PUBLIC (node->symbol.decl) || DECL_EXTERNAL (node->symbol.decl))
+ if (!TREE_PUBLIC (node->decl) || DECL_EXTERNAL (node->decl))
return false;
- if (resolution_used_from_other_file_p (node->symbol.resolution))
+ if (resolution_used_from_other_file_p (node->resolution))
return true;
return false;
}
{
bool weakref_p = false;
- if (!node->symbol.alias)
+ if (!node->alias)
{
if (availability)
*availability = symtab_node_availability (node);
if (availability)
{
- weakref_p = node->symbol.weakref;
+ weakref_p = node->weakref;
if (!weakref_p)
*availability = symtab_node_availability (node);
else
}
while (node)
{
- if (node->symbol.alias && node->symbol.analyzed)
+ if (node->alias && node->analyzed)
node = symtab_alias_target (node);
else
{
if (!availability)
;
- else if (node->symbol.analyzed)
+ else if (node->analyzed)
{
if (weakref_p)
{
enum availability a = symtab_node_availability (node);
if (a < *availability)
*availability = a;
- weakref_p = node->symbol.weakref;
+ weakref_p = node->weakref;
}
}
if (availability)
{
if (is_a <cgraph_node> (node))
{
- DECL_DECLARED_INLINE_P (node->symbol.decl)
- = DECL_DECLARED_INLINE_P (target->symbol.decl);
- DECL_DISREGARD_INLINE_LIMITS (node->symbol.decl)
- = DECL_DISREGARD_INLINE_LIMITS (target->symbol.decl);
+ DECL_DECLARED_INLINE_P (node->decl)
+ = DECL_DECLARED_INLINE_P (target->decl);
+ DECL_DISREGARD_INLINE_LIMITS (node->decl)
+ = DECL_DISREGARD_INLINE_LIMITS (target->decl);
}
/* FIXME: It is not really clear why those flags should not be copied for
functions, too. */
else
{
- DECL_WEAK (node->symbol.decl) = DECL_WEAK (target->symbol.decl);
- DECL_EXTERNAL (node->symbol.decl) = DECL_EXTERNAL (target->symbol.decl);
- DECL_VISIBILITY (node->symbol.decl) = DECL_VISIBILITY (target->symbol.decl);
+ DECL_WEAK (node->decl) = DECL_WEAK (target->decl);
+ DECL_EXTERNAL (node->decl) = DECL_EXTERNAL (target->decl);
+ DECL_VISIBILITY (node->decl) = DECL_VISIBILITY (target->decl);
}
- DECL_VIRTUAL_P (node->symbol.decl) = DECL_VIRTUAL_P (target->symbol.decl);
- if (TREE_PUBLIC (node->symbol.decl))
+ DECL_VIRTUAL_P (node->decl) = DECL_VIRTUAL_P (target->decl);
+ if (TREE_PUBLIC (node->decl))
{
- DECL_EXTERNAL (node->symbol.decl) = DECL_EXTERNAL (target->symbol.decl);
- DECL_COMDAT (node->symbol.decl) = DECL_COMDAT (target->symbol.decl);
- DECL_COMDAT_GROUP (node->symbol.decl)
- = DECL_COMDAT_GROUP (target->symbol.decl);
- if (DECL_ONE_ONLY (target->symbol.decl)
- && !node->symbol.same_comdat_group)
- symtab_add_to_same_comdat_group ((symtab_node)node, (symtab_node)target);
+ DECL_EXTERNAL (node->decl) = DECL_EXTERNAL (target->decl);
+ DECL_COMDAT (node->decl) = DECL_COMDAT (target->decl);
+ DECL_COMDAT_GROUP (node->decl)
+ = DECL_COMDAT_GROUP (target->decl);
+ if (DECL_ONE_ONLY (target->decl)
+ && !node->same_comdat_group)
+ symtab_add_to_same_comdat_group (node, target);
}
- node->symbol.externally_visible = target->symbol.externally_visible;
+ node->externally_visible = target->externally_visible;
}
/* Add reference recording that NODE is alias of TARGET.
{
symtab_node n;
- gcc_assert (!node->symbol.analyzed
- && !vec_safe_length (node->symbol.ref_list.references));
+ gcc_assert (!node->analyzed
+ && !vec_safe_length (node->ref_list.references));
/* Never let cycles to creep into the symbol table alias references;
those will make alias walkers to be infinite. */
- for (n = target; n && n->symbol.alias;
- n = n->symbol.analyzed ? symtab_alias_target (n) : NULL)
+ for (n = target; n && n->alias;
+ n = n->analyzed ? symtab_alias_target (n) : NULL)
if (n == node)
{
if (is_a <cgraph_node> (node))
- error ("function %q+D part of alias cycle", node->symbol.decl);
+ error ("function %q+D part of alias cycle", node->decl);
else if (is_a <varpool_node> (node))
- error ("variable %q+D part of alias cycle", node->symbol.decl);
+ error ("variable %q+D part of alias cycle", node->decl);
else
gcc_unreachable ();
- node->symbol.alias = false;
+ node->alias = false;
return false;
}
/* "analyze" the node - i.e. mark the reference. */
- node->symbol.definition = true;
- node->symbol.alias = true;
- node->symbol.analyzed = true;
+ node->definition = true;
+ node->alias = true;
+ node->analyzed = true;
ipa_record_reference (node, target, IPA_REF_ALIAS, NULL);
/* Alias targets become reudndant after alias is resolved into an reference.
We do not want to keep it around or we would have to mind updating them
when renaming symbols. */
- node->symbol.alias_target = NULL;
+ node->alias_target = NULL;
- if (node->symbol.cpp_implicit_alias && cgraph_state >= CGRAPH_STATE_CONSTRUCTION)
+ if (node->cpp_implicit_alias && cgraph_state >= CGRAPH_STATE_CONSTRUCTION)
fixup_same_cpp_alias_visibility (node, target);
/* If alias has address taken, so does the target. */
- if (node->symbol.address_taken)
- symtab_alias_ultimate_target (target, NULL)->symbol.address_taken = true;
+ if (node->address_taken)
+ symtab_alias_ultimate_target (target, NULL)->address_taken = true;
return true;
}
if (callback (node, data))
return true;
- for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list, i, ref); i++)
+ 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;
static bool
symtab_nonoverwritable_alias_1 (symtab_node node, void *data)
{
- if (decl_binds_to_current_def_p (node->symbol.decl))
+ if (decl_binds_to_current_def_p (node->decl))
{
*(symtab_node *)data = node;
return true;
/* First try to look up existing alias or base object
(if that is already non-overwritable). */
node = symtab_alias_ultimate_target (node, NULL);
- gcc_assert (!node->symbol.alias && !node->symbol.weakref);
+ gcc_assert (!node->alias && !node->weakref);
symtab_for_node_and_aliases (node, symtab_nonoverwritable_alias_1,
(void *)&new_node, true);
if (new_node)
#endif
/* Otherwise create a new one. */
- new_decl = copy_node (node->symbol.decl);
- DECL_NAME (new_decl) = clone_function_name (node->symbol.decl, "localalias");
+ new_decl = copy_node (node->decl);
+ DECL_NAME (new_decl) = clone_function_name (node->decl, "localalias");
if (TREE_CODE (new_decl) == FUNCTION_DECL)
DECL_STRUCT_FUNCTION (new_decl) = NULL;
DECL_INITIAL (new_decl) = NULL;
/* Update the properties. */
DECL_EXTERNAL (new_decl) = 0;
- if (DECL_ONE_ONLY (node->symbol.decl))
+ if (DECL_ONE_ONLY (node->decl))
DECL_SECTION_NAME (new_decl) = NULL;
DECL_COMDAT_GROUP (new_decl) = 0;
TREE_PUBLIC (new_decl) = 0;
{
DECL_STATIC_CONSTRUCTOR (new_decl) = 0;
DECL_STATIC_DESTRUCTOR (new_decl) = 0;
- new_node = (symtab_node) cgraph_create_function_alias
- (new_decl, node->symbol.decl);
+ new_node = cgraph_create_function_alias
+ (new_decl, node->decl);
}
else
- new_node = (symtab_node) varpool_create_variable_alias (new_decl,
- node->symbol.decl);
+ new_node = varpool_create_variable_alias (new_decl,
+ node->decl);
symtab_resolve_alias (new_node, node);
gcc_assert (decl_binds_to_current_def_p (new_decl));
return new_node;
symtab_node ba, bb;
/* Equivalent functions are equivalent. */
- if (a->symbol.decl == b->symbol.decl)
+ if (a->decl == b->decl)
return true;
/* If symbol is not overwritable by different implementation,
if (!node && flag_ltrans)
needed = false;
- else if (node && node->symbol.definition)
+ else if (node && node->definition)
needed = false;
- else if (node && node->symbol.alias)
+ else if (node && node->alias)
needed = false;
else if (!cgraph_global_info_ready
&& (TREE_USED (decl)
|| TREE_USED (DECL_ASSEMBLER_NAME (decl))))
/* needed */;
- else if (node && node->symbol.analyzed)
+ else if (node && node->analyzed)
/* needed */;
else if (DECL_COMDAT (decl))
needed = false;
{
struct tm_ipa_cg_data *d;
- if (traverse_aliases && (*node)->symbol.alias)
+ if (traverse_aliases && (*node)->alias)
*node = cgraph_alias_target (*node);
- d = (struct tm_ipa_cg_data *) (*node)->symbol.aux;
+ d = (struct tm_ipa_cg_data *) (*node)->aux;
if (d == NULL)
{
d = (struct tm_ipa_cg_data *)
obstack_alloc (&tm_obstack.obstack, sizeof (*d));
- (*node)->symbol.aux = (void *) d;
+ (*node)->aux = (void *) d;
memset (d, 0, sizeof (*d));
}
ipa_tm_scan_calls_clone (struct cgraph_node *node,
cgraph_node_queue *callees_p)
{
- struct function *fn = DECL_STRUCT_FUNCTION (node->symbol.decl);
+ struct function *fn = DECL_STRUCT_FUNCTION (node->decl);
basic_block bb;
FOR_EACH_BB_FN (bb, fn)
continue;
/* Even if we think we can go irrevocable, believe the user
above all. */
- if (is_tm_safe_or_pure (e->caller->symbol.decl))
+ if (is_tm_safe_or_pure (e->caller->decl))
continue;
caller = e->caller;
bool ret = false;
/* Builtin operators (operator new, and such). */
- if (DECL_STRUCT_FUNCTION (node->symbol.decl) == NULL
- || DECL_STRUCT_FUNCTION (node->symbol.decl)->cfg == NULL)
+ if (DECL_STRUCT_FUNCTION (node->decl) == NULL
+ || DECL_STRUCT_FUNCTION (node->decl)->cfg == NULL)
return false;
- push_cfun (DECL_STRUCT_FUNCTION (node->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
calculate_dominance_info (CDI_DOMINATORS);
d = get_cg_data (&node, true);
unsigned flags;
d = get_cg_data (&node, true);
- decl = node->symbol.decl;
+ decl = node->decl;
flags = flags_from_decl_or_type (decl);
/* Handle some TM builtins. Ordinarily these aren't actually generated
/* Recurse on the main body for aliases. In general, this will
result in one of the bits above being set so that we will not
have to recurse next time. */
- if (node->symbol.alias)
+ if (node->alias)
return ipa_tm_mayenterirr_function (cgraph_get_node (node->thunk.alias));
/* What remains is unmarked local functions without items that force
struct cgraph_edge *e;
for (e = node->callees; e ; e = e->next_callee)
- if (!is_tm_callable (e->callee->symbol.decl)
+ if (!is_tm_callable (e->callee->decl)
&& e->callee->local.tm_may_enter_irr)
error_at (gimple_location (e->call_stmt),
"unsafe function call %qD within "
- "%<transaction_safe%> function", e->callee->symbol.decl);
+ "%<transaction_safe%> function", e->callee->decl);
}
/* Diagnose call from atomic transactions to unmarked functions
ipa_tm_mark_force_output_node (struct cgraph_node *node)
{
cgraph_mark_force_output_node (node);
- node->symbol.analyzed = true;
+ node->analyzed = true;
}
static inline void
ipa_tm_mark_forced_by_abi_node (struct cgraph_node *node)
{
- node->symbol.forced_by_abi = true;
- node->symbol.analyzed = true;
+ node->forced_by_abi = true;
+ node->analyzed = true;
}
/* Callback data for ipa_tm_create_version_alias. */
tree old_decl, new_decl, tm_name;
struct cgraph_node *new_node;
- if (!node->symbol.cpp_implicit_alias)
+ if (!node->cpp_implicit_alias)
return false;
- old_decl = node->symbol.decl;
+ old_decl = node->decl;
tm_name = tm_mangle (DECL_ASSEMBLER_NAME (old_decl));
new_decl = build_decl (DECL_SOURCE_LOCATION (old_decl),
TREE_CODE (old_decl), tm_name,
new_node = cgraph_same_body_alias (NULL, new_decl, info->new_decl);
new_node->tm_clone = true;
- new_node->symbol.externally_visible = info->old_node->symbol.externally_visible;
+ new_node->externally_visible = info->old_node->externally_visible;
/* ?? Do not traverse aliases here. */
get_cg_data (&node, false)->clone = new_node;
record_tm_clone_pair (old_decl, new_decl);
- if (info->old_node->symbol.force_output
- || ipa_ref_list_first_referring (&info->old_node->symbol.ref_list))
+ if (info->old_node->force_output
+ || ipa_ref_list_first_referring (&info->old_node->ref_list))
ipa_tm_mark_force_output_node (new_node);
- if (info->old_node->symbol.forced_by_abi)
+ if (info->old_node->forced_by_abi)
ipa_tm_mark_forced_by_abi_node (new_node);
return false;
}
tree new_decl, old_decl, tm_name;
struct cgraph_node *new_node;
- old_decl = old_node->symbol.decl;
+ old_decl = old_node->decl;
new_decl = copy_node (old_decl);
/* DECL_ASSEMBLER_NAME needs to be set before we call
new_node = cgraph_copy_node_for_versioning (old_node, new_decl, vNULL, NULL);
new_node->local.local = false;
- new_node->symbol.externally_visible = old_node->symbol.externally_visible;
+ new_node->externally_visible = old_node->externally_visible;
new_node->lowered = true;
new_node->tm_clone = 1;
get_cg_data (&old_node, true)->clone = new_node;
record_tm_clone_pair (old_decl, new_decl);
cgraph_call_function_insertion_hooks (new_node);
- if (old_node->symbol.force_output
- || ipa_ref_list_first_referring (&old_node->symbol.ref_list))
+ if (old_node->force_output
+ || ipa_ref_list_first_referring (&old_node->ref_list))
ipa_tm_mark_force_output_node (new_node);
- if (old_node->symbol.forced_by_abi)
+ if (old_node->forced_by_abi)
ipa_tm_mark_forced_by_abi_node (new_node);
/* Do the same thing, but for any aliases of the original node. */
cgraph_get_create_node
(builtin_decl_explicit (BUILT_IN_TM_IRREVOCABLE)),
g, 0,
- compute_call_stmt_bb_frequency (node->symbol.decl,
+ compute_call_stmt_bb_frequency (node->decl,
gimple_bb (g)));
}
gsi_insert_before (gsi, g, GSI_SAME_STMT);
cgraph_create_edge (node, cgraph_get_create_node (gettm_fn), g, 0,
- compute_call_stmt_bb_frequency (node->symbol.decl,
+ compute_call_stmt_bb_frequency (node->decl,
gimple_bb (g)));
/* Cast return value from tm_gettmclone* into appropriate function
return;
}
- fndecl = new_node->symbol.decl;
+ fndecl = new_node->decl;
}
cgraph_redirect_edge_callee (e, new_node);
d = get_cg_data (&node, true);
- push_cfun (DECL_STRUCT_FUNCTION (node->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
calculate_dominance_info (CDI_DOMINATORS);
for (region = d->all_tm_regions; region; region = region->next)
if (!node->callees && !node->indirect_calls && !d->irrevocable_blocks_clone)
return;
- push_cfun (DECL_STRUCT_FUNCTION (d->clone->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (d->clone->decl));
calculate_dominance_info (CDI_DOMINATORS);
need_ssa_rename =
/* For all local functions marked tm_callable, queue them. */
FOR_EACH_DEFINED_FUNCTION (node)
- if (is_tm_callable (node->symbol.decl)
+ if (is_tm_callable (node->decl)
&& cgraph_function_body_availability (node) >= AVAIL_OVERWRITABLE)
{
d = get_cg_data (&node, true);
/* ... marked tm_pure, record that fact for the runtime by
indicating that the pure function is its own tm_callable.
No need to do this if the function's address can't be taken. */
- if (is_tm_pure (node->symbol.decl))
+ if (is_tm_pure (node->decl))
{
if (!node->local.local)
- record_tm_clone_pair (node->symbol.decl, node->symbol.decl);
+ record_tm_clone_pair (node->decl, node->decl);
continue;
}
- push_cfun (DECL_STRUCT_FUNCTION (node->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
calculate_dominance_info (CDI_DOMINATORS);
tm_region_init (NULL);
/* Some callees cannot be arbitrarily cloned. These will always be
irrevocable. Mark these now, so that we need not scan them. */
- if (is_tm_irrevocable (node->symbol.decl))
+ if (is_tm_irrevocable (node->decl))
ipa_tm_note_irrevocable (node, &irr_worklist);
else if (a <= AVAIL_NOT_AVAILABLE
- && !is_tm_safe_or_pure (node->symbol.decl))
+ && !is_tm_safe_or_pure (node->decl))
ipa_tm_note_irrevocable (node, &irr_worklist);
else if (a >= AVAIL_OVERWRITABLE)
{
- if (!tree_versionable_function_p (node->symbol.decl))
+ if (!tree_versionable_function_p (node->decl))
ipa_tm_note_irrevocable (node, &irr_worklist);
else if (!d->is_irrevocable)
{
/* If this is an alias, make sure its base is queued as well.
we need not scan the callees now, as the base will do. */
- if (node->symbol.alias)
+ if (node->alias)
{
node = cgraph_get_node (node->thunk.alias);
d = get_cg_data (&node, true);
for (e = node->callers; e ; e = e->next_caller)
{
caller = e->caller;
- if (!is_tm_safe_or_pure (caller->symbol.decl)
+ if (!is_tm_safe_or_pure (caller->decl)
&& !caller->local.tm_may_enter_irr)
{
d = get_cg_data (&caller, true);
}
/* Propagate back to referring aliases as well. */
- for (j = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list, j, ref); j++)
+ for (j = 0; ipa_ref_list_referring_iterate (&node->ref_list, j, ref); j++)
{
caller = cgraph (ref->referring);
if (ref->use == IPA_REF_ALIAS
&& cgraph_function_body_availability (node) >= AVAIL_OVERWRITABLE)
{
d = get_cg_data (&node, true);
- if (is_tm_safe (node->symbol.decl))
+ if (is_tm_safe (node->decl))
ipa_tm_diagnose_tm_safe (node);
else if (d->all_tm_regions)
ipa_tm_diagnose_transaction (node, d->all_tm_regions);
bool doit = false;
node = tm_callees[i];
- if (node->symbol.cpp_implicit_alias)
+ if (node->cpp_implicit_alias)
continue;
a = cgraph_function_body_availability (node);
d = get_cg_data (&node, true);
if (a <= AVAIL_NOT_AVAILABLE)
- doit = is_tm_callable (node->symbol.decl);
- else if (a <= AVAIL_AVAILABLE && is_tm_callable (node->symbol.decl))
+ doit = is_tm_callable (node->decl);
+ else if (a <= AVAIL_AVAILABLE && is_tm_callable (node->decl))
doit = true;
else if (!d->is_irrevocable
&& d->tm_callers_normal + d->tm_callers_clone > 0)
for (i = 0; i < tm_callees.length (); ++i)
{
node = tm_callees[i];
- if (node->symbol.analyzed)
+ if (node->analyzed)
{
d = get_cg_data (&node, true);
if (d->clone)
free_original_copy_tables ();
FOR_EACH_FUNCTION (node)
- node->symbol.aux = NULL;
+ node->aux = NULL;
#ifdef ENABLE_CHECKING
verify_cgraph ();
if (!DECL_EXTERNAL (expr))
return false;
node = cgraph_function_node (cgraph_get_node (expr), NULL);
- if (node && node->symbol.in_other_partition)
+ if (node && node->in_other_partition)
return false;
return true;
}
if (!DECL_EXTERNAL (expr))
return false;
node = varpool_variable_node (varpool_get_node (expr), NULL);
- if (node && node->symbol.in_other_partition)
+ if (node && node->in_other_partition)
return false;
return true;
}
else
varpool_create_variable_alias (to,
varpool_node_for_asm
- (DECL_ASSEMBLER_NAME (DECL_VALUE_EXPR (alias_of)))->symbol.decl);
+ (DECL_ASSEMBLER_NAME (DECL_VALUE_EXPR (alias_of)))->decl);
return to;
}
i = emutls_index (decl);
var = control_vars[i];
- return var->symbol.decl;
+ return var->decl;
}
/* Generate a call statement to initialize CONTROL_DECL for TLS_DECL.
gimple x;
cvar = control_vars[index];
- cdecl = cvar->symbol.decl;
+ cdecl = cvar->decl;
TREE_ADDRESSABLE (cdecl) = 1;
addr = create_tmp_var (build_pointer_type (TREE_TYPE (decl)), NULL);
/* We may be adding a new reference to a new variable to the function.
This means we have to play with the ipa-reference web. */
- ipa_record_reference ((symtab_node)d->cfun_node, (symtab_node)cvar, IPA_REF_ADDR, x);
+ ipa_record_reference (d->cfun_node, cvar, IPA_REF_ADDR, x);
/* Record this ssa_name for possible use later in the basic block. */
access_vars[index] = addr;
struct lower_emutls_data d;
bool any_edge_inserts = false;
- push_cfun (DECL_STRUCT_FUNCTION (node->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
d.cfun_node = node;
d.builtin_decl = builtin_decl_explicit (BUILT_IN_EMUTLS_GET_ADDRESS);
tree cdecl;
struct varpool_node *cvar;
- cdecl = new_emutls_decl (var->symbol.decl,
- var->symbol.alias && var->symbol.analyzed
- ? varpool_alias_target (var)->symbol.decl : NULL);
+ cdecl = new_emutls_decl (var->decl,
+ var->alias && var->analyzed
+ ? varpool_alias_target (var)->decl : NULL);
cvar = varpool_get_node (cdecl);
control_vars.quick_push (cvar);
- if (!var->symbol.alias)
+ if (!var->alias)
{
/* Make sure the COMMON block control variable gets initialized.
Note that there's no point in doing this for aliases; we only
need to do this once for the main variable. */
- emutls_common_1 (var->symbol.decl, cdecl, (tree *)data);
+ emutls_common_1 (var->decl, cdecl, (tree *)data);
}
- if (var->symbol.alias && !var->symbol.analyzed)
- cvar->symbol.alias = true;
+ if (var->alias && !var->analyzed)
+ cvar->alias = true;
/* Indicate that the value of the TLS variable may be found elsewhere,
preventing the variable from re-appearing in the GIMPLE. We cheat
and use the control variable here (rather than a full call_expr),
which is special-cased inside the DWARF2 output routines. */
- SET_DECL_VALUE_EXPR (var->symbol.decl, cdecl);
- DECL_HAS_VALUE_EXPR_P (var->symbol.decl) = 1;
+ SET_DECL_VALUE_EXPR (var->decl, cdecl);
+ DECL_HAS_VALUE_EXPR_P (var->decl) = 1;
return false;
}
/* Examine all global variables for TLS variables. */
FOR_EACH_VARIABLE (var)
- if (DECL_THREAD_LOCAL_P (var->symbol.decl))
+ if (DECL_THREAD_LOCAL_P (var->decl))
{
- gcc_checking_assert (TREE_STATIC (var->symbol.decl)
- || DECL_EXTERNAL (var->symbol.decl));
+ gcc_checking_assert (TREE_STATIC (var->decl)
+ || DECL_EXTERNAL (var->decl));
varpool_node_set_add (tls_vars, var);
- if (var->symbol.alias && var->symbol.definition)
+ if (var->alias && var->definition)
varpool_node_set_add (tls_vars, varpool_variable_node (var, NULL));
}
{
var = tls_vars->nodes[i];
- if (var->symbol.alias && !var->symbol.analyzed)
+ if (var->alias && !var->analyzed)
any_aliases = true;
- else if (!var->symbol.alias)
+ else if (!var->alias)
varpool_for_node_and_aliases (var, create_emultls_var, &ctor_body, true);
}
/* We could also just rescale the frequency, but
doing so would introduce roundoff errors and make
verifier unhappy. */
- new_freq = compute_call_stmt_bb_frequency (id->dst_node->symbol.decl,
+ new_freq = compute_call_stmt_bb_frequency (id->dst_node->decl,
copy_basic_block);
/* Speculative calls consist of two edges - direct and indirect.
(old_edge->frequency + indirect->frequency)),
CGRAPH_FREQ_MAX);
}
- ipa_clone_ref (ref, (symtab_node)id->dst_node, stmt);
+ ipa_clone_ref (ref, id->dst_node, stmt);
}
else
{
if ((!edge
|| (edge->indirect_inlining_edge
&& id->transform_call_graph_edges == CB_CGE_MOVE_CLONES))
- && id->dst_node->symbol.definition
+ && id->dst_node->definition
&& (fn = gimple_call_fndecl (stmt)) != NULL)
{
struct cgraph_node *dest = cgraph_get_node (fn);
producing dead clone (for further cloning). In all
other cases we hit a bug (incorrect node sharing is the
most common reason for missing edges). */
- gcc_assert (!dest->symbol.definition
- || dest->symbol.address_taken
- || !id->src_node->symbol.definition
- || !id->dst_node->symbol.definition);
+ gcc_assert (!dest->definition
+ || dest->address_taken
+ || !id->src_node->definition
+ || !id->dst_node->definition);
if (id->transform_call_graph_edges == CB_CGE_MOVE_CLONES)
cgraph_create_edge_including_clones
(id->dst_node, dest, orig_stmt, stmt, bb->count,
- compute_call_stmt_bb_frequency (id->dst_node->symbol.decl,
+ compute_call_stmt_bb_frequency (id->dst_node->decl,
copy_basic_block),
CIF_ORIGINALLY_INDIRECT_CALL);
else
cgraph_create_edge (id->dst_node, dest, stmt,
bb->count,
compute_call_stmt_bb_frequency
- (id->dst_node->symbol.decl,
+ (id->dst_node->decl,
copy_basic_block))->inline_failed
= CIF_ORIGINALLY_INDIRECT_CALL;
if (dump_file)
/* Do not special case builtins where we see the body.
This just confuse inliner. */
- if (!decl || !(node = cgraph_get_node (decl)) || node->symbol.definition)
+ if (!decl || !(node = cgraph_get_node (decl)) || node->definition)
;
/* For buitins that are likely expanded to nothing or
inlined do not account operand costs. */
If we cannot, then there is no hope of inlining the function. */
if (cg_edge->indirect_unknown_callee)
goto egress;
- fn = cg_edge->callee->symbol.decl;
+ fn = cg_edge->callee->decl;
gcc_checking_assert (fn);
/* If FN is a declaration of a function in a nested scope that was
}
goto egress;
}
- fn = cg_edge->callee->symbol.decl;
+ fn = cg_edge->callee->decl;
cgraph_get_body (cg_edge->callee);
#ifdef ENABLE_CHECKING
- if (cg_edge->callee->symbol.decl != id->dst_node->symbol.decl)
+ if (cg_edge->callee->decl != id->dst_node->decl)
verify_cgraph_node (cg_edge->callee);
#endif
id->eh_lp_nr = lookup_stmt_eh_lp (stmt);
/* Update the callers EH personality. */
- if (DECL_FUNCTION_PERSONALITY (cg_edge->callee->symbol.decl))
- DECL_FUNCTION_PERSONALITY (cg_edge->caller->symbol.decl)
- = DECL_FUNCTION_PERSONALITY (cg_edge->callee->symbol.decl);
+ if (DECL_FUNCTION_PERSONALITY (cg_edge->callee->decl))
+ DECL_FUNCTION_PERSONALITY (cg_edge->caller->decl)
+ = DECL_FUNCTION_PERSONALITY (cg_edge->callee->decl);
/* Split the block holding the GIMPLE_CALL. */
e = split_block (bb, stmt);
variables in the function when the blocks get blown away as soon as we
remove the cgraph node. */
if (gimple_block (stmt))
- (*debug_hooks->outlining_inline_function) (cg_edge->callee->symbol.decl);
+ (*debug_hooks->outlining_inline_function) (cg_edge->callee->decl);
/* Update callgraph if needed. */
cgraph_remove_node (cg_edge->callee);
memset (&id, 0, sizeof (id));
id.src_node = id.dst_node = cgraph_get_node (fn);
- gcc_assert (id.dst_node->symbol.definition);
+ gcc_assert (id.dst_node->definition);
id.dst_fn = fn;
/* Or any functions that aren't finished yet. */
if (current_function_decl)
struct cgraph_edge *e;
struct cgraph_node *node;
- ipa_remove_stmt_references ((symtab_node)id->dst_node, gsi_stmt (bsi));
+ ipa_remove_stmt_references (id->dst_node, gsi_stmt (bsi));
if (gimple_code (gsi_stmt (bsi)) == GIMPLE_CALL
&&(e = cgraph_edge (id->dst_node, gsi_stmt (bsi))) != NULL)
&& id->dst_node->clones)
for (node = id->dst_node->clones; node != id->dst_node;)
{
- ipa_remove_stmt_references ((symtab_node)node, gsi_stmt (bsi));
+ ipa_remove_stmt_references (node, gsi_stmt (bsi));
if (gimple_code (gsi_stmt (bsi)) == GIMPLE_CALL
&& (e = cgraph_edge (node, gsi_stmt (bsi))) != NULL)
{
pointer_set_destroy (id.statements_to_fold);
fold_cond_expr_cond ();
delete_unreachable_blocks_update_callgraph (&id);
- if (id.dst_node->symbol.definition)
+ if (id.dst_node->definition)
cgraph_rebuild_references ();
update_ssa (TODO_update_ssa);
for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested)
{
- for (arg = DECL_ARGUMENTS (cgn->symbol.decl); arg; arg = DECL_CHAIN (arg))
+ for (arg = DECL_ARGUMENTS (cgn->decl); arg; arg = DECL_CHAIN (arg))
if (variably_modified_type_p (TREE_TYPE (arg), orig_fndecl))
return true;
- if (check_for_nested_with_variably_modified (cgn->symbol.decl,
+ if (check_for_nested_with_variably_modified (cgn->decl,
orig_fndecl))
return true;
}
info->var_map = pointer_map_create ();
info->mem_refs = pointer_set_create ();
info->suppress_expansion = BITMAP_ALLOC (&nesting_info_bitmap_obstack);
- info->context = cgn->symbol.decl;
+ info->context = cgn->decl;
for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested)
{
gimplify_all_functions (struct cgraph_node *root)
{
struct cgraph_node *iter;
- if (!gimple_body (root->symbol.decl))
- gimplify_function_tree (root->symbol.decl);
+ if (!gimple_body (root->decl))
+ gimplify_function_tree (root->decl);
for (iter = root->nested; iter; iter = iter->next_nested)
gimplify_all_functions (iter);
}
fprintf (dump_file, ", decl_uid=%d", DECL_UID (fdecl));
if (node)
{
- fprintf (dump_file, ", symbol_order=%d)%s\n\n", node->symbol.order,
+ fprintf (dump_file, ", symbol_order=%d)%s\n\n", node->order,
node->frequency == NODE_FREQUENCY_HOT
? " (hot)"
: node->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED
FOR_EACH_DEFINED_FUNCTION (node)
{
- if (!gimple_has_body_p (node->symbol.decl))
+ if (!gimple_has_body_p (node->decl))
continue;
/* Don't profile functions produced for builtin stuff. */
- if (DECL_SOURCE_LOCATION (node->symbol.decl) == BUILTINS_LOCATION)
+ if (DECL_SOURCE_LOCATION (node->decl) == BUILTINS_LOCATION)
continue;
- push_cfun (DECL_STRUCT_FUNCTION (node->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
/* Local pure-const may imply need to fixup the cfg. */
if (execute_fixup_cfg () & TODO_cleanup_cfg)
/* Drop pure/const flags from instrumented functions. */
FOR_EACH_DEFINED_FUNCTION (node)
{
- if (!gimple_has_body_p (node->symbol.decl)
+ if (!gimple_has_body_p (node->decl)
|| !(!node->clone_of
- || node->symbol.decl != node->clone_of->symbol.decl))
+ || node->decl != node->clone_of->decl))
continue;
/* Don't profile functions produced for builtin stuff. */
- if (DECL_SOURCE_LOCATION (node->symbol.decl) == BUILTINS_LOCATION)
+ if (DECL_SOURCE_LOCATION (node->decl) == BUILTINS_LOCATION)
continue;
cgraph_set_const_flag (node, false, false);
{
basic_block bb;
- if (!gimple_has_body_p (node->symbol.decl)
+ if (!gimple_has_body_p (node->decl)
|| !(!node->clone_of
- || node->symbol.decl != node->clone_of->symbol.decl))
+ || node->decl != node->clone_of->decl))
continue;
/* Don't profile functions produced for builtin stuff. */
- if (DECL_SOURCE_LOCATION (node->symbol.decl) == BUILTINS_LOCATION)
+ if (DECL_SOURCE_LOCATION (node->decl) == BUILTINS_LOCATION)
continue;
- push_cfun (DECL_STRUCT_FUNCTION (node->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
FOR_EACH_BB (bb)
{
for (cs = node->callers; cs; cs = cs->next_caller)
{
- push_cfun (DECL_STRUCT_FUNCTION (cs->caller->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (cs->caller->decl));
if (dump_file)
fprintf (dump_file, "Adjusting call %s/%i -> %s/%i\n",
xstrdup (cgraph_node_name (cs->caller)),
- cs->caller->symbol.order,
+ cs->caller->order,
xstrdup (cgraph_node_name (cs->callee)),
- cs->callee->symbol.order);
+ cs->callee->order);
ipa_modify_call_arguments (cs, cs->call_stmt, *adjustments);
for (cs = node->callers; cs; cs = cs->next_caller)
if (bitmap_set_bit (recomputed_callers, cs->caller->uid)
- && gimple_in_ssa_p (DECL_STRUCT_FUNCTION (cs->caller->symbol.decl)))
+ && gimple_in_ssa_p (DECL_STRUCT_FUNCTION (cs->caller->decl)))
compute_inline_parameters (cs->caller, true);
BITMAP_FREE (recomputed_callers);
{
if (dump_file)
fprintf (dump_file, "Adjusting recursive call");
- gimple_call_set_fndecl (stmt, node->symbol.decl);
+ gimple_call_set_fndecl (stmt, node->decl);
ipa_modify_call_arguments (NULL, stmt, adjustments);
}
}
NULL, false, NULL, NULL, "isra");
redirect_callers.release ();
- push_cfun (DECL_STRUCT_FUNCTION (new_node->symbol.decl));
+ push_cfun (DECL_STRUCT_FUNCTION (new_node->decl));
ipa_modify_formal_parameters (current_function_decl, adjustments, "ISRA");
cfg_changed = ipa_sra_modify_function_body (adjustments);
sra_ipa_reset_debug_stmts (adjustments);
- convert_callers (new_node, node->symbol.decl, adjustments);
+ convert_callers (new_node, node->decl, adjustments);
cgraph_make_node_local (new_node);
return cfg_changed;
}
return false;
}
- if (!tree_versionable_function_p (node->symbol.decl))
+ if (!tree_versionable_function_p (node->decl))
{
if (dump_file)
fprintf (dump_file, "Function is not versionable.\n");
return false;
}
- if ((DECL_COMDAT (node->symbol.decl) || DECL_EXTERNAL (node->symbol.decl))
+ if ((DECL_COMDAT (node->decl) || DECL_EXTERNAL (node->decl))
&& inline_summary (node)->size >= MAX_INLINE_INSNS_AUTO)
{
if (dump_file)
return false;
}
- if (TYPE_ATTRIBUTES (TREE_TYPE (node->symbol.decl)))
+ if (TYPE_ATTRIBUTES (TREE_TYPE (node->decl)))
return false;
return true;
&& (TREE_STATIC (t) || DECL_EXTERNAL (t)))
{
struct varpool_node *node = varpool_get_node (t);
- if (node && node->symbol.alias && node->symbol.analyzed)
+ if (node && node->alias && node->analyzed)
{
node = varpool_variable_node (node, NULL);
- t = node->symbol.decl;
+ t = node->decl;
}
}
/* If this is a global variable with an initializer and we are in
IPA mode generate constraints for it. */
if (DECL_INITIAL (decl)
- && vnode->symbol.definition)
+ && vnode->definition)
{
vec<ce_s> rhsc = vNULL;
struct constraint_expr lhs, *rhsp;
static bool
associate_varinfo_to_alias (struct cgraph_node *node, void *data)
{
- if ((node->symbol.alias || node->thunk.thunk_p)
- && node->symbol.analyzed)
- insert_vi_for_tree (node->symbol.decl, (varinfo_t)data);
+ if ((node->alias || node->thunk.thunk_p)
+ && node->analyzed)
+ insert_vi_for_tree (node->decl, (varinfo_t)data);
return false;
}
gcc_assert (!node->clone_of);
- vi = create_function_info_for (node->symbol.decl,
- alias_get_name (node->symbol.decl));
+ vi = create_function_info_for (node->decl,
+ alias_get_name (node->decl));
cgraph_for_node_and_aliases (node, associate_varinfo_to_alias, vi, true);
}
/* Create constraints for global variables and their initializers. */
FOR_EACH_VARIABLE (var)
{
- if (var->symbol.alias && var->symbol.analyzed)
+ if (var->alias && var->analyzed)
continue;
- get_vi_for_tree (var->symbol.decl);
+ get_vi_for_tree (var->decl);
}
if (dump_file)
{
fprintf (dump_file,
"Generating constraints for %s", cgraph_node_name (node));
- if (DECL_ASSEMBLER_NAME_SET_P (node->symbol.decl))
+ if (DECL_ASSEMBLER_NAME_SET_P (node->decl))
fprintf (dump_file, " (%s)",
IDENTIFIER_POINTER
- (DECL_ASSEMBLER_NAME (node->symbol.decl)));
+ (DECL_ASSEMBLER_NAME (node->decl)));
fprintf (dump_file, "\n");
}
- func = DECL_STRUCT_FUNCTION (node->symbol.decl);
+ func = DECL_STRUCT_FUNCTION (node->decl);
push_cfun (func);
/* For externally visible or attribute used annotated functions use
local constraints for their arguments.
For local functions we see all callers and thus do not need initial
constraints for parameters. */
- if (node->symbol.used_from_other_partition
- || node->symbol.externally_visible
- || node->symbol.force_output)
+ if (node->used_from_other_partition
+ || node->externally_visible
+ || node->force_output)
{
intra_create_variable_infos ();
/* We also need to make function return values escape. Nothing
escapes by returning from main though. */
- if (!MAIN_NAME_P (DECL_NAME (node->symbol.decl)))
+ if (!MAIN_NAME_P (DECL_NAME (node->decl)))
{
varinfo_t fi, rvi;
- fi = lookup_vi_for_tree (node->symbol.decl);
+ fi = lookup_vi_for_tree (node->decl);
rvi = first_vi_for_offset (fi, fi_result);
if (rvi && rvi->offset == fi_result)
{
if (!cgraph_function_with_gimple_body_p (node) || node->clone_of)
continue;
- fn = DECL_STRUCT_FUNCTION (node->symbol.decl);
+ fn = DECL_STRUCT_FUNCTION (node->decl);
/* Compute the points-to sets for pointer SSA_NAMEs. */
FOR_EACH_VEC_ELT (*fn->gimple_df->ssa_names, i, ptr)
}
/* Compute the call-use and call-clobber sets for all direct calls. */
- fi = lookup_vi_for_tree (node->symbol.decl);
+ fi = lookup_vi_for_tree (node->decl);
gcc_assert (fi->is_fn_info);
clobbers
= find_what_var_points_to (first_vi_for_offset (fi, fi_clobbers));
/* Increase the alignment of all global arrays for vectorization. */
FOR_EACH_DEFINED_VARIABLE (vnode)
{
- tree vectype, decl = vnode->symbol.decl;
+ tree vectype, decl = vnode->decl;
tree t;
unsigned int alignment;
{
struct cgraph_node *node;
if (!(node = cgraph_get_node (decl))
- || (!node->symbol.definition && !node->clones))
+ || (!node->definition && !node->clones))
{
if (node)
cgraph_release_function_body (node);
unsigned ix;
tree t;
- find_decls_types (n->symbol.decl, fld);
+ find_decls_types (n->decl, fld);
- if (!gimple_has_body_p (n->symbol.decl))
+ if (!gimple_has_body_p (n->decl))
return;
gcc_assert (current_function_decl == NULL_TREE && cfun == NULL);
- fn = DECL_STRUCT_FUNCTION (n->symbol.decl);
+ fn = DECL_STRUCT_FUNCTION (n->decl);
/* Traverse locals. */
FOR_EACH_LOCAL_DECL (fn, ix, t)
static void
find_decls_types_in_var (struct varpool_node *v, struct free_lang_data_d *fld)
{
- find_decls_types (v->symbol.decl, fld);
+ find_decls_types (v->decl, fld);
}
/* If T needs an assembler name, have one created for it. */
" with nodes %s/%i %s/%i\n",
n->profile_id,
cgraph_node_name (n),
- n->symbol.order,
+ n->order,
symtab_node_name (*(symtab_node*)val),
- (*(symtab_node *)val)->symbol.order);
+ (*(symtab_node *)val)->order);
n->profile_id = (n->profile_id + 1) & 0x7fffffff;
}
}
"Node %s/%i has no profile-id"
" (profile feedback missing?)\n",
cgraph_node_name (n),
- n->symbol.order);
+ n->order);
continue;
}
else if ((val = pointer_map_contains (cgraph_node_map,
"Node %s/%i has IP profile-id %i conflict. "
"Giving up.\n",
cgraph_node_name (n),
- n->symbol.order,
+ n->order,
n->profile_id);
*val = NULL;
continue;
check_ic_target (gimple call_stmt, struct cgraph_node *target)
{
location_t locus;
- if (gimple_check_call_matching_types (call_stmt, target->symbol.decl, true))
+ if (gimple_check_call_matching_types (call_stmt, target->decl, true))
return true;
locus = gimple_location (call_stmt);
load_stmt = gimple_build_assign (tmp0, tmp);
gsi_insert_before (&gsi, load_stmt, GSI_SAME_STMT);
- tmp = fold_convert (optype, build_addr (direct_call->symbol.decl,
+ tmp = fold_convert (optype, build_addr (direct_call->decl,
current_function_decl));
load_stmt = gimple_build_assign (tmp1, tmp);
gsi_insert_before (&gsi, load_stmt, GSI_SAME_STMT);
gimple_set_vuse (icall_stmt, NULL_TREE);
update_stmt (icall_stmt);
dcall_stmt = gimple_copy (icall_stmt);
- gimple_call_set_fndecl (dcall_stmt, direct_call->symbol.decl);
- dflags = flags_from_decl_or_type (direct_call->symbol.decl);
+ gimple_call_set_fndecl (dcall_stmt, direct_call->decl);
+ dflags = flags_from_decl_or_type (direct_call->decl);
if ((dflags & ECF_NORETURN) != 0)
gimple_call_set_lhs (dcall_stmt, NULL_TREE);
gsi_insert_before (&gsi, dcall_stmt, GSI_SAME_STMT);
fprintf (dump_file, "Indirect call -> direct call ");
print_generic_expr (dump_file, gimple_call_fn (stmt), TDF_SLIM);
fprintf (dump_file, "=> ");
- print_generic_expr (dump_file, direct_call->symbol.decl, TDF_SLIM);
+ print_generic_expr (dump_file, direct_call->decl, TDF_SLIM);
fprintf (dump_file, " transformation skipped because of type mismatch");
print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
}
fprintf (dump_file, "Indirect call -> direct call ");
print_generic_expr (dump_file, gimple_call_fn (stmt), TDF_SLIM);
fprintf (dump_file, "=> ");
- print_generic_expr (dump_file, direct_call->symbol.decl, TDF_SLIM);
+ print_generic_expr (dump_file, direct_call->decl, TDF_SLIM);
fprintf (dump_file, " transformation on insn postponned to ipa-profile");
print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
fprintf (dump_file, "hist->count "HOST_WIDEST_INT_PRINT_DEC
definition. */
struct cgraph_node *node = cgraph_get_create_node (decl);
if (!DECL_EXTERNAL (decl)
- && !node->symbol.definition)
+ && !node->definition)
cgraph_mark_force_output_node (node);
}
else if (TREE_CODE (decl) == VAR_DECL)
struct varpool_node *node = varpool_node_for_decl (decl);
/* C++ frontend use mark_decl_references to force COMDAT variables
to be output that might appear dead otherwise. */
- node->symbol.force_output = true;
+ node->force_output = true;
}
/* else do nothing - we can get various sorts of CST nodes here,
which do not need to be marked. */
{
symtab_node node = symtab_node_for_asm (target);
if (node)
- return node->symbol.decl;
+ return node->decl;
return NULL_TREE;
}
/* Allow aliases to aliases. */
if (TREE_CODE (decl) == FUNCTION_DECL)
- cgraph_get_create_node (decl)->symbol.alias = true;
+ cgraph_get_create_node (decl)->alias = true;
else
- varpool_node_for_decl (decl)->symbol.alias = true;
+ varpool_node_for_decl (decl)->alias = true;
/* If the target has already been emitted, we don't have to queue the
alias. This saves a tad of memory. */
TM_GETTMCLONE. If neither of these are true, we didn't generate
a clone, and we didn't call it indirectly... no sense keeping it
in the clone table. */
- if (!dst_n || !dst_n->symbol.definition)
+ if (!dst_n || !dst_n->definition)
continue;
/* This covers the case where we have optimized the original
function away, and only access the transactional clone. */
- if (!src_n || !src_n->symbol.definition)
+ if (!src_n || !src_n->definition)
continue;
if (!switched)
&& (TREE_STATIC (exp) || DECL_EXTERNAL (exp)))
{
struct varpool_node *vnode = varpool_get_node (exp);
- if (vnode && resolution_local_p (vnode->symbol.resolution))
+ if (vnode && resolution_local_p (vnode->resolution))
resolved_locally = true;
if (vnode
- && resolution_to_local_definition_p (vnode->symbol.resolution))
+ && resolution_to_local_definition_p (vnode->resolution))
resolved_to_local_def = true;
}
else if (TREE_CODE (exp) == FUNCTION_DECL && TREE_PUBLIC (exp))
{
struct cgraph_node *node = cgraph_get_node (exp);
if (node
- && resolution_local_p (node->symbol.resolution))
+ && resolution_local_p (node->resolution))
resolved_locally = true;
if (node
- && resolution_to_local_definition_p (node->symbol.resolution))
+ && resolution_to_local_definition_p (node->resolution))
resolved_to_local_def = true;
}
{
struct varpool_node *vnode = varpool_get_node (decl);
if (vnode
- && vnode->symbol.resolution != LDPR_UNKNOWN)
- return resolution_to_local_definition_p (vnode->symbol.resolution);
+ && vnode->resolution != LDPR_UNKNOWN)
+ return resolution_to_local_definition_p (vnode->resolution);
}
else if (TREE_CODE (decl) == FUNCTION_DECL)
{
struct cgraph_node *node = cgraph_get_node (decl);
if (node
- && node->symbol.resolution != LDPR_UNKNOWN)
- return resolution_to_local_definition_p (node->symbol.resolution);
+ && node->resolution != LDPR_UNKNOWN)
+ return resolution_to_local_definition_p (node->resolution);
}
/* Otherwise we have to assume the worst for DECL_WEAK (hidden weaks
binds locally but still can be overwritten), DECL_COMMON (can be merged
varpool_create_empty_node (void)
{
struct varpool_node *node = ggc_alloc_cleared_varpool_node ();
- node->symbol.type = SYMTAB_VARIABLE;
+ node->type = SYMTAB_VARIABLE;
return node;
}
return node;
node = varpool_create_empty_node ();
- node->symbol.decl = decl;
- symtab_register_node ((symtab_node)node);
+ node->decl = decl;
+ symtab_register_node (node);
return node;
}
{
tree init;
varpool_call_node_removal_hooks (node);
- symtab_unregister_node ((symtab_node)node);
+ symtab_unregister_node (node);
/* Because we remove references from external functions before final compilation,
we may end up removing useful constructors.
FIXME: We probably want to trace boundaries better. */
- if ((init = ctor_for_folding (node->symbol.decl)) == error_mark_node)
+ if ((init = ctor_for_folding (node->decl)) == error_mark_node)
varpool_remove_initializer (node);
else
- DECL_INITIAL (node->symbol.decl) = init;
+ DECL_INITIAL (node->decl) = init;
ggc_free (node);
}
void
varpool_remove_initializer (struct varpool_node *node)
{
- if (DECL_INITIAL (node->symbol.decl)
- && !DECL_IN_CONSTANT_POOL (node->symbol.decl)
+ if (DECL_INITIAL (node->decl)
+ && !DECL_IN_CONSTANT_POOL (node->decl)
/* Keep vtables for BINFO folding. */
- && !DECL_VIRTUAL_P (node->symbol.decl)
+ && !DECL_VIRTUAL_P (node->decl)
/* FIXME: http://gcc.gnu.org/PR55395 */
&& debug_info_level == DINFO_LEVEL_NONE
/* When doing declaration merging we have duplicate
the boides, or we will end up remiving
wrong one. */
&& cgraph_state != CGRAPH_LTO_STREAMING)
- DECL_INITIAL (node->symbol.decl) = error_mark_node;
+ DECL_INITIAL (node->decl) = error_mark_node;
}
/* Dump given cgraph node. */
void
dump_varpool_node (FILE *f, struct varpool_node *node)
{
- dump_symtab_base (f, (symtab_node)node);
+ dump_symtab_base (f, node);
fprintf (f, " Availability: %s\n",
cgraph_function_flags_ready
? cgraph_availability_names[cgraph_variable_initializer_availability (node)]
: "not-ready");
fprintf (f, " Varpool flags:");
- if (DECL_INITIAL (node->symbol.decl))
+ if (DECL_INITIAL (node->decl))
fprintf (f, " initialized");
if (node->output)
fprintf (f, " output");
- if (TREE_READONLY (node->symbol.decl))
+ if (TREE_READONLY (node->decl))
fprintf (f, " read-only");
- if (ctor_for_folding (node->symbol.decl) != error_mark_node)
+ if (ctor_for_folding (node->decl) != error_mark_node)
fprintf (f, " const-value-known");
fprintf (f, "\n");
}
if (node)
{
real_node = varpool_variable_node (node);
- real_decl = real_node->symbol.decl;
+ real_decl = real_node->decl;
}
else
real_decl = decl;
if (lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)))
{
node = varpool_alias_target (node);
- decl = node->symbol.decl;
+ decl = node->decl;
}
}
node = varpool_node_for_decl (decl);
varpool_call_variable_insertion_hooks (node);
if (varpool_externally_visible_p (node))
- node->symbol.externally_visible = true;
+ node->externally_visible = true;
}
/* Return variable availability. See cgraph.h for description of individual
cgraph_variable_initializer_availability (struct varpool_node *node)
{
gcc_assert (cgraph_function_flags_ready);
- if (!node->symbol.definition)
+ if (!node->definition)
return AVAIL_NOT_AVAILABLE;
- if (!TREE_PUBLIC (node->symbol.decl))
+ if (!TREE_PUBLIC (node->decl))
return AVAIL_AVAILABLE;
- if (DECL_IN_CONSTANT_POOL (node->symbol.decl)
- || DECL_VIRTUAL_P (node->symbol.decl))
+ if (DECL_IN_CONSTANT_POOL (node->decl)
+ || DECL_VIRTUAL_P (node->decl))
return AVAIL_AVAILABLE;
- if (node->symbol.alias && node->symbol.weakref)
+ if (node->alias && node->weakref)
{
enum availability avail;
/* If the variable can be overwritten, return OVERWRITABLE. Takes
care of at least one notable extension - the COMDAT variables
used to share template instantiations in C++. */
- if (decl_replaceable_p (node->symbol.decl)
- || DECL_EXTERNAL (node->symbol.decl))
+ if (decl_replaceable_p (node->decl)
+ || DECL_EXTERNAL (node->decl))
return AVAIL_OVERWRITABLE;
return AVAIL_AVAILABLE;
}
void
varpool_analyze_node (struct varpool_node *node)
{
- tree decl = node->symbol.decl;
+ tree decl = node->decl;
/* When reading back varpool at LTO time, we re-construct the queue in order
to have "needed" list right by inserting all needed nodes into varpool.
We however don't want to re-analyze already analyzed nodes. */
- if (!node->symbol.analyzed)
+ if (!node->analyzed)
{
gcc_assert (!in_lto_p || cgraph_function_flags_ready);
/* Compute the alignment early so function body expanders are
already informed about increased alignment. */
align_variable (decl, 0);
}
- if (node->symbol.alias)
+ if (node->alias)
symtab_resolve_alias
- ((symtab_node) node, (symtab_node) varpool_get_node (node->symbol.alias_target));
+ (node, varpool_get_node (node->alias_target));
else if (DECL_INITIAL (decl))
- record_references_in_initializer (decl, node->symbol.analyzed);
- node->symbol.analyzed = true;
+ record_references_in_initializer (decl, node->analyzed);
+ node->analyzed = true;
}
/* Assemble thunks and aliases associated to NODE. */
{
int i;
struct ipa_ref *ref;
- for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list, i, ref); i++)
+ for (i = 0; ipa_ref_list_referring_iterate (&node->ref_list, i, ref); i++)
if (ref->use == IPA_REF_ALIAS)
{
struct varpool_node *alias = ipa_ref_referring_varpool_node (ref);
- do_assemble_alias (alias->symbol.decl,
- DECL_ASSEMBLER_NAME (node->symbol.decl));
+ do_assemble_alias (alias->decl,
+ DECL_ASSEMBLER_NAME (node->decl));
assemble_aliases (alias);
}
}
bool
varpool_assemble_decl (struct varpool_node *node)
{
- tree decl = node->symbol.decl;
+ tree decl = node->decl;
/* Aliases are outout when their target is produced or by
output_weakrefs. */
- if (node->symbol.alias)
+ if (node->alias)
return false;
/* Constant pool is output from RTL land when the reference
&& TREE_CODE (decl) == VAR_DECL
&& !DECL_HAS_VALUE_EXPR_P (decl));
- if (!node->symbol.in_other_partition
+ if (!node->in_other_partition
&& !DECL_EXTERNAL (decl))
{
assemble_variable (decl, 0, 1, 0);
gcc_assert (TREE_ASM_WRITTEN (decl));
- node->symbol.definition = true;
+ node->definition = true;
assemble_aliases (node);
return true;
}
static void
enqueue_node (struct varpool_node *node, struct varpool_node **first)
{
- if (node->symbol.aux)
+ if (node->aux)
return;
gcc_checking_assert (*first);
- node->symbol.aux = *first;
+ node->aux = *first;
*first = node;
}
fprintf (cgraph_dump_file, "Trivially needed variables:");
FOR_EACH_DEFINED_VARIABLE (node)
{
- if (node->symbol.analyzed
+ if (node->analyzed
&& (!varpool_can_remove_if_no_refs (node)
/* We just expanded all function bodies. See if any of
them needed the variable. */
- || DECL_RTL_SET_P (node->symbol.decl)))
+ || DECL_RTL_SET_P (node->decl)))
{
enqueue_node (node, &first);
if (cgraph_dump_file)
while (first != (struct varpool_node *)(void *)1)
{
node = first;
- first = (struct varpool_node *)first->symbol.aux;
+ first = (struct varpool_node *)first->aux;
- if (node->symbol.same_comdat_group)
+ if (node->same_comdat_group)
{
symtab_node next;
- for (next = node->symbol.same_comdat_group;
- next != (symtab_node)node;
- next = next->symbol.same_comdat_group)
+ for (next = node->same_comdat_group;
+ next != node;
+ next = next->same_comdat_group)
{
varpool_node *vnext = dyn_cast <varpool_node> (next);
- if (vnext && vnext->symbol.analyzed)
+ if (vnext && vnext->analyzed)
enqueue_node (vnext, &first);
}
}
- for (i = 0; ipa_ref_list_reference_iterate (&node->symbol.ref_list, i, ref); i++)
+ for (i = 0; ipa_ref_list_reference_iterate (&node->ref_list, i, ref); i++)
{
varpool_node *vnode = dyn_cast <varpool_node> (ref->referred);
if (vnode
- && (!DECL_EXTERNAL (ref->referred->symbol.decl)
- || vnode->symbol.alias)
- && vnode->symbol.analyzed)
+ && (!DECL_EXTERNAL (ref->referred->decl)
+ || vnode->alias)
+ && vnode->analyzed)
enqueue_node (vnode, &first);
}
}
for (node = varpool_first_defined_variable (); node; node = next)
{
next = varpool_next_defined_variable (node);
- if (!node->symbol.aux)
+ if (!node->aux)
{
if (cgraph_dump_file)
fprintf (cgraph_dump_file, " %s", varpool_node_asm_name (node));
void
varpool_finalize_named_section_flags (struct varpool_node *node)
{
- if (!TREE_ASM_WRITTEN (node->symbol.decl)
- && !node->symbol.alias
- && !node->symbol.in_other_partition
- && !DECL_EXTERNAL (node->symbol.decl)
- && TREE_CODE (node->symbol.decl) == VAR_DECL
- && !DECL_HAS_VALUE_EXPR_P (node->symbol.decl)
- && DECL_SECTION_NAME (node->symbol.decl))
- get_variable_section (node->symbol.decl, false);
+ if (!TREE_ASM_WRITTEN (node->decl)
+ && !node->alias
+ && !node->in_other_partition
+ && !DECL_EXTERNAL (node->decl)
+ && TREE_CODE (node->decl) == VAR_DECL
+ && !DECL_HAS_VALUE_EXPR_P (node->decl)
+ && DECL_SECTION_NAME (node->decl))
+ get_variable_section (node->decl, false);
}
/* Output all variables enqueued to be assembled. */
new_node = varpool_node_for_decl (new_decl);
varpool_finalize_decl (new_decl);
- return new_node->symbol.decl;
+ return new_node->decl;
}
/* Attempt to mark ALIAS as an alias to DECL. Return TRUE if successful.
gcc_assert (TREE_CODE (decl) == VAR_DECL);
gcc_assert (TREE_CODE (alias) == VAR_DECL);
alias_node = varpool_node_for_decl (alias);
- alias_node->symbol.alias = true;
- alias_node->symbol.definition = true;
- alias_node->symbol.alias_target = decl;
+ alias_node->alias = true;
+ alias_node->definition = true;
+ alias_node->alias_target = decl;
if (lookup_attribute ("weakref", DECL_ATTRIBUTES (alias)) != NULL)
- alias_node->symbol.weakref = true;
+ alias_node->weakref = true;
return alias_node;
}
return NULL;
#endif
alias_node = varpool_create_variable_alias (alias, decl);
- alias_node->symbol.cpp_implicit_alias = true;
+ alias_node->cpp_implicit_alias = true;
/* Extra name alias mechanizm creates aliases really late
via DECL_ASSEMBLER_NAME mechanizm.
This is unfortunate because they are not going through the
standard channels. Ensure they get output. */
if (cpp_implicit_aliases_done)
- symtab_resolve_alias ((symtab_node)alias_node,
- (symtab_node)varpool_node_for_decl (decl));
+ symtab_resolve_alias (alias_node,
+ varpool_node_for_decl (decl));
return alias_node;
}
if (callback (node, data))
return true;
- for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list, i, ref); i++)
+ for (i = 0; ipa_ref_list_referring_iterate (&node->ref_list, i, ref); i++)
if (ref->use == IPA_REF_ALIAS)
{
struct varpool_node *alias = ipa_ref_referring_varpool_node (ref);