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

Data Structures

struct  sccs
struct  scc_entry

Functions

static void clear_line_info ()
struct output_blockcreate_output_block ()
void destroy_output_block ()
static void output_type_ref ()
static bool tree_is_indexable ()
void lto_output_location (struct output_block *ob, struct bitpack_d *bp, location_t loc)
static void lto_output_tree_ref ()
static bool lto_is_streamable ()
static tree get_symbol_initial_value ()
static void lto_write_tree_1 ()
static void lto_write_tree ()
static void lto_output_tree_1 (struct output_block *ob, tree expr, hashval_t hash, bool ref_p, bool this_ref_p)
static void DFS_write_tree (struct output_block *ob, sccs *from_state, tree expr, bool ref_p, bool this_ref_p)
static void DFS_write_tree_body (struct output_block *ob, tree expr, sccs *expr_state, bool ref_p)
static hashval_t hash_tree ()
static int scc_entry_compare ()
static hashval_t hash_scc ()
void lto_output_tree (struct output_block *ob, tree expr, bool ref_p, bool this_ref_p)
static void output_eh_try_list ()
static void output_eh_region ()
static void output_eh_lp ()
static void output_eh_regions ()
static void output_ssa_names ()
static void output_cfg ()
void produce_asm ()
static void output_struct_function_base ()
static void output_function ()
void lto_output_toplevel_asms ()
static void copy_function ()
static void lto_output ()
ipa_opt_pass_dmake_pass_ipa_lto_gimple_out ()
static void write_global_stream (struct output_block *ob, struct lto_tree_ref_encoder *encoder)
static void write_global_references (struct output_block *ob, struct lto_output_stream *ref_stream, struct lto_tree_ref_encoder *encoder)
void lto_output_decl_state_streams (struct output_block *ob, struct lto_out_decl_state *state)
void lto_output_decl_state_refs (struct output_block *ob, struct lto_output_stream *out_stream, struct lto_out_decl_state *state)
static size_t lto_out_decl_state_written_size ()
static void write_symbol (struct streamer_tree_cache_d *cache, struct lto_output_stream *stream, tree t, struct pointer_set_t *seen, bool alias)
bool output_symbol_p ()
static void produce_symtab ()
static void produce_asm_for_decls ()
ipa_opt_pass_dmake_pass_ipa_lto_finish_out ()

Variables

static unsigned int next_dfs_num
static vec< scc_entrysccstack
static struct pointer_map_tsccstate
static struct obstack sccstate_obstack

Function Documentation

static void clear_line_info ( )
static
@verbatim Write the GIMPLE representation to a file stream.

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 Re-implemented by Diego Novillo dnovi.nosp@m.llo@.nosp@m.googl.nosp@m.e.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/.

Clear the line info stored in DATA_IN.   

References output_block::current_col, output_block::current_file, and output_block::current_line.

Referenced by create_output_block(), and output_function().

static void DFS_write_tree_body ( struct output_block ob,
tree  expr,
sccs expr_state,
bool  ref_p 
)
static
Handle the tree EXPR in the DFS walk with SCC state EXPR_STATE and
   DFS recurse for all tree edges originating from it.   

References block_ultimate_origin(), and inlined_function_outer_scope_p().

Referenced by DFS_write_tree().

static tree get_symbol_initial_value ( )
static
For EXPR lookup and return what we want to stream to OB as DECL_INITIAL.   

References output_block::decl_state, lto_symtab_encoder_encode_initializer_p(), lto_out_decl_state::symtab_node_encoder, and varpool_get_node().

Referenced by DFS_write_tree(), and lto_write_tree_1().

static hashval_t hash_scc ( )
static
Return a hash value for the SCC on the SCC stack from FIRST with
   size SIZE.   

References first, hash_tree(), iterative_hash_hashval_t(), and scc_entry_compare().

Referenced by DFS_write_tree().

static hashval_t hash_tree ( )
static
static bool lto_is_streamable ( )
inlinestatic
Return true if EXPR is a tree node that can be written to disk.   

References is_lang_specific(), and tcc_statement.

Referenced by DFS_write_tree(), and lto_write_tree().

static size_t lto_out_decl_state_written_size ( )
static
Return the written size of STATE.  

References LTO_N_DECL_STREAMS, lto_tree_ref_encoder_size(), and lto_out_decl_state::streams.

Referenced by produce_asm_for_decls().

void lto_output_decl_state_refs ( struct output_block ob,
struct lto_output_stream out_stream,
struct lto_out_decl_state state 
)
Write all the references in an lto_out_decl_state STATE using
   output block OB and output stream OUT_STREAM.   

References lto_out_decl_state::fn_decl, LTO_N_DECL_STREAMS, lto_output_data_stream(), streamer_tree_cache_lookup(), lto_out_decl_state::streams, write_global_references(), and output_block::writer_cache.

Referenced by produce_asm_for_decls().

void lto_output_decl_state_streams ( struct output_block ob,
struct lto_out_decl_state state 
)
Write all the streams in an lto_out_decl_state STATE using
   output block OB and output stream OUT_STREAM.   

References LTO_N_DECL_STREAMS, lto_out_decl_state::streams, and write_global_stream().

Referenced by produce_asm_for_decls().

void lto_output_location ( struct output_block ob,
struct bitpack_d bp,
location_t  loc 
)
Output info about new location into bitpack BP.
   After outputting bitpack, lto_output_location_data has
   to be done to output actual data.   

References bp_pack_value(), bp_pack_var_len_unsigned(), output_block::current_col, output_block::current_file, output_block::current_line, expand_location(), streamer_string_index(), and strlen().

Referenced by lto_streamer_hooks_init().

void lto_output_tree ( struct output_block ob,
tree  expr,
bool  ref_p,
bool  this_ref_p 
)
Emit the physical representation of tree node EXPR to output block
   OB.  If THIS_REF_P is true, the leaves of EXPR are emitted as references
   via lto_output_tree_ref.  REF_P is used for streaming siblings of EXPR.   

References DFS_write_tree(), LTO_null, LTO_NUM_TAGS, lto_output_tree_ref(), lto_stats, lto_tree_code_to_tag(), LTO_tree_pickle_reference, output_block::main_stream, next_dfs_num, lto_stats_d::num_pickle_refs_output, pointer_map_create(), pointer_map_destroy(), sccstate_obstack, streamer_tree_cache_lookup(), streamer_write_record_start(), streamer_write_uhwi(), tree_is_indexable(), and output_block::writer_cache.

Referenced by lto_streamer_hooks_init().

static void lto_output_tree_1 ( struct output_block ob,
tree  expr,
hashval_t  hash,
bool  ref_p,
bool  this_ref_p 
)
static
Emit the physical representation of tree node EXPR to output block
   OB.  If THIS_REF_P is true, the leaves of EXPR are emitted as references
   via lto_output_tree_ref.  REF_P is used for streaming siblings of EXPR.   

References lto_write_tree(), streamer_handle_as_builtin_p(), streamer_tree_cache_insert(), streamer_write_builtin(), streamer_write_integer_cst(), tree_is_indexable(), and output_block::writer_cache.

Referenced by DFS_write_tree().

static void lto_write_tree ( )
static
Write a physical representation of tree node EXPR to output block
   OB.  If REF_P is true, the leaves of EXPR are emitted as references
   via lto_output_tree_ref.  IX is the index into the streamer cache
   where EXPR is stored.   

References internal_error(), lto_is_streamable(), lto_write_tree_1(), streamer_write_tree_header(), streamer_write_zero(), and tree_code_name.

Referenced by lto_output_tree_1().

static void lto_write_tree_1 ( )
static
Write a physical representation of tree node EXPR to output block
   OB.  If REF_P is true, the leaves of EXPR are emitted as references
   via lto_output_tree_ref.  IX is the index into the streamer cache
   where EXPR is stored.   

References bitpack_create(), get_symbol_initial_value(), output_block::main_stream, streamer_pack_tree_bitfields(), streamer_write_bitpack(), and streamer_write_tree_body().

Referenced by DFS_write_tree(), and lto_write_tree().

ipa_opt_pass_d* make_pass_ipa_lto_finish_out ( )
ipa_opt_pass_d* make_pass_ipa_lto_gimple_out ( )
static void output_eh_try_list ( )
static
Output to OB a list of try/catch handlers starting with FIRST.   

References eh_catch_d::filter_list, eh_catch_d::label, LTO_eh_catch, LTO_null, eh_catch_d::next_catch, streamer_write_record_start(), and eh_catch_d::type_list.

Referenced by output_eh_region().

static void output_ssa_names ( )
static
Output all of the active ssa names to the ssa_names stream.   

References len, output_block::main_stream, streamer_write_char_stream(), streamer_write_uhwi(), streamer_write_zero(), vec_safe_length(), and virtual_operand_p().

Referenced by output_function().

static void output_struct_function_base ( )
static
Output the base body of struct function FN using output block OB.   

References bitpack_create(), bp_pack_value(), output_block::main_stream, streamer_write_bitpack(), streamer_write_hwi(), streamer_write_uhwi(), and vec_safe_length().

Referenced by output_function().

bool output_symbol_p ( )
Return true if NODE should appear in the plugin symbol table.   

References cgraph_node::callers, symtab_node_base::decl, dyn_cast(), IPA_REF_ALIAS, ipa_ref::referring, cgraph_node::symbol, and symtab_real_symbol_p().

Referenced by produce_symtab().

static void output_type_ref ( )
static
Look up NODE in the type table and write the index for it to OB.   

References output_block::decl_state, lto_output_type_ref_index(), LTO_type_ref, output_block::main_stream, and streamer_write_record_start().

Referenced by lto_output_tree_ref().

static int scc_entry_compare ( )
static
Compare two SCC entries by their hash value for qsorting them.   

References scc_entry::hash.

Referenced by hash_scc().

static bool tree_is_indexable ( )
static
Return true if tree node T is written to various tables.  For these
   nodes, we sometimes want to write their phyiscal representation
   (via lto_output_tree), and sometimes we need to emit an index
   reference into a table (via lto_output_tree_ref).   

References decl_function_context(), and variably_modified_type_p().

Referenced by DFS_write_tree(), lto_output_tree(), and lto_output_tree_1().

static void write_global_references ( struct output_block ob,
struct lto_output_stream ref_stream,
struct lto_tree_ref_encoder encoder 
)
static
Write a sequence of indices into the globals vector corresponding
   to the trees in ENCODER.  These are used by the reader to map the
   indices used to refer to global entities within function bodies to
   their referents.   

References lto_output_data_stream(), lto_tree_ref_encoder_get_tree(), lto_tree_ref_encoder_size(), streamer_tree_cache_lookup(), and output_block::writer_cache.

Referenced by lto_output_decl_state_refs().

static void write_global_stream ( struct output_block ob,
struct lto_tree_ref_encoder encoder 
)
static
Write each node in encoded by ENCODER to OB, as well as those reachable
   from it and required for correct representation of its semantics.
   Each node in ENCODER must be a global declaration or a type.  A node
   is written only once, even if it appears multiple times in the
   vector.  Certain transitively-reachable nodes, such as those
   representing expressions, may be duplicated, but such nodes
   must not appear in ENCODER itself.   

References lto_tree_ref_encoder_get_tree(), lto_tree_ref_encoder_size(), streamer_tree_cache_lookup(), and output_block::writer_cache.

Referenced by lto_output_decl_state_streams().

static void write_symbol ( struct streamer_tree_cache_d cache,
struct lto_output_stream stream,
tree  t,
struct pointer_set_t seen,
bool  alias 
)
static

Variable Documentation

unsigned int next_dfs_num
static

Referenced by DFS_write_tree(), and lto_output_tree().

vec<scc_entry> sccstack
static
struct pointer_map_t* sccstate
static
struct obstack sccstate_obstack
static

Referenced by DFS_write_tree(), and lto_output_tree().