GCC Middle and Back End API Reference
cgraph.h File Reference

Go to the source code of this file.

Data Structures

struct  symtab_node_base
struct  cgraph_thunk_info
struct  cgraph_local_info
struct  cgraph_global_info
struct  cgraph_rtl_info
struct  ipa_replace_map
struct  cgraph_clone_info
struct  cgraph_node
struct  cgraph_function_version_info
struct  cgraph_node_set_def
struct  varpool_node_set_def
struct  cgraph_node_set_iterator
struct  varpool_node_set_iterator
struct  cgraph_indirect_call_info
struct  cgraph_edge
struct  varpool_node
struct  asm_node
struct  constant_descriptor_tree

Typedefs

typedef struct ipa_replace_mapipa_replace_map_p
typedef struct cgraph_nodecgraph_node_ptr
typedef struct varpool_nodevarpool_node_ptr
typedef struct
cgraph_node_set_def
cgraph_node_set
typedef struct
varpool_node_set_def
varpool_node_set
typedef enum
cgraph_inline_failed_enum 
cgraph_inline_failed_t
typedef struct cgraph_edgecgraph_edge_p
typedef void(* cgraph_edge_hook )(struct cgraph_edge *, void *)
typedef void(* cgraph_node_hook )(struct cgraph_node *, void *)
typedef void(* cgraph_2edge_hook )(struct cgraph_edge *, struct cgraph_edge *, void *)
typedef void(* cgraph_2node_hook )(struct cgraph_node *, struct cgraph_node *, void *)

Enumerations

enum  symtab_type { SYMTAB_SYMBOL, SYMTAB_FUNCTION, SYMTAB_VARIABLE }
enum  availability {
  AVAIL_UNSET, AVAIL_NOT_AVAILABLE, AVAIL_OVERWRITABLE, AVAIL_AVAILABLE,
  AVAIL_LOCAL
}
enum  cgraph_inline_failed_enum { CIF_N_REASONS }
enum  cgraph_state {
  CGRAPH_STATE_PARSING, CGRAPH_STATE_CONSTRUCTION, CGRAPH_LTO_STREAMING, CGRAPH_STATE_IPA,
  CGRAPH_STATE_IPA_SSA, CGRAPH_STATE_EXPANSION, CGRAPH_STATE_FINISHED
}

Functions

struct
cgraph_function_version_info
get_cgraph_node_version (struct cgraph_node *node)
struct
cgraph_function_version_info
insert_new_cgraph_node_version (struct cgraph_node *node)
void record_function_versions (tree decl1, tree decl2)
void delete_function_version (tree decl)
union GTY ((desc("%h.symbol.type"), chain_next("%h.symbol.next"), chain_prev("%h.symbol.previous"))) symtab_node_def
void symtab_register_node (symtab_node)
void symtab_unregister_node (symtab_node)
void symtab_remove_node (symtab_node)
symtab_node symtab_get_node (const_tree)
symtab_node symtab_node_for_asm (const_tree asmname)
const char * symtab_node_asm_name (symtab_node)
const char * symtab_node_name (symtab_node)
void symtab_insert_node_to_hashtable (symtab_node)
void symtab_add_to_same_comdat_group (symtab_node, symtab_node)
void symtab_dissolve_same_comdat_group_list (symtab_node node)
void dump_symtab (FILE *)
void debug_symtab (void)
void dump_symtab_node (FILE *, symtab_node)
void debug_symtab_node (symtab_node)
void dump_symtab_base (FILE *, symtab_node)
void verify_symtab (void)
void verify_symtab_node (symtab_node)
bool verify_symtab_base (symtab_node)
bool symtab_used_from_object_file_p (symtab_node)
void symtab_make_decl_local (tree)
symtab_node symtab_alias_ultimate_target (symtab_node, enum availability *avail=NULL)
bool symtab_resolve_alias (symtab_node node, symtab_node target)
void fixup_same_cpp_alias_visibility (symtab_node node, symtab_node target)
bool symtab_for_node_and_aliases (symtab_node, bool(*)(symtab_node, void *), void *, bool)
symtab_node symtab_nonoverwritable_alias (symtab_node)
enum availability symtab_node_availability (symtab_node)
void dump_cgraph (FILE *)
void debug_cgraph (void)
void dump_cgraph_node (FILE *, struct cgraph_node *)
void debug_cgraph_node (struct cgraph_node *)
void cgraph_remove_edge (struct cgraph_edge *)
void cgraph_remove_node (struct cgraph_node *)
void cgraph_release_function_body (struct cgraph_node *)
void release_function_body (tree)
void cgraph_node_remove_callees (struct cgraph_node *node)
struct cgraph_edgecgraph_create_edge (struct cgraph_node *, struct cgraph_node *, gimple, gcov_type, int)
struct cgraph_edgecgraph_create_indirect_edge (struct cgraph_node *, gimple, int, gcov_type, int)
struct cgraph_indirect_call_infocgraph_allocate_init_indirect_info (void)
struct cgraph_nodecgraph_create_node (tree)
struct cgraph_nodecgraph_create_empty_node (void)
struct cgraph_nodecgraph_get_create_node (tree)
struct cgraph_nodecgraph_get_create_real_symbol_node (tree)
struct cgraph_nodecgraph_same_body_alias (struct cgraph_node *, tree, tree)
struct cgraph_nodecgraph_add_thunk (struct cgraph_node *, tree, tree, bool, HOST_WIDE_INT, HOST_WIDE_INT, tree, tree)
struct cgraph_nodecgraph_node_for_asm (tree)
struct cgraph_edgecgraph_edge (struct cgraph_node *, gimple)
void cgraph_set_call_stmt (struct cgraph_edge *, gimple, bool update_speculative=true)
void cgraph_update_edges_for_call_stmt (gimple, tree, gimple)
struct cgraph_local_infocgraph_local_info (tree)
struct cgraph_global_infocgraph_global_info (tree)
struct cgraph_rtl_infocgraph_rtl_info (tree)
struct cgraph_nodecgraph_create_function_alias (tree, tree)
void cgraph_call_node_duplication_hooks (struct cgraph_node *, struct cgraph_node *)
void cgraph_call_edge_duplication_hooks (struct cgraph_edge *, struct cgraph_edge *)
void cgraph_redirect_edge_callee (struct cgraph_edge *, struct cgraph_node *)
struct cgraph_edgecgraph_make_edge_direct (struct cgraph_edge *, struct cgraph_node *)
bool cgraph_only_called_directly_p (struct cgraph_node *)
bool cgraph_function_possibly_inlined_p (tree)
void cgraph_unnest_node (struct cgraph_node *)
enum availability cgraph_function_body_availability (struct cgraph_node *)
void cgraph_add_new_function (tree, bool)
const char * cgraph_inline_failed_string (cgraph_inline_failed_t)
void cgraph_set_nothrow_flag (struct cgraph_node *, bool)
void cgraph_set_const_flag (struct cgraph_node *, bool, bool)
void cgraph_set_pure_flag (struct cgraph_node *, bool, bool)
bool cgraph_node_cannot_return (struct cgraph_node *)
bool cgraph_edge_cannot_lead_to_return (struct cgraph_edge *)
bool cgraph_will_be_removed_from_program_if_no_direct_calls (struct cgraph_node *node)
bool cgraph_can_remove_if_no_direct_calls_and_refs_p (struct cgraph_node *node)
bool cgraph_can_remove_if_no_direct_calls_p (struct cgraph_node *node)
bool resolution_used_from_other_file_p (enum ld_plugin_symbol_resolution)
bool cgraph_for_node_thunks_and_aliases (struct cgraph_node *, bool(*)(struct cgraph_node *, void *), void *, bool)
bool cgraph_for_node_and_aliases (struct cgraph_node *, bool(*)(struct cgraph_node *, void *), void *, bool)
vec< cgraph_edge_pcollect_callers_of_node (struct cgraph_node *node)
void verify_cgraph (void)
void verify_cgraph_node (struct cgraph_node *)
void cgraph_mark_address_taken_node (struct cgraph_node *)
struct cgraph_edge_hook_listcgraph_add_edge_removal_hook (cgraph_edge_hook, void *)
void cgraph_remove_edge_removal_hook (struct cgraph_edge_hook_list *)
struct cgraph_node_hook_listcgraph_add_node_removal_hook (cgraph_node_hook, void *)
void cgraph_remove_node_removal_hook (struct cgraph_node_hook_list *)
struct cgraph_node_hook_listcgraph_add_function_insertion_hook (cgraph_node_hook, void *)
void cgraph_remove_function_insertion_hook (struct cgraph_node_hook_list *)
void cgraph_call_function_insertion_hooks (struct cgraph_node *node)
struct cgraph_2edge_hook_listcgraph_add_edge_duplication_hook (cgraph_2edge_hook, void *)
void cgraph_remove_edge_duplication_hook (struct cgraph_2edge_hook_list *)
struct cgraph_2node_hook_listcgraph_add_node_duplication_hook (cgraph_2node_hook, void *)
void cgraph_remove_node_duplication_hook (struct cgraph_2node_hook_list *)
gimple cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *)
bool cgraph_propagate_frequency (struct cgraph_node *node)
struct cgraph_nodecgraph_function_node (struct cgraph_node *, enum availability *avail=NULL)
bool cgraph_get_body (struct cgraph_node *node)
struct cgraph_edgecgraph_turn_edge_to_speculative (struct cgraph_edge *, struct cgraph_node *, gcov_type, int)
void cgraph_speculative_call_info (struct cgraph_edge *, struct cgraph_edge *&, struct cgraph_edge *&, struct ipa_ref *&)
struct asm_nodeadd_asm_node (tree)
void cgraph_finalize_function (tree, bool)
void finalize_compilation_unit (void)
void compile (void)
void init_cgraph (void)
bool cgraph_process_new_functions (void)
void cgraph_process_same_body_aliases (void)
void fixup_same_cpp_alias_visibility (symtab_node, symtab_node target, tree)
basic_block init_lowered_empty_function (tree, bool)
void cgraph_reset_node (struct cgraph_node *)
void expand_thunk (struct cgraph_node *)
struct cgraph_edgecgraph_clone_edge (struct cgraph_edge *, struct cgraph_node *, gimple, unsigned, gcov_type, int, bool)
struct cgraph_nodecgraph_clone_node (struct cgraph_node *, tree, gcov_type, int, bool, vec< cgraph_edge_p >, bool, struct cgraph_node *)
tree clone_function_name (tree decl, const char *)
struct cgraph_nodecgraph_create_virtual_clone (struct cgraph_node *old_node, vec< cgraph_edge_p >, vec< ipa_replace_map_p, va_gc > *tree_map, bitmap args_to_skip, const char *clone_name)
struct cgraph_nodecgraph_find_replacement_node (struct cgraph_node *)
bool cgraph_remove_node_and_inline_clones (struct cgraph_node *, struct cgraph_node *)
void cgraph_set_call_stmt_including_clones (struct cgraph_node *, gimple, gimple, bool update_speculative=true)
void cgraph_create_edge_including_clones (struct cgraph_node *, struct cgraph_node *, gimple, gimple, gcov_type, int, cgraph_inline_failed_t)
void cgraph_materialize_all_clones (void)
struct cgraph_nodecgraph_copy_node_for_versioning (struct cgraph_node *, tree, vec< cgraph_edge_p >, bitmap)
struct cgraph_nodecgraph_function_versioning (struct cgraph_node *, vec< cgraph_edge_p >, vec< ipa_replace_map_p, va_gc > *, bitmap, bool, bitmap, basic_block, const char *)
void tree_function_versioning (tree, tree, vec< ipa_replace_map_p, va_gc > *, bool, bitmap, bool, bitmap, basic_block)
struct cgraph_edgecgraph_resolve_speculation (struct cgraph_edge *, tree)
unsigned int rebuild_cgraph_edges (void)
void cgraph_rebuild_references (void)
int compute_call_stmt_bb_frequency (tree, basic_block bb)
void record_references_in_initializer (tree, bool)
void ipa_record_stmt_references (struct cgraph_node *, gimple)
bool symtab_remove_unreachable_nodes (bool, FILE *)
cgraph_node_set cgraph_node_set_new (void)
cgraph_node_set_iterator cgraph_node_set_find (cgraph_node_set, struct cgraph_node *)
void cgraph_node_set_add (cgraph_node_set, struct cgraph_node *)
void cgraph_node_set_remove (cgraph_node_set, struct cgraph_node *)
void dump_cgraph_node_set (FILE *, cgraph_node_set)
void debug_cgraph_node_set (cgraph_node_set)
void free_cgraph_node_set (cgraph_node_set)
void cgraph_build_static_cdtor (char which, tree body, int priority)
varpool_node_set varpool_node_set_new (void)
varpool_node_set_iterator varpool_node_set_find (varpool_node_set, struct varpool_node *)
void varpool_node_set_add (varpool_node_set, struct varpool_node *)
void varpool_node_set_remove (varpool_node_set, struct varpool_node *)
void dump_varpool_node_set (FILE *, varpool_node_set)
void debug_varpool_node_set (varpool_node_set)
void free_varpool_node_set (varpool_node_set)
void ipa_discover_readonly_nonaddressable_vars (void)
bool varpool_externally_visible_p (struct varpool_node *)
bool cgraph_maybe_hot_edge_p (struct cgraph_edge *e)
bool cgraph_optimize_for_size_p (struct cgraph_node *)
struct varpool_nodevarpool_create_empty_node (void)
struct varpool_nodevarpool_node_for_decl (tree)
struct varpool_nodevarpool_node_for_asm (tree asmname)
void varpool_mark_needed_node (struct varpool_node *)
void debug_varpool (void)
void dump_varpool (FILE *)
void dump_varpool_node (FILE *, struct varpool_node *)
void varpool_finalize_decl (tree)
enum availability cgraph_variable_initializer_availability (struct varpool_node *)
void cgraph_make_node_local (struct cgraph_node *)
bool cgraph_node_can_be_local_p (struct cgraph_node *)
void varpool_remove_node (struct varpool_node *node)
void varpool_finalize_named_section_flags (struct varpool_node *node)
bool varpool_output_variables (void)
bool varpool_assemble_decl (struct varpool_node *node)
void varpool_analyze_node (struct varpool_node *)
struct varpool_nodevarpool_extra_name_alias (tree, tree)
struct varpool_nodevarpool_create_variable_alias (tree, tree)
void varpool_reset_queue (void)
tree ctor_for_folding (tree)
bool varpool_for_node_and_aliases (struct varpool_node *, bool(*)(struct varpool_node *, void *), void *, bool)
void varpool_add_new_variable (tree)
void symtab_initialize_asm_name_hash (void)
void symtab_prevail_in_asm_name_hash (symtab_node node)
void varpool_remove_initializer (struct varpool_node *)
static struct cgraph_nodecgraph ()
static struct varpool_nodevarpool ()
static struct cgraph_nodecgraph_get_node ()
static struct varpool_nodevarpool_get_node ()
static const char * cgraph_node_asm_name ()
static const char * varpool_node_asm_name ()
static const char * cgraph_node_name ()
static const char * varpool_node_name ()
static struct varpool_nodevarpool_first_variable ()
static struct varpool_nodevarpool_next_variable ()
static struct varpool_nodevarpool_first_static_initializer ()
static struct varpool_nodevarpool_next_static_initializer ()
static struct varpool_nodevarpool_first_defined_variable ()
static struct varpool_nodevarpool_next_defined_variable ()
static struct cgraph_nodecgraph_first_defined_function ()
static struct cgraph_nodecgraph_next_defined_function ()
static struct cgraph_nodecgraph_first_function ()
static struct cgraph_nodecgraph_next_function ()
static bool cgraph_function_with_gimple_body_p ()
static struct cgraph_nodecgraph_first_function_with_gimple_body ()
static struct cgraph_nodecgraph_next_function_with_gimple_body ()
tree add_new_static_var (tree type)
static bool csi_end_p ()
static void csi_next ()
static struct cgraph_nodecsi_node ()
static cgraph_node_set_iterator csi_start ()
static bool cgraph_node_in_set_p ()
static size_t cgraph_node_set_size ()
static bool vsi_end_p ()
static void vsi_next ()
static struct varpool_nodevsi_node ()
static varpool_node_set_iterator vsi_start ()
static bool varpool_node_in_set_p ()
static size_t varpool_node_set_size ()
static bool cgraph_node_set_nonempty_p ()
static bool varpool_node_set_nonempty_p ()
static bool cgraph_only_called_directly_or_aliased_p ()
static bool varpool_can_remove_if_no_refs ()
static bool varpool_all_refs_explicit_p ()
htab_t constant_pool_htab (void)
static symtab_node symtab_alias_target ()
static struct cgraph_nodecgraph_alias_target ()
static struct varpool_nodevarpool_alias_target ()
static struct cgraph_nodecgraph_function_or_thunk_node (struct cgraph_node *node, enum availability *availability=NULL)
static struct varpool_nodevarpool_variable_node (struct varpool_node *node, enum availability *availability=NULL)
static bool cgraph_edge_recursive_p ()
static bool decl_is_tm_clone ()
static void cgraph_mark_force_output_node ()
static bool symtab_real_symbol_p ()
static bool symtab_can_be_discarded ()

Variables

const char *const cgraph_availability_names []
const char *const ld_plugin_symbol_resolution_names []
symtab_node symtab_nodes
int cgraph_n_nodes
int cgraph_max_uid
int cgraph_edge_max_uid
bool cgraph_global_info_ready
enum cgraph_state cgraph_state
bool cgraph_function_flags_ready
cgraph_node_set cgraph_new_nodes
struct asm_nodeasm_nodes
int symtab_order
bool cpp_implicit_aliases_done
FILE * cgraph_dump_file

Typedef Documentation

typedef void(* cgraph_2edge_hook)(struct cgraph_edge *, struct cgraph_edge *, void *)
typedef void(* cgraph_2node_hook)(struct cgraph_node *, struct cgraph_node *, void *)
typedef void(* cgraph_edge_hook)(struct cgraph_edge *, void *)
typedef struct cgraph_edge* cgraph_edge_p
Reasons for inlining failures.   
typedef void(* cgraph_node_hook)(struct cgraph_node *, void *)
typedef struct cgraph_node* cgraph_node_ptr
typedef struct varpool_node* varpool_node_ptr

Enumeration Type Documentation

Enumerator:
AVAIL_UNSET 
AVAIL_NOT_AVAILABLE 
AVAIL_OVERWRITABLE 
AVAIL_AVAILABLE 
AVAIL_LOCAL 
Reasons for inlining failures.   
Enumerator:
CIF_N_REASONS 
Enumerator:
CGRAPH_STATE_PARSING 
CGRAPH_STATE_CONSTRUCTION 
CGRAPH_LTO_STREAMING 
CGRAPH_STATE_IPA 
CGRAPH_STATE_IPA_SSA 
CGRAPH_STATE_EXPANSION 
CGRAPH_STATE_FINISHED 
Symbol table consists of functions and variables.
   TODO: add labels and CONST_DECLs.   
Enumerator:
SYMTAB_SYMBOL 
SYMTAB_FUNCTION 
SYMTAB_VARIABLE 

Function Documentation

struct asm_node* add_asm_node ( tree  )
read
tree add_new_static_var ( tree  type)
Create a new static variable of type TYPE.   
struct cgraph_2edge_hook_list* cgraph_add_edge_duplication_hook ( cgraph_2edge_hook  ,
void *   
)
read
struct cgraph_edge_hook_list* cgraph_add_edge_removal_hook ( cgraph_edge_hook  ,
void *   
)
read
struct cgraph_node_hook_list* cgraph_add_function_insertion_hook ( cgraph_node_hook  ,
void *   
)
read
void cgraph_add_new_function ( tree  ,
bool   
)
struct cgraph_2node_hook_list* cgraph_add_node_duplication_hook ( cgraph_2node_hook  ,
void *   
)
read
struct cgraph_node_hook_list* cgraph_add_node_removal_hook ( cgraph_node_hook  ,
void *   
)
read
struct cgraph_node* cgraph_add_thunk ( struct cgraph_node decl_node,
tree  alias,
tree  decl,
bool  this_adjusting,
HOST_WIDE_INT  fixed_offset,
HOST_WIDE_INT  virtual_value,
tree  virtual_offset,
tree  real_alias 
)
read
static struct cgraph_node* cgraph_alias_target ( )
staticread
struct cgraph_indirect_call_info* cgraph_allocate_init_indirect_info ( void  )
read
Allocate cgraph_indirect_call_info and set its fields to default values.  

References cgraph_indirect_call_info::param_index.

Referenced by cgraph_create_indirect_edge().

void cgraph_build_static_cdtor ( char  which,
tree  body,
int  priority 
)
void cgraph_call_edge_duplication_hooks ( struct cgraph_edge cs1,
struct cgraph_edge cs2 
)
void cgraph_call_function_insertion_hooks ( struct cgraph_node node)
void cgraph_call_node_duplication_hooks ( struct cgraph_node node1,
struct cgraph_node node2 
)
bool cgraph_can_remove_if_no_direct_calls_and_refs_p ( struct cgraph_node node)
bool cgraph_can_remove_if_no_direct_calls_p ( struct cgraph_node node)
struct cgraph_edge* cgraph_clone_edge ( struct cgraph_edge e,
struct cgraph_node n,
gimple  call_stmt,
unsigned  stmt_uid,
gcov_type  count_scale,
int  freq_scale,
bool  update_original 
)
read
In cgraphclones.c   
@verbatim Callgraph clones

Copyright (C) 2003-2013 Free Software Foundation, Inc. Contributed by Jan Hubicka

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/.

This module provide facilities for clonning functions. I.e. creating
   new functions based on existing functions with simple modifications,
   such as replacement of parameters.

   To allow whole program optimization without actual presence of function
   bodies, an additional infrastructure is provided for so-called virtual
   clones

   A virtual clone in the callgraph is a function that has no
   associated body, just a description of how to create its body based
   on a different function (which itself may be a virtual clone).

   The description of function modifications includes adjustments to
   the function's signature (which allows, for example, removing or
   adding function arguments), substitutions to perform on the
   function body, and, for inlined functions, a pointer to the
   function that it will be inlined into.

   It is also possible to redirect any edge of the callgraph from a
   function to its virtual clone.  This implies updating of the call
   site to adjust for the new function signature.

   Most of the transformations performed by inter-procedural
   optimizations can be represented via virtual clones.  For
   instance, a constant propagation pass can produce a virtual clone
   of the function which replaces one of its arguments by a
   constant.  The inliner can represent its decisions by producing a
   clone of a function whose body will be later integrated into
   a given function.

   Using virtual clones, the program can be easily updated
   during the Execute stage, solving most of pass interactions
   problems that would otherwise occur during Transform.

   Virtual clones are later materialized in the LTRANS stage and
   turned into real functions.  Passes executed after the virtual
   clone were introduced also perform their Transform stage
   on new functions, so for a pass there is no significant
   difference between operating on a real function or a virtual
   clone introduced before its Execute stage.

   Optimization passes then work on virtual clones introduced before
   their Execute stage as if they were real functions.  The
   only difference is that clones are not visible during the
   Generate Summary stage.   
Create clone of E in the node N represented by CALL_EXPR the callgraph.   

References apply_probability(), cgraph_edge::call_stmt_cannot_inline_p, cgraph_edge::callee, cgraph_edge::can_throw_external, cgraph_call_edge_duplication_hooks(), cgraph_create_edge(), cgraph_create_indirect_edge(), cgraph_get_node(), count, cgraph_edge::count, cgraph_indirect_call_info::ecf_flags, cgraph_edge::frequency, gimple_call_fndecl(), cgraph_edge::indirect_info, cgraph_edge::indirect_inlining_edge, cgraph_edge::indirect_unknown_callee, cgraph_edge::inline_failed, cgraph_edge::lto_stmt_uid, and cgraph_edge::speculative.

Referenced by cgraph_clone_node(), cgraph_copy_node_for_versioning(), and copy_bb().

struct cgraph_node* cgraph_clone_node ( struct cgraph_node n,
tree  decl,
gcov_type  count,
int  freq,
bool  update_original,
vec< cgraph_edge_p redirect_callers,
bool  call_duplication_hook,
struct cgraph_node new_inlined_to 
)
read
Create node representing clone of N executed COUNT times.  Decrease
   the execution counts from original node too.
   The new clone will have decl set to DECL that may or may not be the same
   as decl of N.

   When UPDATE_ORIGINAL is true, the counts are subtracted from the original
   function's profile to reflect the fact that part of execution is handled
   by node.  
   When CALL_DUPLICATOIN_HOOK is true, the ipa passes are acknowledged about
   the new clone. Otherwise the caller is responsible for doing so later.

   If the new node is being inlined into another one, NEW_INLINED_TO should be
   the outline function the new one is (even indirectly) inlined to.  All hooks
   will see this in node's global.inlined_to, when invoked.  Can be NULL if the
   node is not inlined.   

References symtab_node_base::analyzed, cgraph_edge::call_stmt, cgraph_node::callees, cgraph_call_node_duplication_hooks(), cgraph_clone_edge(), cgraph_create_empty_node(), cgraph_redirect_edge_callee(), cgraph_node::clone, cgraph_node::clone_of, cgraph_node::clones, count, cgraph_node::count, symtab_node_base::decl, symtab_node_base::definition, cgraph_node::global, cgraph_node::indirect_calls, cgraph_global_info::inlined_to, ipa_clone_references(), cgraph_local_info::local, cgraph_node::local, symtab_node_base::lto_file_data, cgraph_edge::lto_stmt_uid, cgraph_edge::next_callee, cgraph_node::origin, cgraph_node::prev_sibling_clone, symtab_node_base::ref_list, cgraph_node::rtl, cgraph_node::symbol, symtab_register_node(), and cgraph_clone_info::tree_map.

Referenced by cgraph_create_virtual_clone(), clone_inlined_nodes(), input_node(), and recursive_inlining().

struct cgraph_node* cgraph_copy_node_for_versioning ( struct cgraph_node old_version,
tree  new_decl,
vec< cgraph_edge_p redirect_callers,
bitmap  bbs_to_copy 
)
read
Create a new cgraph node which is the new version of
   OLD_VERSION node.  REDIRECT_CALLERS holds the callers
   edges which should be redirected to point to
   NEW_VERSION.  ALL the callees edges of OLD_VERSION
   are cloned to the new version node.  Return the new
   version node. 

   If non-NULL BLOCK_TO_COPY determine what basic blocks 
   was copied to prevent duplications of calls that are dead
   in the clone.   

References symtab_node_base::analyzed, bitmap_bit_p(), cgraph_edge::call_stmt, cgraph_node::callees, cgraph_call_node_duplication_hooks(), cgraph_clone_edge(), cgraph_create_node(), cgraph_redirect_edge_callee(), cgraph_node::count, symtab_node_base::definition, symtab_node_base::externally_visible, cgraph_node::global, cgraph_node::indirect_calls, cgraph_local_info::local, cgraph_node::local, cgraph_edge::lto_stmt_uid, cgraph_edge::next_callee, cgraph_node::rtl, and cgraph_node::symbol.

Referenced by cgraph_function_versioning(), and ipa_tm_create_version().

void cgraph_create_edge_including_clones ( struct cgraph_node orig,
struct cgraph_node callee,
gimple  old_stmt,
gimple  stmt,
gcov_type  count,
int  freq,
cgraph_inline_failed_t  reason 
)
Like cgraph_create_edge walk the clone tree and update all clones sharing
   same function body.  If clones already have edge for OLD_STMT; only
   update the edge same way as cgraph_set_call_stmt_including_clones does.

   TODO: COUNT and LOOP_DEPTH should be properly distributed based on relative
   frequencies of the clones.   

References cgraph_create_edge(), cgraph_edge(), cgraph_set_call_stmt(), cgraph_node::clone_of, cgraph_node::clones, cgraph_edge::inline_failed, and cgraph_node::next_sibling_clone.

Referenced by copy_bb().

struct cgraph_node* cgraph_create_empty_node ( void  )
read
Allocate new callgraph node and insert it into basic data structures.   

References cgraph_allocate_node(), cgraph_n_nodes, cgraph_node::count_materialization_scale, NODE_FREQUENCY_NORMAL, cgraph_node::symbol, and SYMTAB_FUNCTION.

Referenced by cgraph_clone_node(), cgraph_create_node(), and input_node().

struct cgraph_node* cgraph_create_function_alias ( tree  ,
tree   
)
read
struct cgraph_node* cgraph_create_node ( tree  )
read
struct cgraph_node* cgraph_create_virtual_clone ( struct cgraph_node old_node,
vec< cgraph_edge_p redirect_callers,
vec< ipa_replace_map_p, va_gc > *  tree_map,
bitmap  args_to_skip,
const char *  suffix 
)
read
struct cgraph_edge* cgraph_edge ( struct cgraph_node ,
gimple   
)
read
bool cgraph_edge_cannot_lead_to_return ( struct cgraph_edge )
static bool cgraph_edge_recursive_p ( )
inlinestatic
void cgraph_finalize_function ( tree  ,
bool   
)
struct cgraph_node* cgraph_find_replacement_node ( struct cgraph_node )
read

Referenced by symtab_unregister_node().

static struct cgraph_node* cgraph_first_defined_function ( )
staticread
Return first function with body defined.   
static struct cgraph_node* cgraph_first_function ( )
staticread
static struct cgraph_node* cgraph_first_function_with_gimple_body ( )
staticread
Return first function with body defined.   
bool cgraph_for_node_thunks_and_aliases ( struct cgraph_node node,
bool(*)(struct cgraph_node *, void *)  callback,
void *  data,
bool  include_overwritable 
)
enum availability cgraph_function_body_availability ( struct cgraph_node )
struct cgraph_node* cgraph_function_node ( struct cgraph_node ,
enum availability avail = NULL 
)
read
bool cgraph_function_possibly_inlined_p ( tree  )
struct cgraph_node* cgraph_function_versioning ( struct cgraph_node old_version_node,
vec< cgraph_edge_p redirect_callers,
vec< ipa_replace_map_p, va_gc > *  tree_map,
bitmap  args_to_skip,
bool  skip_return,
bitmap  bbs_to_copy,
basic_block  new_entry_block,
const char *  clone_name 
)
read
Perform function versioning.
   Function versioning includes copying of the tree and
   a callgraph update (creating a new cgraph node and updating
   its callees and callers).

   REDIRECT_CALLERS varray includes the edges to be redirected
   to the new version.

   TREE_MAP is a mapping of tree nodes we want to replace with
   new ones (according to results of prior analysis).
   OLD_VERSION_NODE is the node that is versioned.

   If non-NULL ARGS_TO_SKIP determine function parameters to remove
   from new version.
   If SKIP_RETURN is true, the new version will return void.
   If non-NULL BLOCK_TO_COPY determine what basic blocks to copy.
   If non_NULL NEW_ENTRY determine new entry BB of the clone.

   Return the new version's cgraph node.   

References build_function_decl_skip_args(), cgraph_local_info::can_change_signature, cgraph_call_function_insertion_hooks(), cgraph_copy_node_for_versioning(), clone_function_name(), copy_node(), symtab_node_base::decl, symtab_node_base::externally_visible, cgraph_local_info::local, cgraph_node::local, cgraph_node::lowered, cgraph_node::symbol, symtab_make_decl_local(), tree_function_versioning(), tree_versionable_function_p(), symtab_node_base::unique_name, and update_call_expr().

Referenced by modify_function(), and split_function().

static bool cgraph_function_with_gimple_body_p ( )
inlinestatic
Return true when NODE is a function with Gimple body defined
   in current unit.  Functions can also be define externally or they
   can be thunks with no Gimple representation.

   Note that at WPA stage, the function body may not be present in memory.   

Referenced by do_per_function_toporder(), function_called_by_processed_nodes_p(), init_node_map(), initialize_node_lattices(), inline_small_functions(), ipa_prop_write_all_agg_replacement(), ipa_prop_write_jump_functions(), ipa_pta_execute(), ipa_write_summaries(), ipcp_cloning_candidate_p(), ipcp_decision_stage(), ipcp_propagate_stage(), propagate_constants_accross_call(), propagate_constants_topo(), and symtab_remove_unreachable_nodes().

bool cgraph_get_body ( struct cgraph_node node)
struct cgraph_node* cgraph_get_create_node ( tree  )
read
struct cgraph_node* cgraph_get_create_real_symbol_node ( tree  )
read
static struct cgraph_node* cgraph_get_node ( )
staticread
Return callgraph node for given symbol and check it is a function.  

Referenced by analyze_function(), analyze_functions(), apply_ipa_transforms(), build_cgraph_edges(), call_may_clobber_ref_p_1(), can_refer_decl_in_current_unit_p(), cgraph_add_thunk(), cgraph_clone_edge(), cgraph_get_create_node(), cgraph_get_create_real_symbol_node(), cgraph_global_info(), cgraph_local_info(), cgraph_rebuild_references(), cgraph_redirect_edge_call_stmt_to_callee(), cgraph_remove_node(), cgraph_rtl_info(), cgraph_same_body_alias(), cgraph_set_call_stmt(), cgraph_update_edges_for_call_stmt(), check_for_nested_with_variably_modified(), computation_cost(), compute_function_frequency(), compute_inline_parameters_for_current(), compute_ltrans_boundary(), copy_bb(), create_task_copyfn(), decide_function_section(), decl_binds_to_current_def_p(), default_binds_local_p_1(), delete_function_version(), devirtualization_time_bonus(), dump_function_header(), dump_tm_clone_pairs(), early_inliner(), estimate_edge_devirt_benefit(), estimate_num_insns(), execute_all_ipa_transforms(), execute_fixup_cfg(), execute_split_functions(), expand_call_tm(), expand_function(), free_lang_data_in_decl(), function_called_by_processed_nodes_p(), function_section_1(), gimple_gen_ic_func_profiler(), gimplify_body(), handle_alias_pairs(), ipa_early_sra(), ipa_make_edge_direct_to_target(), ipa_modify_call_arguments(), ipa_tm_decrement_clone_counts(), ipa_tm_execute(), ipa_tm_insert_gettmclone_call(), ipa_tm_mayenterirr_function(), ipa_tm_scan_calls_block(), ipa_tm_scan_irr_block(), is_pass_explicitly_enabled_or_disabled(), local_pure_const(), lower_nested_functions(), lto_read_body(), lto_symtab_merge_symbols(), maybe_hot_frequency_p(), maybe_record_node(), need_assembler_name_p(), new_omp_context(), optimize_function_for_size_p(), optimize_inline_calls(), probably_never_executed_bb_p(), propagate_controlled_uses(), rebuild_cgraph_edges(), record_cdtor_fn(), ref_maybe_used_by_call_p_1(), reference_to_unused(), remove_cgraph_callee_edges(), save_inline_function_body(), scan_function(), set_nothrow_function_flags(), split_function(), tree_could_trap_p(), tree_function_versioning(), unnest_nesting_tree_1(), unshare_body(), unvisit_body(), update_call_edge_frequencies(), verify_edge_corresponds_to_fndecl(), and write_symbol().

const char* cgraph_inline_failed_string ( cgraph_inline_failed_t  )
struct cgraph_edge* cgraph_make_edge_direct ( struct cgraph_edge ,
struct cgraph_node  
)
read
void cgraph_make_node_local ( struct cgraph_node )
void cgraph_mark_address_taken_node ( struct cgraph_node )
static void cgraph_mark_force_output_node ( )
inlinestatic
Likewise indicate that a node is needed, i.e. reachable via some
   external means.   

Referenced by ipa_tm_mark_force_output_node(), lto_cgraph_replace_node(), mark_decl_referenced(), and process_function_and_variable_attributes().

void cgraph_materialize_all_clones ( void  )
static struct cgraph_node* cgraph_next_defined_function ( )
staticread
Return next function with body defined after NODE.   
static struct cgraph_node* cgraph_next_function ( )
staticread
static struct cgraph_node* cgraph_next_function_with_gimple_body ( )
staticread
Return next reachable static variable with initializer after NODE.   
static const char* cgraph_node_asm_name ( )
inlinestatic
bool cgraph_node_can_be_local_p ( struct cgraph_node )
bool cgraph_node_cannot_return ( struct cgraph_node )
struct cgraph_node* cgraph_node_for_asm ( tree  )
read
static bool cgraph_node_in_set_p ( )
inlinestatic
Return true if SET contains NODE.   
static const char* cgraph_node_name ( )
inlinestatic
Return name of cgraph node.   

Referenced by analyze_function(), cgraph_get_create_real_symbol_node(), cgraph_materialize_all_clones(), cgraph_propagate_frequency(), cgraph_propagate_frequency_1(), cgraph_redirect_edge_call_stmt_to_callee(), cgraph_resolve_speculation(), cgraph_turn_edge_to_speculative(), check_ic_target(), convert_callers_for_node(), copy_bb(), create_specialized_node(), decide_about_value(), decide_whether_version_node(), determine_versionability(), dump_cgraph_node(), dump_cgraph_node_set(), dump_inline_edge_summary(), dump_inline_summary(), dump_possible_polymorphic_call_targets(), dump_profile_updates(), early_inline_small_functions(), early_inliner(), edge_badness(), estimate_function_body_sizes(), estimate_local_effects(), estimate_node_size_and_time(), flatten_function(), function_and_variable_visibility(), identify_dead_nodes(), init_node_map(), initialize_node_lattices(), inline_always_inline_functions(), inline_analyze_function(), inline_small_functions(), ipa_inline(), ipa_make_edge_direct_to_target(), ipa_print_node_jump_functions(), ipa_print_node_params(), ipa_profile(), ipa_pta_execute(), ipcp_cloning_candidate_p(), ipcp_transform_function(), lto_cgraph_replace_node(), perhaps_add_new_callers(), print_all_lattices(), propagate_controlled_uses(), propagate_nothrow(), propagate_pure_const(), pure_const_read_summary(), recursive_inlining(), remove_described_reference(), report_inline_failed_reason(), save_inline_function_body(), symtab_remove_unreachable_nodes(), update_edge_key(), update_profiling_info(), verify_cgraph_node(), and want_early_inline_function_p().

void cgraph_node_remove_callees ( struct cgraph_node node)
void cgraph_node_set_add ( cgraph_node_set  ,
struct cgraph_node  
)

Referenced by cgraph_add_new_function().

cgraph_node_set_iterator cgraph_node_set_find ( cgraph_node_set  ,
struct cgraph_node  
)
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().

static bool cgraph_node_set_nonempty_p ( )
inlinestatic
Return true if set is nonempty.   
void cgraph_node_set_remove ( cgraph_node_set  ,
struct cgraph_node  
)
static size_t cgraph_node_set_size ( )
inlinestatic
Return number of nodes in SET.   
static bool cgraph_only_called_directly_or_aliased_p ( )
inlinestatic
Return true when function NODE is only called directly or it has alias.
   i.e. it is not externally visible, address was not taken and
   it is not used in any other non-standard way.   

Referenced by cgraph_non_local_node_p_1(), and cgraph_not_only_called_directly_p_1().

bool cgraph_only_called_directly_p ( struct cgraph_node )
bool cgraph_optimize_for_size_p ( struct cgraph_node )
void cgraph_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.  Consequentely we
   first produce aliases without links, but once C++ FE is sure he won't sream
   PCH we build the links via this function.   

References cgraph_get_create_node(), cpp_implicit_aliases_done, symtab_resolve_alias(), and varpool_node_for_decl().

bool cgraph_propagate_frequency ( struct cgraph_node node)
void cgraph_rebuild_references ( void  )
gimple cgraph_redirect_edge_call_stmt_to_callee ( struct cgraph_edge )
void cgraph_redirect_edge_callee ( struct cgraph_edge ,
struct cgraph_node  
)
void cgraph_release_function_body ( struct cgraph_node )
void cgraph_remove_edge ( struct cgraph_edge )
void cgraph_remove_edge_duplication_hook ( struct cgraph_2edge_hook_list )
void cgraph_remove_edge_removal_hook ( struct cgraph_edge_hook_list )
void cgraph_remove_function_insertion_hook ( struct cgraph_node_hook_list )
void cgraph_remove_node ( struct cgraph_node )
void cgraph_remove_node_duplication_hook ( struct cgraph_2node_hook_list )
void cgraph_remove_node_removal_hook ( struct cgraph_node_hook_list )
void cgraph_reset_node ( struct cgraph_node )
struct cgraph_edge* cgraph_resolve_speculation ( struct cgraph_edge ,
tree   
)
read
struct cgraph_rtl_info* cgraph_rtl_info ( tree  )
read
struct cgraph_node* cgraph_same_body_alias ( struct cgraph_node ,
tree  ,
tree   
)
read
void cgraph_set_call_stmt_including_clones ( struct cgraph_node orig,
gimple  old_stmt,
gimple  new_stmt,
bool  update_speculative 
)
Like cgraph_set_call_stmt but walk the clone tree and update all
   clones sharing the same function body.  
   When WHOLE_SPECULATIVE_EDGES is true, all three components of
   speculative edge gets updated.  Otherwise we update only direct
   call.   

References cgraph_edge(), cgraph_set_call_stmt(), cgraph_speculative_call_info(), cgraph_node::clone_of, cgraph_node::clones, cgraph_edge::indirect_unknown_callee, cgraph_node::next_sibling_clone, ipa_ref::speculative, and cgraph_edge::speculative.

Referenced by cgraph_redirect_edge_call_stmt_to_callee(), and copy_bb().

void cgraph_set_const_flag ( struct cgraph_node ,
bool  ,
bool   
)
void cgraph_set_nothrow_flag ( struct cgraph_node ,
bool   
)
void cgraph_set_pure_flag ( struct cgraph_node ,
bool  ,
bool   
)
void cgraph_speculative_call_info ( struct cgraph_edge e,
struct cgraph_edge *&  direct,
struct cgraph_edge *&  indirect,
struct ipa_ref *&  reference 
)
Speculative call consist of three components:
   1) an indirect edge representing the original call
   2) an direct edge representing the new call
   3) ADDR_EXPR reference representing the speculative check.
   All three components are attached to single statement (the indirect
   call) and if one of them exists, all of them must exist.

   Given speculative call edge E, return all three components. 

References cgraph_edge::call_stmt, cgraph_node::callees, cgraph_edge::caller, cgraph_edge(), cgraph_node::indirect_calls, cgraph_edge::indirect_unknown_callee, ipa_ref::lto_stmt_uid, cgraph_edge::lto_stmt_uid, cgraph_edge::next_callee, symtab_node_base::ref_list, ipa_ref::speculative, cgraph_edge::speculative, ipa_ref::stmt, and cgraph_node::symbol.

Referenced by cgraph_redirect_edge_call_stmt_to_callee(), cgraph_resolve_speculation(), cgraph_set_call_stmt(), cgraph_set_call_stmt_including_clones(), copy_bb(), and speculation_useful_p().

struct cgraph_edge* cgraph_turn_edge_to_speculative ( struct cgraph_edge e,
struct cgraph_node n2,
gcov_type  direct_count,
int  direct_frequency 
)
read
Turn edge E into speculative call calling N2. Update
   the profile so the direct call is taken COUNT times
   with FREQUENCY.  

   At clone materialization time, the indirect call E will
   be expanded as:

   if (call_dest == N2)
     n2 ();
   else
     call call_dest

   At this time the function just creates the direct call,
   the referencd representing the if conditional and attaches
   them all to the orginal indirect call statement.  

   Return direct edge created.   

References cgraph_edge::call_stmt, cgraph_edge::caller, cgraph_edge::can_throw_external, cgraph_call_edge_duplication_hooks(), cgraph_create_edge(), cgraph_mark_address_taken_node(), cgraph_node_name(), cgraph_edge::count, symtab_node_base::decl, dump_file, cgraph_edge::frequency, initialize_inline_failed(), ipa_record_reference(), IPA_REF_ADDR, ipa_ref::lto_stmt_uid, cgraph_edge::lto_stmt_uid, symtab_node_base::order, ipa_ref::speculative, cgraph_edge::speculative, and cgraph_node::symbol.

Referenced by ipa_profile().

void cgraph_unnest_node ( struct cgraph_node )
void cgraph_update_edges_for_call_stmt ( gimple  ,
tree  ,
gimple   
)
enum availability cgraph_variable_initializer_availability ( struct varpool_node )
bool cgraph_will_be_removed_from_program_if_no_direct_calls ( struct cgraph_node node)
vec<cgraph_edge_p> collect_callers_of_node ( struct cgraph_node node)
htab_t constant_pool_htab ( void  )
Constant pool accessor function.   

References const_desc_htab.

Referenced by asan_finish_file().

static bool csi_end_p ( )
inlinestatic
Return true if iterator CSI points to nothing.   

Referenced by cgraph_process_new_functions(), and dump_cgraph_node_set().

static void csi_next ( )
inlinestatic
Advance iterator CSI.   

Referenced by cgraph_process_new_functions(), and dump_cgraph_node_set().

static struct cgraph_node* csi_node ( )
staticread
Return the node pointed to by CSI.   

Referenced by cgraph_process_new_functions(), and dump_cgraph_node_set().

static cgraph_node_set_iterator csi_start ( )
inlinestatic
Return an iterator to the first node in SET.   

Referenced by cgraph_process_new_functions(), and dump_cgraph_node_set().

void debug_cgraph ( void  )
Dump the call graph to stderr.   

References dump_cgraph().

void debug_cgraph_node ( struct cgraph_node )
void debug_cgraph_node_set ( cgraph_node_set  )
void debug_symtab ( void  )
Dump symbol table to stderr.   

References dump_symtab().

void debug_symtab_node ( symtab_node  )
void debug_varpool ( void  )
Dump the variable pool to stderr.   

References dump_varpool().

void debug_varpool_node_set ( varpool_node_set  )
static bool decl_is_tm_clone ( )
inlinestatic
void delete_function_version ( tree  decl)
Remove the cgraph_function_version_info and cgraph_node for DECL.  This
   DECL is a duplicate declaration.   
void dump_cgraph ( FILE *  )
In cgraph.c   
void dump_cgraph_node ( FILE *  ,
struct cgraph_node  
)
void dump_cgraph_node_set ( FILE *  ,
cgraph_node_set   
)

Referenced by debug_cgraph_node_set().

void dump_symtab ( FILE *  )
void dump_symtab_base ( FILE *  ,
symtab_node   
)
void dump_symtab_node ( FILE *  ,
symtab_node   
)
void dump_varpool ( FILE *  )

Referenced by debug_varpool().

void dump_varpool_node ( FILE *  ,
struct varpool_node  
)

Referenced by dump_symtab_node(), and dump_varpool().

void dump_varpool_node_set ( FILE *  ,
varpool_node_set   
)

Referenced by debug_varpool_node_set().

void expand_thunk ( struct cgraph_node )
void finalize_compilation_unit ( void  )
Analyze the whole compilation unit once it is parsed completely.   

References analyze_functions(), compile(), current_function_decl, dump_passes(), finalize_size_functions(), handle_alias_pairs(), set_cfun(), timevar_pop(), and timevar_push().

Referenced by write_global_declarations().

void fixup_same_cpp_alias_visibility ( symtab_node  node,
symtab_node  target 
)
void fixup_same_cpp_alias_visibility ( symtab_node  ,
symtab_node  target,
tree   
)
void free_cgraph_node_set ( cgraph_node_set  )
void free_varpool_node_set ( varpool_node_set  )

Referenced by ipa_lower_emutls().

struct cgraph_function_version_info* get_cgraph_node_version ( struct cgraph_node node)
read
Get the cgraph_function_version_info node corresponding to node.   
union GTY ( (desc("%h.symbol.type"), chain_next("%h.symbol.next"),chain_prev("%h.symbol.previous"))  )
write
Symbol table entry.   
void init_cgraph ( void  )
Initialize callgraph dump file.   

References cgraph_dump_file, dump_begin(), and TDI_cgraph.

Referenced by do_compile().

basic_block init_lowered_empty_function ( tree  ,
bool   
)
Initialize datastructures so DECL is a function in lowered gimple form.
    IN_SSA is true if the gimple is in SSA.   

Referenced by expand_thunk().

struct cgraph_function_version_info* insert_new_cgraph_node_version ( struct cgraph_node node)
read
Insert a new cgraph_function_version_info node into cgraph_fnver_htab
   corresponding to cgraph_node NODE.   
void ipa_discover_readonly_nonaddressable_vars ( void  )
Discover variables that have no longer address taken or that are read only
   and update their flags.

   FIXME: This can not be done in between gimplify and omp_expand since
   readonly flag plays role on what is shared and what is not.  Currently we do
   this transformation as part of whole program visibility and re-do at
   ipa-reference pass (to take into account clonning), but it would
   make sense to do it before early optimizations.   

References symtab_node_base::decl, symtab_node_base::definition, dump_file, IPA_REF_ADDR, IPA_REF_LOAD, IPA_REF_STORE, symtab_node_base::ref_list, varpool_node::symbol, varpool_all_refs_explicit_p(), and varpool_node_name().

Referenced by propagate(), and whole_program_function_and_variable_visibility().

void ipa_record_stmt_references ( struct cgraph_node ,
gimple   
)
void record_function_versions ( tree  decl1,
tree  decl2 
)
Record that DECL1 and DECL2 are semantically identical function
   versions.   
void record_references_in_initializer ( tree  ,
bool   
)
void release_function_body ( tree  )
bool resolution_used_from_other_file_p ( enum  ld_plugin_symbol_resolution)
void symtab_add_to_same_comdat_group ( symtab_node  new_node,
symtab_node  old_node 
)
Add NEW_ to the same comdat group that OLD is in.   

Referenced by fixup_same_cpp_alias_visibility().

static symtab_node symtab_alias_target ( )
inlinestatic
FIXME: inappropriate dependency of cgraph on IPA.   
Return node that alias N is aliasing.   

Referenced by analyze_functions(), compile(), output_weakrefs(), symtab_alias_ultimate_target(), and symtab_resolve_alias().

symtab_node symtab_alias_ultimate_target ( symtab_node  ,
enum availability avail = NULL 
)

Referenced by symtab_resolve_alias().

static bool symtab_can_be_discarded ( )
inlinestatic
Return true if NODE can be discarded by linker from the binary.   

Referenced by can_replace_by_local_alias(), and ipa_profile().

void symtab_dissolve_same_comdat_group_list ( symtab_node  node)
bool symtab_for_node_and_aliases ( symtab_node  node,
bool(*)(symtab_node, void *)  callback,
void *  data,
bool  include_overwritable 
)
Call calback on NODE and aliases associated to NODE. 
   When INCLUDE_OVERWRITABLE is false, overwritable aliases and thunks are
   skipped.  

References AVAIL_OVERWRITABLE, IPA_REF_ALIAS, ipa_ref::referring, symtab_for_node_and_aliases(), and symtab_node_availability().

Referenced by symtab_for_node_and_aliases(), and symtab_nonoverwritable_alias().

void symtab_initialize_asm_name_hash ( void  )
void symtab_insert_node_to_hashtable ( symtab_node  )
const char* symtab_node_name ( symtab_node  )
symtab_node symtab_nonoverwritable_alias ( symtab_node  )
void symtab_prevail_in_asm_name_hash ( symtab_node  node)
static bool symtab_real_symbol_p ( )
inlinestatic
Return true when the symbol is real symbol, i.e. it is not inline clone
   or abstract function kept for debug info purposes only.   

Referenced by build_type_inheritance_graph(), lto_symtab_symbol_p(), maybe_record_node(), output_symbol_p(), and update_type_inheritance_graph().

void symtab_register_node ( symtab_node  )
void symtab_remove_node ( symtab_node  )

Referenced by analyze_functions().

bool symtab_remove_unreachable_nodes ( bool  ,
FILE *   
)
void symtab_unregister_node ( symtab_node  )
void tree_function_versioning ( tree  old_decl,
tree  new_decl,
vec< ipa_replace_map_p, va_gc > *  tree_map,
bool  update_clones,
bitmap  args_to_skip,
bool  skip_return,
bitmap  blocks_to_copy,
basic_block  new_entry 
)
Create a copy of a function's tree.
   OLD_DECL and NEW_DECL are FUNCTION_DECL tree nodes
   of the original function and the new copied function
   respectively.  In case we want to replace a DECL
   tree with another tree while duplicating the function's
   body, TREE_MAP represents the mapping between these
   trees. If UPDATE_CLONES is set, the call_stmt fields
   of edges of clones of the function will be updated.  

   If non-NULL ARGS_TO_SKIP determine function parameters to remove
   from new version.
   If SKIP_RETURN is true, the new version will return void.
   If non-NULL BLOCK_TO_COPY determine what basic blocks to copy.
   If non_NULL NEW_ENTRY determine new entry BB of the clone.

References add_local_variables(), cgraph_edge::call_stmt, cgraph_node::callees, CB_CGE_MOVE, CB_CGE_MOVE_CLONES, CDI_DOMINATORS, CDI_POST_DOMINATORS, cfun, cgraph_get_node(), cgraph_rebuild_references(), compute_call_stmt_bb_frequency(), copy_arguments_for_versioning(), copy_body(), copy_decl_no_change(), copy_static_chain(), basic_block_def::count, cgraph_node::count, cgraph_edge::count, function::curr_properties, current_function_decl, debug_hooks, decl_debug_args_insert(), decl_debug_args_lookup(), declare_inline_vars(), delete_unreachable_blocks_update_callgraph(), dump_file, lang_hooks::dup_lang_specific_decl, fold_cond_expr_cond(), fold_convertible_p(), fold_marked_statements(), free_dominance_info(), cgraph_edge::frequency, gimple_bb(), gimple_build_nop(), gimple_in_ssa_p(), cgraph_node::indirect_calls, walk_stmt_info::info, initialize_cfun(), insert_decl_map(), insert_init_stmt(), loop_optimizer_init(), loops_for_fn(), make_ssa_name(), memset(), ipa_replace_map::new_tree, cgraph_edge::next_callee, function::nonlocal_goto_save_area, number_blocks(), ipa_replace_map::old_tree, gcc_debug_hooks::outlining_inline_function, ipa_replace_map::parm_num, pointer_map_create(), pointer_map_destroy(), pointer_set_create(), pointer_set_destroy(), pop_cfun(), print_generic_expr(), rebuild_frequencies(), remap_blocks(), remap_decl(), remap_gimple_op_r(), ipa_replace_map::replace_p, function::returns_pcc_struct, function::returns_struct, set_ssa_default_def(), setup_one_parameter(), single_succ_edge(), split_edge(), ssa_default_def(), update_clone_info(), update_ssa(), cgraph_node::used_as_abstract_origin, useless_type_conversion_p(), vec_safe_copy(), and vec_safe_is_empty().

Referenced by cgraph_function_versioning(), cgraph_materialize_clone(), ipa_tm_create_version(), and save_inline_function_body().

static struct varpool_node* varpool ( )
staticread
Return varpool node for given symbol and check it is a variable.   

Referenced by ipa_ref_referring_varpool_node(), ipa_ref_varpool_node(), lsei_varpool_node(), lto_symtab_merge_symbols_1(), output_symtab(), and symtab_node_availability().

void varpool_add_new_variable ( tree  )
static struct varpool_node* varpool_alias_target ( )
staticread
static bool varpool_all_refs_explicit_p ( )
inlinestatic
Return true when all references to VNODE must be visible in ipa_ref_list.
   i.e. if the variable is not externally visible or not used in some magic
   way (asm statement or such).
   The magic uses are all summarized in force_output flag.   

Referenced by create_variable_info_for(), and ipa_discover_readonly_nonaddressable_vars().

void varpool_analyze_node ( struct varpool_node )
bool varpool_assemble_decl ( struct varpool_node node)
static bool varpool_can_remove_if_no_refs ( )
inlinestatic
Return true when function NODE can be removed from callgraph
   if all direct calls are eliminated.   

Referenced by symtab_remove_unreachable_nodes(), and varpool_remove_unreferenced_decls().

struct varpool_node* varpool_create_empty_node ( void  )
read
In varpool.c   
@verbatim Callgraph handling code.

Copyright (C) 2003-2013 Free Software Foundation, Inc. Contributed by Jan Hubicka

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/.

Allocate new callgraph node and insert it into basic data structures.   

References varpool_node::symbol, and SYMTAB_VARIABLE.

Referenced by input_varpool_node(), and varpool_node_for_decl().

struct varpool_node* varpool_create_variable_alias ( tree  ,
tree   
)
read
bool varpool_externally_visible_p ( struct varpool_node )
struct varpool_node* varpool_extra_name_alias ( tree  ,
tree   
)
read
void varpool_finalize_named_section_flags ( struct varpool_node node)
static struct varpool_node* varpool_first_defined_variable ( )
staticread
Return first reachable static variable with initializer.   

Referenced by varpool_remove_unreferenced_decls().

static struct varpool_node* varpool_first_static_initializer ( )
staticread
Return first reachable static variable with initializer.   
static struct varpool_node* varpool_first_variable ( )
staticread
bool varpool_for_node_and_aliases ( struct varpool_node node,
bool(*)(struct varpool_node *, void *)  callback,
void *  data,
bool  include_overwritable 
)
Call calback on NODE and aliases associated to NODE. 
   When INCLUDE_OVERWRITABLE is false, overwritable aliases and thunks are
   skipped.  

References AVAIL_OVERWRITABLE, cgraph_variable_initializer_availability(), IPA_REF_ALIAS, ipa_ref_referring_varpool_node(), symtab_node_base::ref_list, varpool_node::symbol, and varpool_for_node_and_aliases().

Referenced by ipa_lower_emutls(), and varpool_for_node_and_aliases().

void varpool_mark_needed_node ( struct varpool_node )
static struct varpool_node* varpool_next_defined_variable ( )
staticread
Return next reachable static variable with initializer after NODE.   

Referenced by varpool_remove_unreferenced_decls().

static struct varpool_node* varpool_next_static_initializer ( )
staticread
Return next reachable static variable with initializer after NODE.   
static struct varpool_node* varpool_next_variable ( )
staticread
Return next variable after NODE.   

Referenced by process_function_and_variable_attributes(), and symtab_remove_unreachable_nodes().

static const char* varpool_node_asm_name ( )
inlinestatic
Return asm name of varpool node.   

Referenced by varpool_remove_unreferenced_decls().

struct varpool_node* varpool_node_for_asm ( tree  asmname)
read

Referenced by new_emutls_decl().

static bool varpool_node_in_set_p ( )
inlinestatic
Return true if SET contains NODE.   
static const char* varpool_node_name ( )
inlinestatic
void varpool_node_set_add ( varpool_node_set  ,
struct varpool_node  
)

Referenced by ipa_lower_emutls().

varpool_node_set_iterator varpool_node_set_find ( varpool_node_set  ,
struct varpool_node  
)

Referenced by emutls_index().

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().

static bool varpool_node_set_nonempty_p ( )
inlinestatic
Return true if set is nonempty.   
void varpool_node_set_remove ( varpool_node_set  ,
struct varpool_node  
)
static size_t varpool_node_set_size ( )
inlinestatic
Return number of nodes in SET.   
bool varpool_output_variables ( void  )
void varpool_remove_initializer ( struct varpool_node )
void varpool_reset_queue ( void  )
static struct varpool_node* varpool_variable_node ( struct varpool_node node,
enum availability availability = NULL 
)
staticread
Given NODE, walk the alias chain to return the function NODE is alias of.
   Do not walk through thunks.
   When AVAILABILITY is non-NULL, get minimal availability in the chain.   

Referenced by ctor_for_folding(), get_constraint_for_ssa_var(), ipa_lower_emutls(), and tree_could_trap_p().

void verify_cgraph ( void  )
Verify whole cgraph structure.   

References seen_error(), and verify_cgraph_node().

Referenced by cgraph_materialize_all_clones(), and ipa_tm_execute().

void verify_cgraph_node ( struct cgraph_node )
void verify_symtab ( void  )
Verify symbol table for internal consistency.   

References verify_symtab_node().

Referenced by compile(), and symtab_remove_unreachable_nodes().

bool verify_symtab_base ( symtab_node  )
void verify_symtab_node ( symtab_node  )

Referenced by verify_symtab().

static bool vsi_end_p ( )
inlinestatic
Return true if iterator VSI points to nothing.   

Referenced by dump_varpool_node_set().

static void vsi_next ( )
inlinestatic
Advance iterator VSI.   

Referenced by dump_varpool_node_set().

static struct varpool_node* vsi_node ( )
staticread
Return the node pointed to by VSI.   

Referenced by dump_varpool_node_set().

static varpool_node_set_iterator vsi_start ( )
inlinestatic
Return an iterator to the first node in SET.   

Referenced by dump_varpool_node_set().


Variable Documentation

struct asm_node* asm_nodes
Linked list of cgraph asm nodes.   

Referenced by lto_output_toplevel_asms().

const char* const cgraph_availability_names[]
Names used to print out the availability enum.   

Referenced by dump_varpool_node().

bool cgraph_function_flags_ready
cgraph_node_set cgraph_new_nodes
@verbatim Driver of optimization process

Copyright (C) 2003-2013 Free Software Foundation, Inc. Contributed by Jan Hubicka

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/.

This module implements main driver of compilation process.

   The main scope of this file is to act as an interface in between
   tree based frontends and the backend.

   The front-end is supposed to use following functionality:

    - cgraph_finalize_function

      This function is called once front-end has parsed whole body of function
      and it is certain that the function body nor the declaration will change.

      (There is one exception needed for implementing GCC extern inline
        function.)

    - varpool_finalize_decl

      This function has same behavior as the above but is used for static
      variables.

    - add_asm_node

      Insert new toplevel ASM statement

    - finalize_compilation_unit

      This function is called once (source level) compilation unit is finalized
      and it will no longer change.

      The symbol table is constructed starting from the trivially needed
      symbols finalized by the frontend.  Functions are lowered into
      GIMPLE representation and callgraph/reference lists are constructed.
      Those are used to discover other necessary functions and variables.

      At the end the bodies of unreachable functions are removed.

      The function can be called multiple times when multiple source level
      compilation units are combined.

    - compile

      This passes control to the back-end.  Optimizations are performed and
      final assembler is generated.  This is done in the following way. Note
      that with link time optimization the process is split into three
      stages (compile time, linktime analysis and parallel linktime as
      indicated bellow).

      Compile time:

        1) Inter-procedural optimization.
           (ipa_passes)

           This part is further split into:

           a) early optimizations. These are local passes executed in
              the topological order on the callgraph.

              The purpose of early optimiations is to optimize away simple
              things that may otherwise confuse IP analysis. Very simple
              propagation across the callgraph is done i.e. to discover
              functions without side effects and simple inlining is performed.

           b) early small interprocedural passes.

              Those are interprocedural passes executed only at compilation
              time.  These include, for example, transational memory lowering,
              unreachable code removal and other simple transformations.

           c) IP analysis stage.  All interprocedural passes do their
              analysis.

              Interprocedural passes differ from small interprocedural
              passes by their ability to operate across whole program
              at linktime.  Their analysis stage is performed early to
              both reduce linking times and linktime memory usage by    
              not having to represent whole program in memory.

           d) LTO sreaming.  When doing LTO, everything important gets
              streamed into the object file.

       Compile time and or linktime analysis stage (WPA):

              At linktime units gets streamed back and symbol table is
              merged.  Function bodies are not streamed in and not
              available.
           e) IP propagation stage.  All IP passes execute their
              IP propagation. This is done based on the earlier analysis
              without having function bodies at hand.
           f) Ltrans streaming.  When doing WHOPR LTO, the program
              is partitioned and streamed into multple object files.

       Compile time and/or parallel linktime stage (ltrans)

              Each of the object files is streamed back and compiled
              separately.  Now the function bodies becomes available
              again.

         2) Virtual clone materialization
            (cgraph_materialize_clone)

            IP passes can produce copies of existing functoins (such
            as versioned clones or inline clones) without actually
            manipulating their bodies by creating virtual clones in
            the callgraph. At this time the virtual clones are
            turned into real functions
         3) IP transformation

            All IP passes transform function bodies based on earlier
            decision of the IP propagation.

         4) late small IP passes

            Simple IP passes working within single program partition.

         5) Expansion
            (expand_all_functions)

            At this stage functions that needs to be output into
            assembler are identified and compiled in topological order
         6) Output of variables and aliases
            Now it is known what variable references was not optimized
            out and thus all variables are output to the file.

            Note that with -fno-toplevel-reorder passes 5 and 6
            are combined together in cgraph_output_in_order.  

   Finally there are functions to manipulate the callgraph from
   backend.
    - cgraph_add_new_function is used to add backend produced
      functions introduced after the unit is finalized.
      The functions are enqueue for later processing and inserted
      into callgraph with cgraph_process_new_functions.

    - cgraph_function_versioning

      produces a copy of function into new one (a version)
      and apply simple transformations
Queue of cgraph nodes scheduled to be added into cgraph.  This is a
   secondary queue used during optimization to accommodate passes that
   may generate new functions that need to be optimized and expanded.   

Referenced by can_remove_node_now_p_1().

What state callgraph is in right now.   
bool cpp_implicit_aliases_done
const char* const ld_plugin_symbol_resolution_names[]
@verbatim Symbol table.

Copyright (C) 2012-2013 Free Software Foundation, Inc. Contributed by Jan Hubicka

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/.

Referenced by dump_symtab_base().

symtab_node symtab_nodes
Linked list of symbol table nodes.   

Referenced by analyze_functions(), symtab_register_node(), and symtab_unregister_node().

int symtab_order
The order index of the next symtab node to be created.  This is
   used so that we can sort the cgraph nodes in order by when we saw
   them, to support -fno-toplevel-reorder.   

Referenced by add_asm_node(), input_cgraph_1(), input_node(), input_varpool_node(), lto_input_toplevel_asms(), output_in_order(), and symtab_register_node().