GCC Middle and Back End API Reference
|
Go to the source code of this file.
Data Structures | |
struct | ipa_dfs_info |
Typedefs | |
typedef odr_type_d * | odr_type |
typedef odr_type_d* odr_type |
void build_type_inheritance_graph | ( | void | ) |
Initialize IPA devirt and build inheritance tree graph.
References hash_table< Descriptor, Allocator >::create(), symtab_node_base::decl, dump_begin(), dump_end(), dump_type_inheritance_graph(), get_odr_type(), hash_table< Descriptor, Allocator >::is_created(), method_class_type(), odr_hash, cgraph_node::symbol, symtab_real_symbol_p(), TDI_inheritance, timevar_pop(), and timevar_push().
Referenced by analyze_functions().
void dump_possible_polymorphic_call_targets | ( | FILE * | f, |
tree | otr_type, | ||
HOST_WIDE_INT | otr_token | ||
) |
Dump all possible targets of a polymorphic call.
References cgraph_node_name(), get_odr_type(), odr_type_d::id, possible_polymorphic_call_targets(), print_generic_expr(), and odr_type_d::type.
Referenced by analyze_functions(), and dump_possible_polymorphic_call_targets().
|
inline |
Dump possible targets of a polymorphic call E into F.
References dump_possible_polymorphic_call_targets(), cgraph_edge::indirect_info, cgraph_indirect_call_info::otr_token, cgraph_indirect_call_info::otr_type, and cgraph_indirect_call_info::polymorphic.
void ipa_free_postorder_info | ( | void | ) |
Deallocate all ipa_dfs_info structures pointed to by the aux pointer of call graph nodes.
References symtab_node_base::aux, free(), and cgraph_node::symbol.
Referenced by free_toporder_info(), inline_small_functions(), propagate(), propagate_nothrow(), and propagate_pure_const().
vec<cgraph_node_ptr> ipa_get_nodes_in_cycle | ( | struct cgraph_node * | ) |
void ipa_print_order | ( | FILE * | out, |
const char * | note, | ||
struct cgraph_node ** | order, | ||
int | count | ||
) |
In ipa-utils.c
@verbatim Utilities for ipa analysis.
Copyright (C) 2005-2013 Free Software Foundation, Inc. Contributed by Kenneth Zadeck zadec k@na tural brid ge.co m
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/.
Debugging function for postorder and inorder code. NOTE is a string that is printed before the nodes are printed. ORDER is an array of cgraph_nodes that has COUNT useful nodes in it.
References dump_cgraph_node(), and dump_file.
Referenced by propagate(), propagate_nothrow(), and propagate_pure_const().
int ipa_reduced_postorder | ( | struct cgraph_node ** | order, |
bool | reduce, | ||
bool | allow_overwritable, | ||
bool(*)(struct cgraph_edge *) | ignore_edge | ||
) |
Topsort the call graph by caller relation. Put the result in ORDER. The REDUCE flag is true if you want the cycles reduced to single nodes. You can use ipa_get_nodes_in_cycle to obtain a vector containing all real call graph nodes in a reduced node. Set ALLOW_OVERWRITABLE if nodes with such availability should be included. IGNORE_EDGE, if non-NULL is a hook that may make some edges insignificant for the topological sort.
References searchc_env::allow_overwritable, symtab_node_base::aux, AVAIL_OVERWRITABLE, cgraph_function_body_availability(), cgraph_n_nodes, searchc_env::count, free(), ignore_edge(), ipa_dfs_info::new_node, ipa_dfs_info::next_cycle, searchc_env::nodes_marked_new, ipa_dfs_info::on_stack, order, searchc_env::order_pos, searchc_env::reduce, searchc_env::result, searchc(), searchc_env::stack, searchc_env::stack_size, cgraph_node::symbol, and cgraph_node::uid.
Referenced by build_toporder_info(), inline_small_functions(), propagate(), propagate_nothrow(), and propagate_pure_const().
int ipa_reverse_postorder | ( | struct cgraph_node ** | ) |
bool possible_polymorphic_call_target_p | ( | tree | otr_type, |
HOST_WIDE_INT | otr_token, | ||
struct cgraph_node * | n | ||
) |
Return true if N can be possibly target of a polymorphic call of OTR_TYPE/OTR_TOKEN.
References hash_table< Descriptor, Allocator >::is_created(), odr_hash, and possible_polymorphic_call_targets().
Referenced by possible_polymorphic_call_target_p().
|
inline |
Return true if N can be possibly target of a polymorphic call of E.
References cgraph_edge::indirect_info, cgraph_indirect_call_info::otr_token, cgraph_indirect_call_info::otr_type, and possible_polymorphic_call_target_p().
vec<cgraph_node *> possible_polymorphic_call_targets | ( | tree | otr_type, |
HOST_WIDE_INT | otr_token, | ||
bool * | finalp, | ||
void ** | cache_token | ||
) |
Return vector containing possible targets of polymorphic call of type OTR_TYPE caling method OTR_TOKEN with OFFSET. If FINALp is non-NULL, store true if the list is complette. CACHE_TOKEN (if non-NULL) will get stored to an unique ID of entry in the target cache. If user needs to visit every target list just once, it can memoize them. Returned vector is placed into cache. It is NOT caller's responsibility to free it. The vector can be freed on cgraph_remove_node call if the particular node is a virtual function present in the cache.
References odr_type_d::anonymous_namespace, cgraph_add_node_removal_hook(), hash_table< Descriptor, Allocator >::create(), odr_type_d::derived_types, devirt_node_removal_hook(), hash_table< Descriptor, Allocator >::find_slot(), get_odr_type(), gimple_get_virt_method_for_binfo(), inserted, maybe_record_node(), node_removal_hook_holder, polymorphic_call_target_d::otr_token, pointer_set_create(), pointer_set_destroy(), pointer_set_insert(), polymorphic_call_target_hash, possible_polymorphic_call_targets_1(), polymorphic_call_target_d::targets, timevar_pop(), timevar_push(), odr_type_d::type, type(), polymorphic_call_target_d::type, and vNULL.
Referenced by analyze_functions(), dump_possible_polymorphic_call_targets(), possible_polymorphic_call_target_p(), and possible_polymorphic_call_targets().
|
inline |
Return vector containing possible targets of polymorphic call E. If FINALP is non-NULL, store true if the list is complette. CACHE_TOKEN (if non-NULL) will get stored to an unique ID of entry in the target cache. If user needs to visit every target list just once, it can memoize them. Returned vector is placed into cache. It is NOT caller's responsibility to free it. The vector can be freed on cgraph_remove_node call if the particular node is a virtual function present in the cache.
References cgraph_edge::indirect_info, cgraph_indirect_call_info::otr_token, cgraph_indirect_call_info::otr_type, cgraph_indirect_call_info::polymorphic, and possible_polymorphic_call_targets().
void update_type_inheritance_graph | ( | void | ) |
After callgraph construction new external nodes may appear. Add them into the graph.
References symtab_node_base::decl, symtab_node_base::definition, free_polymorphic_call_targets_hash(), get_odr_type(), hash_table< Descriptor, Allocator >::is_created(), method_class_type(), odr_hash, cgraph_node::symbol, symtab_real_symbol_p(), timevar_pop(), and timevar_push().
Referenced by analyze_functions().