GCC Middle and Back End API Reference
|
#include <cgraph.h>
Static Public Member Functions | |
static bool | assembler_names_equal_p (const char *name1, const char *name2) |
static char | symbol_suffix_separator () |
Data Fields | |
int | cgraph_count |
int | cgraph_max_uid |
int | cgraph_max_summary_id |
int | edges_count |
int | edges_max_uid |
int | edges_max_summary_id |
vec< int > | cgraph_released_summary_ids |
vec< int > | edge_released_summary_ids |
symtab_node * | nodes |
asm_node * | asmnodes |
asm_node * | asm_last_node |
int | order |
int | max_unit |
bool | global_info_ready |
enum symtab_state | state |
bool | function_flags_ready |
bool | cpp_implicit_aliases_done |
hash_table< section_name_hasher > * | section_hash |
hash_table< asmname_hasher > * | assembler_name_hash |
hash_map< symtab_node *, symbol_priority_map > * | init_priority_hash |
FILE * | dump_file |
FILE * | ipa_clones_dump_file |
hash_set< const cgraph_node * > | cloned_nodes |
thunk_summary * | m_thunks |
clone_summary * | m_clones |
Private Member Functions | |
cgraph_edge * | create_edge (cgraph_node *caller, cgraph_node *callee, gcall *call_stmt, profile_count count, bool indir_unknown_callee, bool cloning_p) |
void | free_edge (cgraph_edge *e) |
void | insert_to_assembler_name_hash (symtab_node *node, bool with_clones) |
void | unlink_from_assembler_name_hash (symtab_node *node, bool with_clones) |
Static Private Member Functions | |
static hashval_t | decl_assembler_name_hash (const_tree asmname) |
static bool | decl_assembler_name_equal (tree decl, const_tree asmname) |
Friends | |
struct | symtab_node |
struct | cgraph_node |
struct | cgraph_edge |
struct | asmname_hasher |
|
inline |
cgraph_2node_hook_list * symbol_table::add_cgraph_duplication_hook | ( | cgraph_2node_hook | hook, |
void * | data ) |
Register HOOK to be called with DATA on each duplicated node.
References cgraph_2node_hook_list::data, cgraph_2node_hook_list::hook, m_first_cgraph_duplicated_hook, cgraph_2node_hook_list::next, and NULL.
Referenced by do_per_function_toporder(), and function_summary_base< T >::enable_duplication_hook().
cgraph_node_hook_list * symbol_table::add_cgraph_insertion_hook | ( | cgraph_node_hook | hook, |
void * | data ) |
Register HOOK to be called with DATA on each inserted node.
References cgraph_node_hook_list::data, cgraph_node_hook_list::hook, m_first_cgraph_insertion_hook, cgraph_node_hook_list::next, and NULL.
Referenced by do_per_function_toporder(), function_summary_base< T >::enable_insertion_hook(), and ipa_register_cgraph_hooks().
cgraph_node_hook_list * symbol_table::add_cgraph_removal_hook | ( | cgraph_node_hook | hook, |
void * | data ) |
Register HOOK to be called with DATA on each removed node.
References cgraph_node_hook_list::data, cgraph_node_hook_list::hook, m_first_cgraph_removal_hook, cgraph_node_hook_list::next, and NULL.
Referenced by do_per_function_toporder(), function_summary_base< T >::function_summary_base(), ipa_inline(), omp_resolve_declare_variant(), possible_polymorphic_call_targets(), and ipa_icf::sem_item_optimizer::register_hooks().
cgraph_2edge_hook_list * symbol_table::add_edge_duplication_hook | ( | cgraph_2edge_hook | hook, |
void * | data ) |
Register HOOK to be called with DATA on each duplicated edge.
References cgraph_2edge_hook_list::data, cgraph_2edge_hook_list::hook, m_first_edge_duplicated_hook, cgraph_2edge_hook_list::next, and NULL.
Referenced by call_summary_base< T >::enable_duplication_hook().
cgraph_edge_hook_list * symbol_table::add_edge_removal_hook | ( | cgraph_edge_hook | hook, |
void * | data ) |
Register HOOK to be called with DATA on each removed edge.
References cgraph_edge_hook_list::data, cgraph_edge_hook_list::hook, m_first_edge_removal_hook, cgraph_edge_hook_list::next, and NULL.
Referenced by call_summary_base< T >::call_summary_base(), and inline_small_functions().
varpool_node_hook_list * symbol_table::add_varpool_insertion_hook | ( | varpool_node_hook | hook, |
void * | data ) |
Register HOOK to be called with DATA on each inserted node.
References varpool_node_hook_list::data, varpool_node_hook_list::hook, m_first_varpool_insertion_hook, varpool_node_hook_list::next, and NULL.
varpool_node_hook_list * symbol_table::add_varpool_removal_hook | ( | varpool_node_hook | hook, |
void * | data ) |
Register HOOK to be called with DATA on each removed node.
References varpool_node_hook_list::data, varpool_node_hook_list::hook, m_first_varpool_removal_hook, varpool_node_hook_list::next, and NULL.
Referenced by ipa_init(), ipa_reference_read_optimization_summary(), possible_polymorphic_call_targets(), and ipa_icf::sem_item_optimizer::register_hooks().
|
static |
Return true if assembler names NAME1 and NAME2 leads to the same symbol name.
References user_label_prefix.
Referenced by change_decl_assembler_name(), decl_assembler_name_equal(), and symtab_node::verify_base().
|
inline |
References edge_released_summary_ids, and edges_max_summary_id.
|
inline |
References cgraph_max_summary_id, cgraph_released_summary_ids, and cgraph_node::m_summary_id.
void symbol_table::call_cgraph_duplication_hooks | ( | cgraph_node * | node, |
cgraph_node * | node2 ) |
Call all node duplication hooks.
References cgraph_2node_hook_list::data, cgraph_2node_hook_list::hook, m_first_cgraph_duplicated_hook, and cgraph_2node_hook_list::next.
Referenced by cgraph_node::create_clone(), cgraph_node::create_virtual_clone(), and duplicate_thunk_for_node().
void symbol_table::call_cgraph_insertion_hooks | ( | cgraph_node * | node | ) |
Call all node removal hooks.
References cgraph_node_hook_list::data, cgraph_node_hook_list::hook, m_first_cgraph_insertion_hook, and cgraph_node_hook_list::next.
Referenced by cgraph_node::create_version_clone_with_body(), inline_call(), ipa_tm_create_version(), ipa_icf::sem_function::merge(), and process_new_functions().
void symbol_table::call_cgraph_removal_hooks | ( | cgraph_node * | node | ) |
Call all node removal hooks.
References cgraph_node_hook_list::data, cgraph_node_hook_list::hook, m_first_cgraph_removal_hook, and cgraph_node_hook_list::next.
Referenced by inline_call(), ipa_icf::sem_function::merge(), and cgraph_node::remove().
void symbol_table::call_edge_duplication_hooks | ( | cgraph_edge * | cs1, |
cgraph_edge * | cs2 ) |
Call all edge duplication hooks.
References cgraph_2edge_hook_list::data, cgraph_2edge_hook_list::hook, m_first_edge_duplicated_hook, and cgraph_2edge_hook_list::next.
Referenced by cgraph_edge::clone(), duplicate_thunk_for_node(), and cgraph_edge::make_speculative().
void symbol_table::call_edge_removal_hooks | ( | cgraph_edge * | e | ) |
Call all edge removal hooks.
References cgraph_edge_hook_list::data, cgraph_edge_hook_list::hook, m_first_edge_removal_hook, and cgraph_edge_hook_list::next.
Referenced by cgraph_edge::remove(), cgraph_node::remove_callees(), and cgraph_node::remove_callers().
void symbol_table::call_varpool_insertion_hooks | ( | varpool_node * | node | ) |
Call all node insertion hooks.
References varpool_node_hook_list::data, varpool_node_hook_list::hook, m_first_varpool_insertion_hook, and varpool_node_hook_list::next.
Referenced by varpool_node::add().
void symbol_table::call_varpool_removal_hooks | ( | varpool_node * | node | ) |
Call all node removal hooks.
References varpool_node_hook_list::data, varpool_node_hook_list::hook, m_first_varpool_removal_hook, and varpool_node_hook_list::next.
Referenced by varpool_node::remove().
Set the DECL_ASSEMBLER_NAME and update symtab hashtables.
References assembler_names_equal_p(), change_decl_assembler_name(), symtab_node::decl, DECL_ASSEMBLER_NAME, DECL_ASSEMBLER_NAME_SET_P, DECL_EXTERNAL, DECL_RTL_SET_P, symtab_node::definition, gcc_assert, symtab_node::get(), symtab_node::get_alias_target(), i, IDENTIFIER_POINTER, IDENTIFIER_TRANSPARENT_ALIAS, insert_to_assembler_name_hash(), symtab_node::iterate_direct_aliases(), NULL, ipa_ref::referring, SET_DECL_ASSEMBLER_NAME, symtab_node::transparent_alias, TREE_CHAIN, TREE_CODE, TREE_STATIC, TREE_SYMBOL_REFERENCED, ultimate_transparent_alias_target(), unlink_from_assembler_name_hash(), VAR_P, warning(), and symtab_node::weakref.
Referenced by change_decl_assembler_name(), create_dispatcher_calls(), create_target_clone(), expand_simd_clones(), symtab_node::make_decl_local(), optimize_weakref(), and set_user_assembler_name().
|
inline |
References asm_last_node, asmnodes, and NULL.
Referenced by output_in_order().
void symbol_table::compile | ( | void | ) |
Perform simple optimizations based on callgraph.
References symtab_node::alias, symtab_node::alias_target, gcc::pass_manager::all_late_ipa_passes, gcc_debug_hooks::assembly_start, bitmap_obstack_initialize(), bitmap_obstack_release(), symtab_node::check_ifunc_callee_symtab_nodes(), symtab_node::checking_verify_symtab_nodes(), cgraph_node::debug(), debug_hooks, symtab_node::decl, DECL_ASSEMBLER_NAME, DECL_ATTRIBUTES, DECL_STRUCT_FUNCTION, dump(), dump_file, dump_memory_report(), error_found, execute_ipa_pass_list(), expand_all_functions(), EXPANSION, FINISHED, FOR_EACH_DEFINED_FUNCTION, FOR_EACH_SYMBOL, g, symtab_node::get_alias_target(), gcc::context::get_passes(), gimple_has_body_p(), global_info_ready, IDENTIFIER_TRANSPARENT_ALIAS, INCREMENTAL_LINK_LTO, cgraph_node::inlined_to, internal_error(), IPA, ipa_passes(), lookup_attribute(), lto_streamer_hooks_init(), mark_functions_to_output(), NULL, output_in_order(), output_variables(), output_weakrefs(), process_new_functions(), PROP_assumptions_done, seen_error(), switch_to_section(), symtab, text_section, timevar_pop(), timevar_push(), timevar_start(), timevar_stop(), TREE_CHAIN, and symtab_node::verify_symtab_nodes().
Referenced by finalize_compilation_unit().
|
private |
Allocate a cgraph_edge structure and fill it with data according to the parameters of which only CALLEE can be NULL (when creating an indirect call edge). CLONING_P should be set if properties that are copied from an original edge should not be calculated.
References cgraph_node::call_site_hash, cgraph_node::calls_declare_variant_alt, cgraph_add_edge_to_call_site_hash(), cgraph_node::count, count, symtab_node::decl, decl_maybe_in_construction_p(), DECL_STRUCT_FUNCTION, cgraph_node::declare_variant_alt, edges_count, edges_max_uid, gcc_assert, gcc_checking_assert, cgraph_node::get_edge(), ggc_alloc(), is_gimple_call(), LTO_STREAMING, NULL, opt_for_fn, cgraph_edge::speculative, state, stmt_can_throw_external(), symtab, and cgraph_node::thunk.
Referenced by cgraph_node::create_edge(), and cgraph_node::create_indirect_edge().
cgraph_node * symbol_table::create_empty | ( | void | ) |
Allocate new callgraph node and insert it into basic data structures.
References cgraph_count, cgraph_max_uid, and ggc_alloc().
Referenced by cgraph_node::create(), cgraph_node::create_clone(), and input_node().
DEBUG_FUNCTION void symbol_table::debug | ( | void | ) |
References dump().
|
staticprivate |
Compare ASMNAME with the DECL_ASSEMBLER_NAME of DECL.
References assembler_names_equal_p(), DECL_ASSEMBLER_NAME, and IDENTIFIER_POINTER.
Referenced by asmname_hasher::equal().
|
staticprivate |
Hash asmnames ignoring the user specified marks.
References IDENTIFIER_POINTER, and user_label_prefix.
Referenced by symtab_node::get_for_asmname(), asmname_hasher::hash(), insert_to_assembler_name_hash(), and unlink_from_assembler_name_hash().
void symbol_table::dump | ( | FILE * | f | ) |
References symtab_node::dump(), and FOR_EACH_SYMBOL.
Referenced by analyze_functions(), compile(), debug(), emergency_dump_function(), ipa_icf::sem_item_optimizer::execute(), execute_todo(), ipa_profile(), ipa_pta_execute(), and ipcp_verify_propagated_values().
void symbol_table::dump_graphviz | ( | FILE * | f | ) |
References symtab_node::dump_graphviz(), and FOR_EACH_SYMBOL.
void symbol_table::finalize_compilation_unit | ( | void | ) |
Analyze the whole compilation unit once it is parsed completely.
References analyze_functions(), compile(), current_function_decl, debug_hooks, debuginfo_early_start(), debuginfo_early_stop(), dump_passes(), gcc_debug_hooks::early_finish, lang_hooks::finalize_early_debug, finalize_size_functions(), g, handle_alias_pairs(), gcc::context::have_offload, NULL, nested_function_info::release(), seen_error(), set_cfun(), timevar_pop(), and timevar_push().
Referenced by compile_file().
Register a top-level asm statement ASM_STR.
References asm_last_node, asm_node::asm_str, asmnodes, ggc_cleared_alloc(), asm_node::next, NULL, asm_node::order, and order.
Referenced by default_asm_output_ident_directive(), and lto_input_toplevel_asms().
|
inline |
References asmnodes.
Referenced by lto_output_toplevel_asms(), output_in_order(), and symtab_node::verify_symtab_nodes().
|
inline |
Return first function with body defined.
References symtab_node::definition, dyn_cast(), symtab_node::next, nodes, and NULL.
|
inline |
Return first static symbol with definition.
References symtab_node::definition, symtab_node::next, nodes, and NULL.
|
inline |
Return first static variable with definition.
References symtab_node::definition, dyn_cast(), symtab_node::next, nodes, and NULL.
Referenced by remove_unreferenced_decls().
|
inline |
Return first function.
References dyn_cast(), symtab_node::next, nodes, and NULL.
Referenced by analyze_functions(), process_function_and_variable_attributes(), recursive_inlining(), and remove_unreachable_nodes().
|
inline |
Return first function with body defined.
References dyn_cast(), cgraph_node::has_gimple_body_p(), symtab_node::next, nodes, and NULL.
|
inline |
Return first static variable with initializer.
References symtab_node::decl, DECL_INITIAL, dyn_cast(), symtab_node::next, nodes, and NULL.
|
inline |
|
inline |
Return first variable.
References dyn_cast(), symtab_node::next, nodes, and NULL.
Referenced by analyze_functions(), process_function_and_variable_attributes(), and remove_unreachable_nodes().
|
private |
Put the edge onto the free list.
References edge_released_summary_ids, edges_count, ggc_free(), cgraph_edge::indirect_info, and cgraph_edge::m_summary_id.
Referenced by cgraph_edge::remove(), cgraph_node::remove_callees(), and cgraph_node::remove_callers().
void symbol_table::initialize | ( | void | ) |
Initialize callgraph dump file.
References dump_begin(), dump_file, ipa_clones_dump_file, NULL, TDI_cgraph, and TDI_clones.
Referenced by do_compile().
|
private |
Returns nonzero if P1 and P2 are equal.
Insert NODE to assembler name hash.
References assembler_name_hash, cgraph_node::clones, symtab_node::decl, DECL_ASSEMBLER_NAME, decl_assembler_name_hash(), DECL_HARD_REGISTER, dyn_cast(), hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), gcc_assert, gcc_checking_assert, insert_to_assembler_name_hash(), is_a(), symtab_node::next_sharing_asm_name, cgraph_node::next_sibling_clone, NULL, and symtab_node::previous_sharing_asm_name.
Referenced by change_decl_assembler_name(), insert_to_assembler_name_hash(), symtab_node::register_symbol(), symtab_initialize_asm_name_hash(), and symtab_prevail_in_asm_name_hash().
|
inline |
Return next function with body defined after NODE.
References symtab_node::definition, dyn_cast(), symtab_node::next, and NULL.
|
inline |
Return next static variable with definition after NODE.
References symtab_node::definition, dyn_cast(), symtab_node::next, and NULL.
Referenced by remove_unreferenced_decls().
|
inline |
Return next function.
References dyn_cast(), symtab_node::next, and NULL.
Referenced by process_function_and_variable_attributes(), recursive_inlining(), and remove_unreachable_nodes().
|
inline |
Return next reachable static variable with initializer after NODE.
References dyn_cast(), cgraph_node::has_gimple_body_p(), symtab_node::next, and NULL.
|
inline |
Return next static variable with initializer after NODE.
References symtab_node::decl, DECL_INITIAL, dyn_cast(), symtab_node::next, and NULL.
|
inline |
Return next variable after NODE.
References dyn_cast(), symtab_node::next, and NULL.
Referenced by process_function_and_variable_attributes(), and remove_unreachable_nodes().
bool symbol_table::output_variables | ( | void | ) |
Output all variables enqueued to be assembled.
References varpool_node::assemble_decl(), assemble_undefined_decl(), changed, symtab_node::decl, DECL_HARD_REGISTER, DECL_HAS_VALUE_EXPR_P, symtab_node::definition, varpool_node::finalize_named_section_flags(), FOR_EACH_DEFINED_VARIABLE, FOR_EACH_VARIABLE, symtab_node::no_reorder, remove_unreferenced_decls(), seen_error(), timevar_pop(), and timevar_push().
Referenced by compile().
void symbol_table::output_weakrefs | ( | void | ) |
Weakrefs may be associated to external decls and thus not output at expansion time. Emit all necessary aliases.
References symtab_node::alias, symtab_node::alias_target, symtab_node::analyzed, symtab_node::decl, DECL_ASSEMBLER_NAME, DECL_P, do_assemble_alias(), FOR_EACH_SYMBOL, gcc_unreachable, symtab_node::get_alias_target(), TREE_ASM_WRITTEN, and symtab_node::weakref.
Referenced by compile().
void symbol_table::process_new_functions | ( | void | ) |
Process CGRAPH_NEW_FUNCTIONS and perform actions necessary to add these functions into callgraph in a way so they look like ordinary reachable functions inserted into callgraph already at construction time.
References cgraph_node::analyze(), symtab_node::analyzed, call_cgraph_insertion_hooks(), CDI_DOMINATORS, CDI_POST_DOMINATORS, cgraph_new_nodes, compute_fn_summary(), CONSTRUCTION, symtab_node::decl, DECL_STRUCT_FUNCTION, enqueue_node(), gcc::pass_manager::execute_early_local_passes(), cgraph_node::expand(), EXPANSION, cgraph_node::finalize_function(), free_dominance_info(), g, gcc_unreachable, gcc::context::get_passes(), gimple_in_ssa_p(), gimple_register_cfg_hooks(), handle_alias_pairs(), i, IPA, ipa_fn_summaries, ipa_free_fn_summary(), ipa_free_size_summary(), IPA_SSA, IPA_SSA_AFTER_INLINING, NULL, pop_cfun(), cgraph_node::process, and push_cfun().
Referenced by analyze_functions(), compile(), execute_ipa_pass_list(), execute_one_pass(), expand_all_functions(), and ipa_passes().
void symbol_table::process_same_body_aliases | ( | void | ) |
C++ frontend produce same body aliases all over the place, even before PCH gets streamed out. It relies on us linking the aliases with their function in order to do the fixups, but ipa-ref is not PCH safe. Consequently we first produce aliases without links, but once C++ FE is sure he won't stream PCH we build the links via this function.
References symtab_node::alias_target, symtab_node::analyzed, symtab_node::cpp_implicit_alias, cpp_implicit_aliases_done, FOR_EACH_SYMBOL, cgraph_node::get_create(), varpool_node::get_create(), symtab_node::resolve_alias(), and VAR_P.
|
inline |
Register a symbol NODE.
References symtab_node::next, nodes, NULL, order, symtab_node::order, and symtab_node::previous.
Referenced by symtab_node::register_symbol().
|
inline |
Release a callgraph NODE with UID and put in to the list of free nodes.
References cgraph_count, cgraph_released_summary_ids, ggc_free(), and cgraph_node::m_summary_id.
Referenced by cgraph_node::remove().
void symbol_table::remove_cgraph_duplication_hook | ( | cgraph_2node_hook_list * | entry | ) |
Remove ENTRY from the list of hooks called on duplicating nodes.
References free(), m_first_cgraph_duplicated_hook, and cgraph_2node_hook_list::next.
Referenced by function_summary_base< T >::disable_duplication_hook(), and do_per_function_toporder().
void symbol_table::remove_cgraph_insertion_hook | ( | cgraph_node_hook_list * | entry | ) |
Remove ENTRY from the list of hooks called on inserted nodes.
References free(), m_first_cgraph_insertion_hook, and cgraph_node_hook_list::next.
Referenced by function_summary_base< T >::disable_insertion_hook(), do_per_function_toporder(), ipa_prop_cc_finalize(), and ipa_unregister_cgraph_hooks().
void symbol_table::remove_cgraph_removal_hook | ( | cgraph_node_hook_list * | entry | ) |
Remove ENTRY from the list of hooks called on removing nodes.
References free(), m_first_cgraph_removal_hook, and cgraph_node_hook_list::next.
Referenced by do_per_function_toporder(), ipa_inline(), and ipa_icf::sem_item_optimizer::unregister_hooks().
void symbol_table::remove_edge_duplication_hook | ( | cgraph_2edge_hook_list * | entry | ) |
Remove ENTRY from the list of hooks called on duplicating edges.
References free(), m_first_edge_duplicated_hook, and cgraph_2edge_hook_list::next.
Referenced by call_summary_base< T >::disable_duplication_hook().
void symbol_table::remove_edge_removal_hook | ( | cgraph_edge_hook_list * | entry | ) |
Remove ENTRY from the list of hooks called on removing edges.
References free(), m_first_edge_removal_hook, and cgraph_edge_hook_list::next.
Referenced by inline_small_functions().
bool symbol_table::remove_unreachable_nodes | ( | FILE * | file | ) |
Perform reachability analysis and reclaim all unreachable nodes. The algorithm is basically mark&sweep but with some extra refinements: - reachable extern inline functions needs special handling; the bodies needs to stay in memory until inlining in hope that they will be inlined. After inlining we release their bodies and turn them into unanalyzed nodes even when they are reachable. - virtual functions are kept in callgraph even if they seem unreachable in hope calls to them will be devirtualized. Again we remove them after inlining. In late optimization some devirtualization may happen, but it is not important since we won't inline the call. In theory early opts and IPA should work out all important cases. - virtual clones needs bodies of their origins for later materialization; this means that we want to keep the body even if the origin is unreachable otherwise. To avoid origin from sitting in the callgraph and being walked by IPA passes, we turn them into unanalyzed nodes with body defined. We maintain set of function declaration where body needs to stay in body_needed_for_clonning Inline clones represent special case: their declaration match the declaration of origin and cgraph_remove_node already knows how to reshape callgraph and preserve body when offline copy of function or inline clone is being removed. - C++ virtual tables keyed to other unit are represented as DECL_EXTERNAL variables with DECL_INITIAL set. We finalize these and keep reachable ones around for constant folding purposes. After inlining we however stop walking their references to let everything static referenced by them to be removed when it is otherwise unreachable. We maintain queue of both reachable symbols (i.e. defined symbols that needs to stay) and symbols that are in boundary (i.e. external symbols referenced by reachable symbols or origins of clones). The queue is represented as linked list by AUX pointer terminated by 1. At the end we keep all reachable symbols. For symbols in boundary we always turn definition into a declaration, but we may keep function body around based on body_needed_for_clonning All symbols that enter the queue have AUX pointer non-zero and are in the boundary. Pointer set REACHABLE is used to track reachable symbols. Every symbol can be visited twice - once as part of boundary and once as real reachable symbol. enqueue_node needs to decide whether the node needs to be re-queued for second processing. For this purpose we set AUX pointer of processed symbols in the boundary to constant 2.
References hash_set< KeyId, Lazy, Traits >::add(), symtab_node::address_taken, symtab_node::alias, symtab_node::analyzed, symtab_node::aux, symtab_node::body_removed, build_type_inheritance_graph(), cgraph_node::call_for_symbol_and_aliases(), cgraph_edge::callee, cgraph_node::callers, cgraph_node::can_remove_if_no_direct_calls_and_refs_p(), varpool_node::can_remove_if_no_refs_p(), changed, symtab_node::checking_verify_symtab_nodes(), cgraph_node::clone_of, cgraph_node::clones, symtab_node::comdat_local_p(), hash_set< KeyId, Lazy, Traits >::contains(), symtab_node::cpp_implicit_alias, ctor_for_folding(), debug_hooks, symtab_node::decl, DECL_ABSTRACT_ORIGIN, DECL_ATTRIBUTES, DECL_EXTERNAL, DECL_INITIAL, DECL_RESULT, cgraph_node::declare_variant_alt, symtab_node::definition, symtab_node::dump_name(), dyn_cast(), enqueue_node(), error_mark_node, symtab_node::externally_visible, first_function(), first_variable(), FOR_EACH_DEFINED_FUNCTION, FOR_EACH_DEFINED_VARIABLE, FOR_EACH_FUNCTION, FOR_EACH_VARIABLE, cgraph_node::function_symbol(), gcc_assert, cgraph_node::get(), symtab_node::get_alias_target(), has_addr_references_p(), cgraph_node::has_gimple_body_p(), i, symtab_node::in_other_partition, INCREMENTAL_LINK_LTO, cgraph_node::indirect_call_target, cgraph_edge::indirect_info, cgraph_edge::inline_failed, cgraph_node::inlined_to, ipa_call_summaries, ipa_propagate_frequency(), IPA_SSA_AFTER_INLINING, is_indirect_call_target_p(), symtab_node::iterate_direct_aliases(), symtab_node::iterate_reference(), gcc_debug_hooks::late_global_decl, cgraph_node::local, cgraph_node::local_p(), cgraph_edge::next_callee, cgraph_simd_clone::next_clone, next_function(), cgraph_node::next_sibling_clone, next_variable(), NULL, opt_for_fn, cgraph_indirect_call_info::polymorphic, possible_inline_candidate_p(), cgraph_node::prev_sibling_clone, process_references(), ipa_ref::referred, ipa_ref::referring, cgraph_node::release_body(), cgraph_node::remove(), symtab_node::remove(), varpool_node::remove(), symtab_node::remove_all_references(), remove_attribute(), cgraph_node::remove_callees(), cgraph_node::remove_from_clone_tree(), symtab_node::remove_from_same_comdat_group(), varpool_node::remove_initializer(), symtab_node::same_comdat_group, cgraph_node::simd_clones, cgraph_node::simdclone, state, symtab, cgraph_node::thunk, timevar_pop(), timevar_push(), symtab_node::transparent_alias, TREE_CODE, update_inlined_to_pointer(), cgraph_node::used_as_abstract_origin, symtab_node::used_from_other_partition, walk_polymorphic_call_targets(), and symtab_node::weakref.
Referenced by execute_todo(), ipa_inline(), and ipa_passes().
void symbol_table::remove_unreferenced_decls | ( | void | ) |
Optimization of function bodies might've rendered some variables as unnecessary so we want to avoid these from being compiled. Re-do reachability starting from variables that are either externally visible or was referred from the asm output routines.
References hash_set< KeyId, Lazy, Traits >::add(), symtab_node::alias, symtab_node::analyzed, symtab_node::aux, varpool_node::can_remove_if_no_refs_p(), symtab_node::comdat_local_p(), hash_set< KeyId, Lazy, Traits >::contains(), symtab_node::decl, DECL_EXTERNAL, DECL_RTL_SET_P, symtab_node::definition, symtab_node::dump_asm_name(), dump_file, dyn_cast(), enqueue_node(), first_defined_variable(), FOR_EACH_DEFINED_VARIABLE, gcc_checking_assert, varpool_node::get_alias_target(), i, symtab_node::in_other_partition, symtab_node::iterate_reference(), next_defined_variable(), symtab_node::no_reorder, NULL, ipa_ref::referred, varpool_node::remove(), varpool_node::remove_initializer(), symtab_node::same_comdat_group, and seen_error().
Referenced by output_variables().
void symbol_table::remove_varpool_insertion_hook | ( | varpool_node_hook_list * | entry | ) |
Remove ENTRY from the list of hooks called on inserted nodes.
References free(), m_first_varpool_insertion_hook, and varpool_node_hook_list::next.
void symbol_table::remove_varpool_removal_hook | ( | varpool_node_hook_list * | entry | ) |
Remove ENTRY from the list of hooks called on removing nodes.
References free(), m_first_varpool_removal_hook, and varpool_node_hook_list::next.
Referenced by ipa_reference_cc_finalize(), and ipa_icf::sem_item_optimizer::unregister_hooks().
|
static |
Return symbol used to separate symbol name from suffix.
Referenced by build_var(), clone_function_name(), clone_function_name(), and methods_equal_p().
void symbol_table::symtab_initialize_asm_name_hash | ( | void | ) |
Initialize asm name hash unless.
References assembler_name_hash, hash_table< Descriptor, Lazy, Allocator >::create_ggc(), FOR_EACH_SYMBOL, and insert_to_assembler_name_hash().
Referenced by analyze_functions(), and symtab_node::get_for_asmname().
void symbol_table::symtab_prevail_in_asm_name_hash | ( | symtab_node * | node | ) |
Arrange node to be first in its entry of assembler_name_hash.
References insert_to_assembler_name_hash(), and unlink_from_assembler_name_hash().
Referenced by cgraph_node::get_create().
|
private |
Remove NODE from assembler name hash.
References assembler_name_hash, hash_table< Descriptor, Lazy, Allocator >::clear_slot(), cgraph_node::clones, symtab_node::decl, DECL_ASSEMBLER_NAME, decl_assembler_name_hash(), dyn_cast(), hash_table< Descriptor, Lazy, Allocator >::find_slot_with_hash(), gcc_assert, symtab_node::next_sharing_asm_name, cgraph_node::next_sibling_clone, NULL, symtab_node::previous_sharing_asm_name, and unlink_from_assembler_name_hash().
Referenced by change_decl_assembler_name(), symtab_prevail_in_asm_name_hash(), unlink_from_assembler_name_hash(), and symtab_node::unregister().
|
inline |
Unregister a symbol NODE.
References symtab_node::next, nodes, NULL, and symtab_node::previous.
Referenced by symtab_node::unregister().
|
friend |
|
friend |
|
friend |
|
friend |
asm_node* symbol_table::asm_last_node |
Referenced by clear_asm_symbols(), and finalize_toplevel_asm().
asm_node* symbol_table::asmnodes |
Referenced by clear_asm_symbols(), finalize_toplevel_asm(), and first_asm_symbol().
hash_table<asmname_hasher>* symbol_table::assembler_name_hash |
int symbol_table::cgraph_count |
Referenced by build_toporder_info(), create_empty(), do_per_function_toporder(), expand_all_functions(), inline_small_functions(), ipa_inline(), ipa_profile(), ipa_reduced_postorder(), ipa_reverse_postorder(), ipa_write_summaries(), propagate(), propagate_malloc(), propagate_nothrow(), propagate_pure_const(), and release_symbol().
int symbol_table::cgraph_max_summary_id |
Referenced by assign_summary_id().
int symbol_table::cgraph_max_uid |
Referenced by create_empty().
vec<int> symbol_table::cgraph_released_summary_ids |
Referenced by assign_summary_id(), and release_symbol().
hash_set<const cgraph_node *> symbol_table::cloned_nodes |
Referenced by dump_callgraph_transformation(), and cgraph_node::remove().
bool symbol_table::cpp_implicit_aliases_done |
FILE* symbol_table::dump_file |
Referenced by add_type_duplicate(), analyze_functions(), compile(), coverage_obj_init(), expand_all_functions(), initialize(), ipa_merge_profiles(), ipa_passes(), cgraph_node::materialize_clone(), ipa_param_adjustments::modify_call(), cgraph_edge::redirect_call_stmt_to_callee(), remove_unreferenced_decls(), and walk_polymorphic_call_targets().
vec<int> symbol_table::edge_released_summary_ids |
Referenced by assign_summary_id(), and free_edge().
int symbol_table::edges_count |
Referenced by create_edge(), free_edge(), and ipcp_propagate_stage().
int symbol_table::edges_max_summary_id |
Referenced by assign_summary_id().
int symbol_table::edges_max_uid |
Referenced by create_edge().
bool symbol_table::function_flags_ready |
bool symbol_table::global_info_ready |
hash_map<symtab_node *, symbol_priority_map>* symbol_table::init_priority_hash |
FILE* symbol_table::ipa_clones_dump_file |
Referenced by dump_callgraph_transformation(), initialize(), and cgraph_node::remove().
clone_summary* symbol_table::m_clones |
Referenced by clone_info::get(), clone_info::get_create(), clone_info::release(), and clone_info::remove().
|
private |
Referenced by add_cgraph_duplication_hook(), call_cgraph_duplication_hooks(), and remove_cgraph_duplication_hook().
|
private |
Referenced by add_cgraph_insertion_hook(), call_cgraph_insertion_hooks(), and remove_cgraph_insertion_hook().
|
private |
Referenced by add_cgraph_removal_hook(), call_cgraph_removal_hooks(), and remove_cgraph_removal_hook().
|
private |
Referenced by add_edge_duplication_hook(), call_edge_duplication_hooks(), and remove_edge_duplication_hook().
|
private |
Referenced by add_edge_removal_hook(), call_edge_removal_hooks(), and remove_edge_removal_hook().
|
private |
Referenced by add_varpool_insertion_hook(), call_varpool_insertion_hooks(), and remove_varpool_insertion_hook().
|
private |
Referenced by add_varpool_removal_hook(), call_varpool_removal_hooks(), and remove_varpool_removal_hook().
thunk_summary* symbol_table::m_thunks |
Referenced by thunk_info::get(), thunk_info::get_create(), thunk_info::release(), and thunk_info::remove().
int symbol_table::max_unit |
Referenced by input_cgraph_1(), and input_node().
symtab_node* symbol_table::nodes |
int symbol_table::order |
hash_table<section_name_hasher>* symbol_table::section_hash |
Referenced by release_section_hash_entry(), and symtab_node::set_section_for_node().
enum symtab_state symbol_table::state |
Referenced by cgraph_node::add_new_function(), analyze_functions(), assemble_alias(), autofdo::auto_profile(), symtab_node::binds_to_current_def_p(), create_edge(), cgraph_node::create_thunk(), default_asm_output_ident_directive(), cgraph_node::dump(), dump_possible_polymorphic_call_targets(), execute_build_ssa_passes(), varpool_node::finalize_decl(), cgraph_node::finalize_function(), function_and_variable_visibility(), cgraph_node::get_create(), gimple_fold_builtin_acc_on_device(), gimple_fold_builtin_omp_is_initial_device(), ipa_inline(), ipa_passes(), lto_streaming_expected_p(), maybe_record_nested_function(), omp_context_selector_matches(), omp_maybe_offloaded(), optimize_dyn_tls_for_decl_p(), possible_inline_candidate_p(), process_references(), referenced_from_vtable_p(), cgraph_node::release_body(), cgraph_node::remove(), varpool_node::remove(), varpool_node::remove_initializer(), remove_unreachable_nodes(), symtab_node::resolve_alias(), tree_profiling(), type_all_ctors_visible_p(), symtab_node::verify_base(), cgraph_edge::verify_corresponds_to_fndecl(), cgraph_node::verify_node(), and walk_polymorphic_call_targets().