GCC Middle and Back End API Reference
ipa-utils.c File Reference

Data Structures

struct  searchc_env
struct  postorder_stack

Functions

void ipa_print_order (FILE *out, const char *note, struct cgraph_node **order, int count)
static void searchc (struct searchc_env *env, struct cgraph_node *v, bool(*ignore_edge)(struct cgraph_edge *))
int ipa_reduced_postorder (struct cgraph_node **order, bool reduce, bool allow_overwritable, bool(*ignore_edge)(struct cgraph_edge *))
void ipa_free_postorder_info ()
vec< cgraph_node_ptripa_get_nodes_in_cycle ()
int ipa_reverse_postorder ()
tree get_base_var ()
cgraph_node_set cgraph_node_set_new ()
void cgraph_node_set_add ()
void cgraph_node_set_remove ()
cgraph_node_set_iterator cgraph_node_set_find ()
void dump_cgraph_node_set ()
DEBUG_FUNCTION void debug_cgraph_node_set ()
void free_cgraph_node_set ()
varpool_node_set varpool_node_set_new ()
void varpool_node_set_add ()
void varpool_node_set_remove ()
varpool_node_set_iterator varpool_node_set_find ()
void dump_varpool_node_set ()
void free_varpool_node_set ()
DEBUG_FUNCTION void debug_varpool_node_set ()

Function Documentation

void cgraph_node_set_add ( )
Add cgraph_node NODE to cgraph_node_set SET.   

References pointer_map_insert().

cgraph_node_set_iterator cgraph_node_set_find ( )
Find NODE in SET and return an iterator to it if found.  A null iterator
   is returned if NODE is not in SET.   

References cgraph_node_set_iterator::index, pointer_map_contains(), and cgraph_node_set_iterator::set.

cgraph_node_set cgraph_node_set_new ( void  )
Create a new cgraph node set.   

References cgraph_node_set_def::map, cgraph_node_set_def::nodes, and pointer_map_create().

Referenced by cgraph_add_new_function().

void cgraph_node_set_remove ( )
Remove cgraph_node NODE from cgraph_node_set SET.   

References pointer_map_contains().

DEBUG_FUNCTION void debug_cgraph_node_set ( )
Dump content of SET to stderr.   

References dump_cgraph_node_set().

DEBUG_FUNCTION void debug_varpool_node_set ( )
Dump content of SET to stderr.   

References dump_varpool_node_set().

void dump_cgraph_node_set ( )
void dump_varpool_node_set ( )
Dump content of SET to file F.   

References varpool_node_name(), vsi_end_p(), vsi_next(), vsi_node(), and vsi_start().

void free_cgraph_node_set ( )
Free varpool node set.   

References free(), and pointer_map_destroy().

void free_varpool_node_set ( )
Free varpool node set.   

References free(), and pointer_map_destroy().

tree get_base_var ( )
Given a memory reference T, will return the variable at the bottom
   of the access.  Unlike get_base_address, this will recurse through
   INDIRECT_REFS.   

Referenced by ipa_maybe_record_reference(), and record_reference().

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 ( )
Get the set of nodes for the cycle in the reduced call graph starting
   from NODE.   

References symtab_node_base::aux, ipa_dfs_info::next_cycle, cgraph_node::symbol, and vNULL.

Referenced by propagate().

void ipa_print_order ( FILE *  out,
const char *  note,
struct cgraph_node **  order,
int  count 
)
@verbatim Utilities for ipa analysis.

Copyright (C) 2005-2013 Free Software Foundation, Inc. Contributed by Kenneth Zadeck zadec.nosp@m.k@na.nosp@m.tural.nosp@m.brid.nosp@m.ge.co.nosp@m.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().

static void searchc ( struct searchc_env env,
struct cgraph_node v,
bool(*)(struct cgraph_edge *)  ignore_edge 
)
static
This is an implementation of Tarjan's strongly connected region
   finder as reprinted in Aho Hopcraft and Ullman's The Design and
   Analysis of Computer Programs (1975) pages 192-193.  This version
   has been customized for cgraph_nodes.  The env parameter is because
   it is recursive and there are no nested functions here.  This
   function should only be called from itself or
   ipa_reduced_postorder.  ENV is a stack env and would be
   unnecessary if C had nested functions.  V is the node to start
   searching from.   

References searchc_env::allow_overwritable, symtab_node_base::aux, AVAIL_OVERWRITABLE, cgraph_edge::callee, cgraph_node::callees, cgraph_function_or_thunk_node(), searchc_env::count, ipa_dfs_info::dfn_number, ignore_edge(), last, ipa_dfs_info::low_link, ipa_dfs_info::new_node, cgraph_edge::next_callee, ipa_dfs_info::next_cycle, searchc_env::nodes_marked_new, ipa_dfs_info::on_stack, searchc_env::order_pos, searchc_env::reduce, searchc_env::result, ipa_dfs_info::scc_no, searchc_env::stack, searchc_env::stack_size, cgraph_node::symbol, and cgraph_node::uid.

Referenced by ipa_reduced_postorder().

void varpool_node_set_add ( )
Add varpool_node NODE to varpool_node_set SET.   

References pointer_map_insert().

varpool_node_set_iterator varpool_node_set_find ( )
Find NODE in SET and return an iterator to it if found.  A null iterator
   is returned if NODE is not in SET.   

References varpool_node_set_iterator::index, pointer_map_contains(), and varpool_node_set_iterator::set.

varpool_node_set varpool_node_set_new ( void  )
Create a new varpool node set.   

References varpool_node_set_def::map, varpool_node_set_def::nodes, and pointer_map_create().

Referenced by ipa_lower_emutls().

void varpool_node_set_remove ( )
Remove varpool_node NODE from varpool_node_set SET.   

References pointer_map_contains().