GCC Middle and Back End API Reference
lto-cgraph.c File Reference

Enumerations

enum  LTO_symtab_tags {
  LTO_symtab_unavail_node = 1, LTO_symtab_analyzed_node, LTO_symtab_edge, LTO_symtab_indirect_edge,
  LTO_symtab_variable, LTO_symtab_last_tag
}

Functions

static void output_cgraph_opt_summary (void)
static void input_cgraph_opt_summary (vec< symtab_node > nodes)
lto_symtab_encoder_t lto_symtab_encoder_new ()
void lto_symtab_encoder_delete ()
int lto_symtab_encoder_encode (lto_symtab_encoder_t encoder, symtab_node node)
bool lto_symtab_encoder_delete_node (lto_symtab_encoder_t encoder, symtab_node node)
bool lto_symtab_encoder_encode_body_p (lto_symtab_encoder_t encoder, struct cgraph_node *node)
static void lto_set_symtab_encoder_encode_body (lto_symtab_encoder_t encoder, struct cgraph_node *node)
bool lto_symtab_encoder_encode_initializer_p (lto_symtab_encoder_t encoder, struct varpool_node *node)
static void lto_set_symtab_encoder_encode_initializer (lto_symtab_encoder_t encoder, struct varpool_node *node)
bool lto_symtab_encoder_in_partition_p (lto_symtab_encoder_t encoder, symtab_node node)
void lto_set_symtab_encoder_in_partition (lto_symtab_encoder_t encoder, symtab_node node)
static void lto_output_edge (struct lto_simple_output_block *ob, struct cgraph_edge *edge, lto_symtab_encoder_t encoder)
bool referenced_from_other_partition_p ()
bool reachable_from_other_partition_p ()
bool referenced_from_this_partition_p (struct ipa_ref_list *list, lto_symtab_encoder_t encoder)
bool reachable_from_this_partition_p ()
static void lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node, lto_symtab_encoder_t encoder)
static void lto_output_varpool_node (struct lto_simple_output_block *ob, struct varpool_node *node, lto_symtab_encoder_t encoder)
static void lto_output_ref (struct lto_simple_output_block *ob, struct ipa_ref *ref, lto_symtab_encoder_t encoder)
static void output_profile_summary ()
static void output_outgoing_cgraph_edges (struct cgraph_edge *edge, struct lto_simple_output_block *ob, lto_symtab_encoder_t encoder)
static void output_refs ()
static void add_node_to (lto_symtab_encoder_t encoder, struct cgraph_node *node, bool include_body)
static void add_references (lto_symtab_encoder_t encoder, struct ipa_ref_list *list)
lto_symtab_encoder_t compute_ltrans_boundary ()
void output_symtab ()
static void input_overwrite_node (struct lto_file_decl_data *file_data, struct cgraph_node *node, enum LTO_symtab_tags tag, struct bitpack_d *bp)
static tree get_alias_symbol ()
static struct cgraph_nodeinput_node (struct lto_file_decl_data *file_data, struct lto_input_block *ib, enum LTO_symtab_tags tag, vec< symtab_node > nodes)
static struct varpool_nodeinput_varpool_node (struct lto_file_decl_data *file_data, struct lto_input_block *ib)
static void input_ref (struct lto_input_block *ib, symtab_node referring_node, vec< symtab_node > nodes)
static void input_edge (struct lto_input_block *ib, vec< symtab_node > nodes, bool indirect)
static vec< symtab_nodeinput_cgraph_1 (struct lto_file_decl_data *file_data, struct lto_input_block *ib)
static void input_refs (struct lto_input_block *ib, vec< symtab_node > nodes)
static void input_profile_summary (struct lto_input_block *ib, struct lto_file_decl_data *file_data)
static void merge_profile_summaries ()
void input_symtab ()
static int output_cgraph_opt_summary_p ()
static void output_edge_opt_summary (struct output_block *ob, struct cgraph_edge *edge)
static void output_node_opt_summary (struct output_block *ob, struct cgraph_node *node, lto_symtab_encoder_t encoder)
static void input_edge_opt_summary (struct cgraph_edge *edge, struct lto_input_block *ib_main)
static void input_node_opt_summary (struct cgraph_node *node, struct lto_input_block *ib_main, struct data_in *data_in)
static void input_cgraph_opt_section (struct lto_file_decl_data *file_data, const char *data, size_t len, vec< symtab_node > nodes)
static void input_cgraph_opt_summary ()

Variables

static int order_base
static struct gcov_ctr_summary lto_gcov_summary

Enumeration Type Documentation

Cgraph streaming is organized as set of record whose type
   is indicated by a tag.   
Enumerator:
LTO_symtab_unavail_node 
LTO_symtab_analyzed_node 
LTO_symtab_edge 
LTO_symtab_indirect_edge 
LTO_symtab_variable 
LTO_symtab_last_tag 

Function Documentation

static void add_node_to ( lto_symtab_encoder_t  encoder,
struct cgraph_node node,
bool  include_body 
)
static
Add NODE into encoder as well as nodes it is cloned from.
   Do it in a way so clones appear first.   

References cgraph_node::clone_of, lto_set_symtab_encoder_encode_body(), and lto_symtab_encoder_encode().

Referenced by add_references(), and compute_ltrans_boundary().

static void add_references ( lto_symtab_encoder_t  encoder,
struct ipa_ref_list list 
)
static
Add all references in LIST to encoders.   

References add_node_to(), ipa_ref_node(), lto_symtab_encoder_encode(), and ipa_ref::referred.

Referenced by compute_ltrans_boundary().

lto_symtab_encoder_t compute_ltrans_boundary ( )
static tree get_alias_symbol ( )
static
Return string alias is alias of.   

References get_identifier(), and lookup_attribute().

Referenced by input_node(), and input_varpool_node().

static void input_cgraph_opt_section ( struct lto_file_decl_data file_data,
const char *  data,
size_t  len,
vec< symtab_node nodes 
)
static
static void input_cgraph_opt_summary ( vec< symtab_node nodes)
static

Referenced by input_symtab().

static void input_cgraph_opt_summary ( )
static
static void input_edge_opt_summary ( struct cgraph_edge edge,
struct lto_input_block ib_main 
)
static
Input optimisation summary of EDGE.   

Referenced by input_node_opt_summary().

static void input_ref ( struct lto_input_block ib,
symtab_node  referring_node,
vec< symtab_node nodes 
)
static
Read a node from input_block IB.  TAG is the node's tag just read.
   Return the node read or overwriten.   

References bp_unpack_value(), ipa_record_reference(), ipa_ref::lto_stmt_uid, ipa_ref::speculative, streamer_read_bitpack(), and streamer_read_hwi().

Referenced by input_refs().

static void input_refs ( struct lto_input_block ib,
vec< symtab_node nodes 
)
static
Input ipa_refs.   

References count, input_ref(), and streamer_read_uhwi().

Referenced by input_symtab().

static struct varpool_node* input_varpool_node ( struct lto_file_decl_data file_data,
struct lto_input_block ib 
)
staticread
Read a node from input_block IB.  TAG is the node's tag just read.
   Return the node read or overwriten.   

References bp_unpack_value(), symtab_node_base::decl, get_alias_symbol(), order, order_base, streamer_read_bitpack(), streamer_read_hwi(), streamer_read_uhwi(), varpool_node::symbol, symtab_order, symtab_register_node(), and varpool_create_empty_node().

Referenced by input_cgraph_1().

static void lto_output_node ( struct lto_simple_output_block ob,
struct cgraph_node node,
lto_symtab_encoder_t  encoder 
)
static
Output the cgraph NODE to OB.  ENCODER is used to find the
   reference number of NODE->inlined_to.  SET is the set of nodes we
   are writing to the current file.  If NODE is not in SET, then NODE
   is a boundary of a cgraph_node_set and we pretend NODE just has a
   decl and no callees.  WRITTEN_DECLS is the set of FUNCTION_DECLs
   that have had their callgraph node written so far.  This is used to
   determine if NODE is a clone of a previously written node.   

References bitpack_create(), bp_pack_value(), cgraph_node::clone_of, lto_simple_output_block::decl_state, lto_output_fn_decl_index(), LTO_symtab_analyzed_node, lto_symtab_encoder_encode_body_p(), lto_symtab_encoder_in_partition_p(), lto_symtab_encoder_lookup(), LTO_symtab_last_tag, LTO_symtab_unavail_node, lto_simple_output_block::main_stream, cgraph_node::prev_sibling_clone, reachable_from_other_partition_p(), referenced_from_other_partition_p(), opt_pass::static_pass_number, streamer_write_bitpack(), streamer_write_gcov_count_stream(), streamer_write_hwi_stream(), and streamer_write_uhwi_stream().

Referenced by output_symtab().

static void lto_output_ref ( struct lto_simple_output_block ob,
struct ipa_ref ref,
lto_symtab_encoder_t  encoder 
)
static
static void lto_set_symtab_encoder_encode_body ( lto_symtab_encoder_t  encoder,
struct cgraph_node node 
)
static
Return TRUE if we should encode body of NODE (if any).   

References lto_symtab_encoder_encode(), and lto_symtab_encoder_d::nodes.

Referenced by add_node_to().

static void lto_set_symtab_encoder_encode_initializer ( lto_symtab_encoder_t  encoder,
struct varpool_node node 
)
static
Return TRUE if we should encode initializer of NODE (if any).   

References lto_symtab_encoder_lookup(), and lto_symtab_encoder_d::nodes.

Referenced by compute_ltrans_boundary().

void lto_set_symtab_encoder_in_partition ( lto_symtab_encoder_t  encoder,
symtab_node  node 
)
Return TRUE if we should encode body of NODE (if any).   

References lto_symtab_encoder_encode(), and lto_symtab_encoder_d::nodes.

Referenced by compute_ltrans_boundary(), and ipa_write_summaries().

void lto_symtab_encoder_delete ( )
bool lto_symtab_encoder_delete_node ( lto_symtab_encoder_t  encoder,
symtab_node  node 
)
int lto_symtab_encoder_encode ( lto_symtab_encoder_t  encoder,
symtab_node  node 
)
bool lto_symtab_encoder_encode_body_p ( lto_symtab_encoder_t  encoder,
struct cgraph_node node 
)
Return TRUE if we should encode initializer of NODE (if any).   

References lto_symtab_encoder_lookup(), and lto_symtab_encoder_d::nodes.

Referenced by lto_output(), and lto_output_node().

bool lto_symtab_encoder_encode_initializer_p ( lto_symtab_encoder_t  encoder,
struct varpool_node node 
)
Return TRUE if we should encode initializer of NODE (if any).   

References lto_symtab_encoder_lookup(), and lto_symtab_encoder_d::nodes.

Referenced by compute_ltrans_boundary(), and get_symbol_initial_value().

lto_symtab_encoder_t lto_symtab_encoder_new ( )
Create a new symtab encoder.
   if FOR_INPUT, the encoder allocate only datastructures needed
   to read the symtab.   

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

Referenced by compute_ltrans_boundary(), input_symtab(), and ipa_write_summaries().

static void output_cgraph_opt_summary ( void  )
static
@verbatim Write and read the cgraph to the memory mapped representation of a

.o file.

Copyright (C) 2009-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/.

Output optimization summaries stored in callgraph.
   At the moment it is the clone info structure.   

References output_block::cgraph_node, count, create_output_block(), output_block::decl_state, destroy_output_block(), dyn_cast(), LTO_section_cgraph_opt_sum, lto_symtab_encoder_deref(), lto_symtab_encoder_size(), output_cgraph_opt_summary_p(), output_node_opt_summary(), produce_asm(), streamer_write_uhwi(), and lto_out_decl_state::symtab_node_encoder.

Referenced by output_symtab().

static int output_cgraph_opt_summary_p ( )
static
static void output_edge_opt_summary ( struct output_block ob,
struct cgraph_edge edge 
)
static
Output optimization summary for EDGE to OB.   

Referenced by output_node_opt_summary().

static void output_outgoing_cgraph_edges ( struct cgraph_edge edge,
struct lto_simple_output_block ob,
lto_symtab_encoder_t  encoder 
)
static
Output all callees or indirect outgoing edges.  EDGE must be the first such
   edge.   

References lto_output_edge(), cgraph_edge::next_callee, and cgraph_edge::prev_callee.

Referenced by output_symtab().

bool reachable_from_this_partition_p ( )
Return true when node is reachable from other partition.   

References cgraph_edge::caller, cgraph_node::callers, lto_symtab_encoder_in_partition_p(), and cgraph_edge::next_caller.

Referenced by write_node_summary_p().

bool referenced_from_other_partition_p ( )
Return if LIST contain references from other partitions.   

References lto_symtab_encoder_in_partition_p(), and ipa_ref::referring.

Referenced by lto_output_node(), and lto_output_varpool_node().

bool referenced_from_this_partition_p ( struct ipa_ref_list list,
lto_symtab_encoder_t  encoder 
)
Return if LIST contain references from other partitions.   

References lto_symtab_encoder_in_partition_p(), and ipa_ref::referring.

Referenced by ipa_reference_write_optimization_summary(), and write_node_summary_p().


Variable Documentation

struct gcov_ctr_summary lto_gcov_summary
static

Referenced by merge_profile_summaries().

int order_base
static
All node orders are ofsetted by ORDER_BASE.   

Referenced by input_cgraph_1(), input_node(), input_varpool_node(), and lto_input_toplevel_asms().