GCC Middle and Back End API Reference
lto-streamer-out.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "target.h"
#include "rtl.h"
#include "tree.h"
#include "gimple.h"
#include "tree-pass.h"
#include "ssa.h"
#include "gimple-streamer.h"
#include "alias.h"
#include "stor-layout.h"
#include "gimple-iterator.h"
#include "except.h"
#include "lto-symtab.h"
#include "cgraph.h"
#include "cfgloop.h"
#include "builtins.h"
#include "gomp-constants.h"
#include "debug.h"
#include "omp-offload.h"
#include "print-tree.h"
#include "tree-dfa.h"
#include "file-prefix-map.h"
#include "output.h"
#include "ipa-utils.h"
#include "toplev.h"
Include dependency graph for lto-streamer-out.cc:

Data Structures

class  DFS
 
struct  DFS::scc_entry
 
struct  DFS::sccs
 
struct  DFS::worklist
 

Macros

#define DFS_follow_tree_edge(DEST)    DFS_write_tree (ob, expr_state, DEST, ref_p, ref_p)
 
#define visit(SIBLING)
 
#define LTO_SYMTAB_EXTENSION_VERSION   1
 

Functions

static void lto_write_tree (struct output_block *, tree, bool)
 
static void clear_line_info (struct output_block *ob)
 
struct output_blockcreate_output_block (enum lto_section_type section_type)
 
void destroy_output_block (struct output_block *ob)
 
static bool lto_variably_modified_type_p (tree type)
 
static bool tree_is_indexable (tree t)
 
static void lto_output_location_1 (struct output_block *ob, struct bitpack_d *bp, location_t orig_loc, bool block_p)
 
void lto_output_location (struct output_block *ob, struct bitpack_d *bp, location_t loc)
 
void lto_output_location_and_block (struct output_block *ob, struct bitpack_d *bp, location_t loc)
 
static unsigned lto_get_index (struct lto_tree_ref_encoder *encoder, tree t)
 
static void lto_indexable_tree_ref (struct output_block *ob, tree expr, enum LTO_tags *tag, unsigned *index)
 
void lto_output_var_decl_ref (struct lto_out_decl_state *decl_state, struct lto_output_stream *obs, tree decl)
 
void lto_output_fn_decl_ref (struct lto_out_decl_state *decl_state, struct lto_output_stream *obs, tree decl)
 
static bool lto_is_streamable (tree expr)
 
static tree subtract_estimated_size (tree *tp, int *ws, void *data)
 
static tree get_symbol_initial_value (lto_symtab_encoder_t encoder, tree expr)
 
void stream_write_tree_ref (struct output_block *ob, tree t)
 
static void lto_write_tree_1 (struct output_block *ob, tree expr, bool ref_p)
 
static void lto_output_tree_1 (struct output_block *ob, tree expr, hashval_t hash, bool ref_p, bool this_ref_p)
 
static bool local_tree_p (tree t)
 
static hashval_t hash_tree (struct streamer_tree_cache_d *cache, hash_map< tree, hashval_t > *map, tree t)
 
void lto_output_tree (struct output_block *ob, tree expr, bool ref_p, bool this_ref_p)
 
static void output_eh_try_list (struct output_block *ob, eh_catch first)
 
static void output_eh_region (struct output_block *ob, eh_region r)
 
static void output_eh_lp (struct output_block *ob, eh_landing_pad lp)
 
static void output_eh_regions (struct output_block *ob, struct function *fn)
 
static void output_ssa_names (struct output_block *ob, struct function *fn)
 
static void output_cfg (struct output_block *ob, struct function *fn)
 
void produce_asm (struct output_block *ob, tree fn)
 
static void output_struct_function_base (struct output_block *ob, struct function *fn)
 
static void collect_block_tree_leafs (tree root, vec< tree > &leafs)
 
void lto_prepare_function_for_streaming (struct cgraph_node *node)
 
static void streamer_write_chain (struct output_block *ob, tree t, bool ref_p)
 
static void output_function (struct cgraph_node *node)
 
static void output_constructor (struct varpool_node *node)
 
void lto_output_toplevel_asms (void)
 
static void copy_function_or_variable (struct symtab_node *node)
 
static tree wrap_refs (tree *tp, int *ws, void *)
 
static void prune_offload_funcs (void)
 
static void produce_lto_section ()
 
static int cmp_symbol_files (const void *pn1, const void *pn2, void *id_map_)
 
void lto_output (void)
 
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_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_out_decl_state *state)
 
static size_t lto_out_decl_state_written_size (struct lto_out_decl_state *state)
 
static void write_symbol (struct streamer_tree_cache_d *cache, tree t, hash_set< const char * > *seen, bool alias)
 
static void write_symbol_extension_info (tree t)
 
static unsigned int produce_symtab (struct output_block *ob)
 
static void produce_symtab_extension (struct output_block *ob, unsigned int previous_streamed_symbols)
 
void lto_output_init_mode_table (void)
 
static void lto_write_mode_table (void)
 
void produce_asm_for_decls (void)
 

Macro Definition Documentation

◆ DFS_follow_tree_edge

#define DFS_follow_tree_edge ( DEST)     DFS_write_tree (ob, expr_state, DEST, ref_p, ref_p)

◆ LTO_SYMTAB_EXTENSION_VERSION

#define LTO_SYMTAB_EXTENSION_VERSION   1
Symtab extension version.   

Referenced by produce_symtab_extension().

◆ visit

#define visit ( SIBLING)
Value:
do { \
unsigned ix; \
hstate.add_int (0); \
else if (map) \
hstate.add_int (*map->get (SIBLING)); \
hstate.add_int (1); \
} while (0)
vec< rtx > cache
Definition calls.cc:1934
static struct string2counter_map map[debug_counter_number_of_counters]
Definition dbgcnt.cc:39
T * ggc_alloc(ALONE_CXX_MEM_STAT_INFO)
Definition ggc.h:184
bool streamer_tree_cache_lookup(struct streamer_tree_cache_d *cache, tree t, unsigned *ix_p)
Definition tree-streamer.cc:224
hashval_t streamer_tree_cache_get_hash(struct streamer_tree_cache_d *cache, unsigned ix)
Definition tree-streamer.h:102

Function Documentation

◆ clear_line_info()

◆ cmp_symbol_files()

static int cmp_symbol_files ( const void * pn1,
const void * pn2,
void * id_map_ )
static
Compare symbols to get them sorted by filename (to optimize streaming)   

References ggc_alloc(), lto_file_decl_data::id, symtab_node::lto_file_data, symtab_node::order, and lto_file_decl_data::order.

Referenced by lto_output().

◆ collect_block_tree_leafs()

static void collect_block_tree_leafs ( tree root,
vec< tree > & leafs )
static
Collect all leaf BLOCKs beyond ROOT into LEAFS.   

References BLOCK_CHAIN, BLOCK_SUBBLOCKS, collect_block_tree_leafs(), and ggc_alloc().

Referenced by collect_block_tree_leafs(), and output_function().

◆ copy_function_or_variable()

◆ create_output_block()

◆ destroy_output_block()

◆ get_symbol_initial_value()

static tree get_symbol_initial_value ( lto_symtab_encoder_t encoder,
tree expr )
static

◆ hash_tree()

static hashval_t hash_tree ( struct streamer_tree_cache_d * cache,
hash_map< tree, hashval_t > * map,
tree t )
static
Return a hash value for the tree T.
CACHE holds hash values of trees outside current SCC.  MAP, if non-NULL,
may hold hash values if trees inside current SCC.   

References AGGREGATE_TYPE_P, b, BINFO_BASE_BINFOS, BINFO_OFFSET, BINFO_VTABLE, CODE_CONTAINS_STRUCT, CONSTRUCTOR_ELTS, CONSTRUCTOR_NELTS, count, DECL_ABSTRACT_P, DECL_ALIGN, DECL_ARTIFICIAL, DECL_ASSEMBLER_NAME, DECL_ASSEMBLER_NAME_SET_P, DECL_ATTRIBUTES, DECL_BIT_FIELD, DECL_BIT_FIELD_REPRESENTATIVE, DECL_BIT_FIELD_TYPE, DECL_BUILT_IN_CLASS, DECL_BY_REFERENCE, DECL_COMDAT, DECL_COMMON, DECL_CONTEXT, DECL_CXX_CONSTRUCTOR_P, DECL_CXX_DESTRUCTOR_P, DECL_DEBUG_EXPR, DECL_DECLARED_INLINE_P, DECL_DISREGARD_INLINE_LIMITS, DECL_DLLIMPORT_P, DECL_EXTERNAL, DECL_FIELD_ABI_IGNORED, DECL_FIELD_BIT_OFFSET, DECL_FIELD_CXX_ZERO_WIDTH_BIT_FIELD, DECL_FIELD_OFFSET, DECL_FILE_SCOPE_P, DECL_FINAL_P, DECL_FUNCTION_PERSONALITY, DECL_FUNCTION_SPECIFIC_OPTIMIZATION, DECL_FUNCTION_SPECIFIC_TARGET, DECL_HARD_REGISTER, DECL_HAS_DEBUG_EXPR_P, DECL_HAS_VALUE_EXPR_P, DECL_IGNORED_P, DECL_IN_CONSTANT_POOL, DECL_IS_MALLOC, DECL_IS_NOVOPS, DECL_IS_RETURNS_TWICE, DECL_LOOPING_CONST_OR_PURE_P, DECL_MODE, DECL_NAME, DECL_NO_INLINE_WARNING_P, DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK, DECL_NONADDRESSABLE_P, DECL_NONLOCAL, DECL_NONLOCAL_FRAME, DECL_NOT_GIMPLE_REG_P, DECL_OFFSET_ALIGN, DECL_P, DECL_PACKED, DECL_PADDING_P, DECL_POSSIBLY_INLINED, DECL_PRESERVE_P, DECL_PURE_P, DECL_REGISTER, DECL_SEEN_IN_BIND_EXPR_P, DECL_SIZE, DECL_SIZE_UNIT, DECL_STATIC_CHAIN, DECL_STATIC_CONSTRUCTOR, DECL_STATIC_DESTRUCTOR, DECL_UNCHECKED_FUNCTION_CODE, DECL_UNINLINABLE, DECL_UNSIGNED, DECL_USER_ALIGN, DECL_VALUE_EXPR, DECL_VIRTUAL_P, DECL_VISIBILITY, DECL_VISIBILITY_SPECIFIED, DECL_WEAK, EH_LANDING_PAD_NR, FIXED_VALUE_TYPE, FOR_EACH_CONSTRUCTOR_ELT, FOR_EACH_VEC_ELT, FUNCTION_DECL_DECL_TYPE, ggc_alloc(), i, IDENTIFIER_ANON_P, IDENTIFIER_HASH_VALUE, LABEL_DECL_UID, lto_stream_offload_p, NOT_BUILT_IN, NUM_POLY_INT_COEFFS, OMP_CLAUSE_CHAIN, OMP_CLAUSE_CODE, OMP_CLAUSE_DEFAULT, OMP_CLAUSE_DEFAULT_KIND, OMP_CLAUSE_DEPEND, OMP_CLAUSE_DEPEND_KIND, OMP_CLAUSE_DOACROSS, OMP_CLAUSE_DOACROSS_KIND, OMP_CLAUSE_IN_REDUCTION, OMP_CLAUSE_MAP, OMP_CLAUSE_MAP_KIND, omp_clause_num_ops, OMP_CLAUSE_OPERAND, OMP_CLAUSE_PROC_BIND, OMP_CLAUSE_PROC_BIND_KIND, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_REDUCTION_CODE, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_SCHEDULE_KIND, OMP_CLAUSE_TASK_REDUCTION, POINTER_TYPE_P, POLY_INT_CST_COEFF, r, REAL_VALUE_TYPE, RECORD_OR_UNION_TYPE_P, SSA_NAME_IS_DEFAULT_DEF, wi::to_widest(), TRANSLATION_UNIT_LANGUAGE, TREE_ADDRESSABLE, TREE_CHAIN, TREE_CODE, TREE_CONSTANT, TREE_DEPRECATED, TREE_FIXED_CST, TREE_IMAGPART, TREE_NO_WARNING, TREE_NOTHROW, TREE_OPERAND, TREE_OPERAND_LENGTH, TREE_OPTIMIZATION, TREE_PRIVATE, TREE_PROTECTED, TREE_PUBLIC, TREE_PURPOSE, TREE_READONLY, TREE_REAL_CST, TREE_REALPART, TREE_SIDE_EFFECTS, TREE_STATIC, TREE_STRING_LENGTH, TREE_STRING_POINTER, TREE_TARGET_OPTION, TREE_THIS_VOLATILE, TREE_TYPE, TREE_VALUE, TREE_VEC_ELT, TREE_VEC_LENGTH, TYPE_ADDR_SPACE, TYPE_ALIGN, TYPE_ARG_TYPES, TYPE_ARTIFICIAL, TYPE_ATTRIBUTES, TYPE_CONTEXT, TYPE_CXX_ODR_P, TYPE_DOMAIN, TYPE_EMPTY_P, TYPE_FIELDS, TYPE_FILE_SCOPE_P, TYPE_FINAL_P, TYPE_MAIN_VARIANT, TYPE_MAX_VALUE_RAW, TYPE_MIN_VALUE_RAW, TYPE_MODE, TYPE_NAME, TYPE_NONALIASED_COMPONENT, TYPE_P, TYPE_PACKED, TYPE_PRECISION_RAW, TYPE_READONLY, TYPE_RESTRICT, TYPE_REVERSE_STORAGE_ORDER, TYPE_SATURATING, TYPE_SIZE, TYPE_SIZE_UNIT, TYPE_STRING_FLAG, TYPE_TRANSPARENT_AGGR, TYPE_TYPELESS_STORAGE, TYPE_UNSIGNED, TYPE_USER_ALIGN, VECTOR_CST_ENCODED_ELT, vector_cst_encoded_nelts(), and visit.

Referenced by DFS::hash_scc().

◆ local_tree_p()

static bool local_tree_p ( tree t)
static
Return true if type can not be merged with structurally same tree in
other translation unit.  During stream out this information is propagated
to all trees referring to T and they are not streamed with additional
information needed by the tree merging in lto-common.cc (in particular,
scc hash codes are not streamed).

TRANSLATION_UNIT_DECL is handled specially since references to it does
not make other trees local as well.   

References DECL_EXTERNAL, DECL_NAME, ggc_alloc(), odr_type_p(), TREE_CODE, TREE_PUBLIC, type_in_anonymous_namespace_p(), TYPE_MAIN_VARIANT, and type_with_linkage_p().

Referenced by DFS::DFS().

◆ lto_get_index()

static unsigned lto_get_index ( struct lto_tree_ref_encoder * encoder,
tree t )
static
Lookup NAME in ENCODER.  If NAME is not found, create a new entry in
ENCODER for NAME with the next available index of ENCODER,  then
print the index to OBS.
Return the index.   

References hash_map< KeyId, Value, Traits >::get_or_insert(), ggc_alloc(), print_node_brief(), streamer_dump_file, lto_tree_ref_encoder::tree_hash_table, and lto_tree_ref_encoder::trees.

Referenced by lto_indexable_tree_ref(), lto_output_fn_decl_ref(), and lto_output_var_decl_ref().

◆ lto_indexable_tree_ref()

static void lto_indexable_tree_ref ( struct output_block * ob,
tree expr,
enum LTO_tags * tag,
unsigned * index )
static
If EXPR is an indexable tree node, output a reference to it to
output block OB.  Otherwise, output the physical representation of
EXPR to OB.   

References output_block::decl_state, gcc_checking_assert, LTO_DECL_STREAM, lto_get_index(), LTO_global_stream_ref, LTO_ssa_name_ref, SSA_NAME_VERSION, lto_out_decl_state::streams, TREE_CODE, and tree_is_indexable().

Referenced by lto_output_tree(), and stream_write_tree_ref().

◆ lto_is_streamable()

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

References ggc_alloc(), is_lang_specific(), tcc_statement, TREE_CODE, and TREE_CODE_CLASS.

Referenced by DFS::DFS(), and lto_write_tree().

◆ lto_out_decl_state_written_size()

static size_t lto_out_decl_state_written_size ( struct lto_out_decl_state * state)
static
Return the written size of STATE.  

References ggc_alloc(), i, LTO_N_DECL_STREAMS, and lto_tree_ref_encoder_size().

Referenced by produce_asm_for_decls().

◆ lto_output()

◆ lto_output_decl_state_refs()

void lto_output_decl_state_refs ( struct output_block * ob,
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 gcc_assert, ggc_alloc(), i, LTO_N_DECL_STREAMS, lto_write_data(), streamer_tree_cache_lookup(), void_type_node, write_global_references(), and output_block::writer_cache.

Referenced by produce_asm_for_decls().

◆ lto_output_decl_state_streams()

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 i, LTO_N_DECL_STREAMS, and write_global_stream().

Referenced by produce_asm_for_decls().

◆ lto_output_fn_decl_ref()

◆ lto_output_init_mode_table()

void lto_output_init_mode_table ( void )
Init the streamer_mode_table for output, where we collect info on what
machine_mode values have been streamed.   

References ggc_alloc(), and streamer_mode_table.

Referenced by ipa_write_optimization_summaries(), and ipa_write_summaries_1().

◆ lto_output_location()

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 ggc_alloc(), and lto_output_location_1().

Referenced by ipa_odr_summary_write(), and lto_streamer_hooks_init().

◆ lto_output_location_1()

◆ lto_output_location_and_block()

void lto_output_location_and_block ( 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.  Like lto_output_location, but
additionally output LOCATION_BLOCK info too and write the BP bitpack.   

References ggc_alloc(), and lto_output_location_1().

Referenced by lto_streamer_hooks_init().

◆ lto_output_toplevel_asms()

◆ lto_output_tree()

void lto_output_tree ( struct output_block * ob,
tree expr,
bool ref_p,
bool this_ref_p )

◆ lto_output_tree_1()

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 gcc_assert, gcc_checking_assert, ggc_alloc(), lto_write_tree(), NULL_TREE, streamer_tree_cache_insert(), streamer_write_integer_cst(), TREE_CODE, tree_is_indexable(), TREE_OVERFLOW, and output_block::writer_cache.

Referenced by DFS::DFS(), and lto_output_tree().

◆ lto_output_var_decl_ref()

◆ lto_prepare_function_for_streaming()

◆ lto_variably_modified_type_p()

static bool lto_variably_modified_type_p ( tree type)
static
Wrapper around variably_modified_type_p avoiding type modification
during WPA streaming.   

References ggc_alloc(), NULL_TREE, TYPE_LANG_FLAG_0, TYPE_MAIN_VARIANT, and variably_modified_type_p().

Referenced by tree_is_indexable().

◆ lto_write_mode_table()

◆ lto_write_tree()

static void lto_write_tree ( struct output_block * ob,
tree expr,
bool ref_p )
static
Write the GIMPLE representation to a file stream.

   Copyright (C) 2009-2024 Free Software Foundation, Inc.
   Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
   Re-implemented by Diego Novillo <dnovillo@google.com>

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/>.   
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 get_tree_code_name(), internal_error(), lto_is_streamable(), lto_write_tree_1(), streamer_write_tree_header(), and TREE_CODE.

Referenced by lto_output_tree_1().

◆ lto_write_tree_1()

static void lto_write_tree_1 ( struct output_block * ob,
tree expr,
bool ref_p )
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 debug_hooks, DECL_P, output_block::decl_state, gcc_debug_hooks::die_ref_for_decl, DINFO_LEVEL_NONE, get_symbol_initial_value(), ggc_alloc(), lto_section_name, output_block::main_stream, NULL, print_node_brief(), output_block::section_type, stream_write_tree, streamer_dump_file, streamer_write_string(), streamer_write_tree_bitfields(), streamer_write_tree_body(), streamer_write_uhwi(), lto_out_decl_state::symtab_node_encoder, and TREE_CODE.

Referenced by DFS::DFS(), and lto_write_tree().

◆ output_cfg()

◆ output_constructor()

◆ output_eh_lp()

◆ output_eh_region()

◆ output_eh_regions()

◆ output_eh_try_list()

static void output_eh_try_list ( struct output_block * ob,
eh_catch first )
static

◆ output_function()

◆ output_ssa_names()

◆ output_struct_function_base()

◆ produce_asm()

◆ produce_asm_for_decls()

◆ produce_lto_section()

static void produce_lto_section ( )
static

◆ produce_symtab()

◆ produce_symtab_extension()

◆ prune_offload_funcs()

static void prune_offload_funcs ( void )
static
Remove functions that are no longer used from offload_funcs, and mark the
remaining ones with DECL_PRESERVE_P.   

References DECL_PRESERVE_P, FOR_EACH_VEC_ELT, cgraph_node::get(), ggc_alloc(), NULL, offload_funcs, and VEC_ORDERED_REMOVE_IF.

Referenced by lto_output().

◆ stream_write_tree_ref()

◆ streamer_write_chain()

static void streamer_write_chain ( struct output_block * ob,
tree t,
bool ref_p )
static
Emit the chain of tree nodes starting at T.  OB is the output block
to write to.  REF_P is true if chain elements should be emitted
as references.   

References DECL_EXTERNAL, gcc_assert, NULL_TREE, stream_write_tree, TREE_CHAIN, and VAR_OR_FUNCTION_DECL_P.

Referenced by output_function().

◆ subtract_estimated_size()

static tree subtract_estimated_size ( tree * tp,
int * ws,
void * data )
static
Very rough estimate of streaming size of the initializer.  If we ignored
presence of strings, we could simply just count number of non-indexable
tree nodes and number of references to indexable nodes.  Strings however
may be very large and we do not want to dump them int othe global stream.

Count the size of initializer until the size in DATA is positive.   

References gcc_checking_assert, ggc_alloc(), NULL_TREE, TREE_CODE, tree_is_indexable(), and TREE_STRING_LENGTH.

Referenced by get_symbol_initial_value().

◆ tree_is_indexable()

static bool tree_is_indexable ( tree t)
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_CONTEXT, decl_function_context(), DECL_NONLOCAL, FORCED_LABEL, gcc_unreachable, ggc_alloc(), IS_TYPE_OR_DECL_P, lto_variably_modified_type_p(), TREE_CODE, TREE_STATIC, TREE_TYPE, TYPE_P, and VAR_P.

Referenced by DFS::DFS_write_tree(), lto_indexable_tree_ref(), lto_output_tree(), lto_output_tree_1(), and subtract_estimated_size().

◆ wrap_refs()

static tree wrap_refs ( tree * tp,
int * ws,
void *  )
static
Wrap symbol references in *TP inside a type-preserving MEM_REF.   

References build1(), build2(), build_int_cst(), build_pointer_type(), EXPR_P, ggc_alloc(), handled_component_p(), NULL_TREE, TREE_CODE, TREE_OPERAND, TREE_PUBLIC, TREE_THIS_VOLATILE, TREE_TYPE, and VAR_P.

Referenced by lto_output().

◆ write_global_references()

static void write_global_references ( struct output_block * ob,
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 free(), gcc_assert, ggc_alloc(), lto_tree_ref_encoder_get_tree(), lto_tree_ref_encoder_size(), lto_write_data(), streamer_tree_cache_lookup(), and output_block::writer_cache.

Referenced by lto_output_decl_state_refs().

◆ write_global_stream()

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 ggc_alloc(), lto_tree_ref_encoder_get_tree(), lto_tree_ref_encoder_size(), NULL, print_node_brief(), stream_write_tree, streamer_dump_file, streamer_tree_cache_lookup(), and output_block::writer_cache.

Referenced by lto_output_decl_state_streams().

◆ write_symbol()

◆ write_symbol_extension_info()

static void write_symbol_extension_info ( tree t)
static
Write extension information for symbols (symbol type, section flags).   

References section::common, section_common::flags, get_variable_section(), ggc_alloc(), lto_write_data(), SECTION_BSS, TREE_CODE, and VAR_P.

Referenced by produce_symtab_extension().