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.
We reconstruct the graph starting of types of all methods seen in the the unit.
References pointer_set_insert().
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 flags_from_decl_or_type(), lookup_attribute(), and NODE_FREQUENCY_NORMAL.
Referenced by varpool_finalize_decl().
|
inline |
Dump possible targets of a polymorphic call E into F.
References cgraph_edge::indirect_info, cgraph_indirect_call_info::otr_token, cgraph_indirect_call_info::otr_type, and possible_polymorphic_call_target_p().
bool ipa_edge_within_scc | ( | struct cgraph_edge * | ) |
void ipa_free_postorder_info | ( | void | ) |
Deallocate all ipa_dfs_info structures pointed to by the aux pointer of call graph nodes.
Get rid of the aux information.
References symtab_node_base::aux, and free().
vec<cgraph_node_ptr> ipa_get_nodes_in_cycle | ( | struct cgraph_node * | ) |
void ipa_merge_profiles | ( | struct cgraph_node * | dst, |
struct cgraph_node * | src | ||
) |
SRC and DST are going to be merged. Take SRC's profile and merge it into DST so it is not going to be lost. Destroy SRC's body on the way.
This is ugly. We need to get both function bodies into memory. 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.
We are going to move the decl, we want to remove its file decl data. and link these with the new decl.
Duplicate the decl and be sure it does not link into body of DST.
Associate the decl state with new declaration, so LTO streamer can look it up.
TODO: merge also statement histograms.
TODO: if there is no match, we can scale up.
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.
bool ipa_propagate_frequency | ( | struct cgraph_node * | node | ) |
In ipa-profile.c
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.
Reuse the info if it is already there.
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.
At a moment we allow middle end to dig out new external declarations as a targets of polymorphic calls.
References cgraph_node_name(), dump_file, cgraph_node::indirect_calls, cgraph_edge::indirect_info, cgraph_edge::next_callee, symtab_node_base::order, pointer_set_create(), and cgraph_indirect_call_info::polymorphic.
Referenced by dump_possible_polymorphic_call_targets(), and possible_polymorphic_call_target_p().
|
inline |
Return true if N can be possibly target of a polymorphic call of E.
References obj_type_ref_class(), possible_polymorphic_call_target_p(), and tree_low_cst().
|
inline |
Return true if N can be possibly target of a polymorphic call of OBJ_TYPE_REF expression CALL.
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.
If we do not have type in our hash it means we never seen any method in it.
For anonymous namespace types we can attempt to build full type. All derivations must be in this unit.
Initialize query cache.
Lookup cached answer.
Do actual search.
First see virtual method of type itself.
TODO: If method is final, we can stop here and signaize that list is final. We need C++ FE to pass our info about final methods and classes.
Walk recursively all derived types. Here we need to lookup proper basetype via their BINFO walk that is done by record_binfo
|
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.
void update_type_inheritance_graph | ( | void | ) |
After callgraph construction new external nodes may appear. Add them into the graph.
We reconstruct the graph starting of types of all methods seen in the the unit.