GCC Middle and Back End API Reference
tree-streamer-in.c File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "diagnostic.h"
#include "tree.h"
#include "gimple.h"
#include "tree-streamer.h"
#include "data-streamer.h"
#include "streamer-hooks.h"
#include "lto-streamer.h"
Include dependency graph for tree-streamer-in.c:

Functions

tree streamer_read_string_cst ()
static tree input_identifier ()
tree streamer_read_chain ()
static void unpack_ts_base_value_fields ()
static void unpack_ts_int_cst_value_fields ()
static void unpack_ts_real_cst_value_fields ()
static void unpack_ts_fixed_cst_value_fields ()
static void unpack_ts_decl_common_value_fields ()
static void unpack_ts_decl_wrtl_value_fields ()
static void unpack_ts_decl_with_vis_value_fields ()
static void unpack_ts_function_decl_value_fields ()
static void unpack_ts_type_common_value_fields ()
static void unpack_ts_block_value_fields (struct data_in *data_in, struct bitpack_d *bp, tree expr)
static void unpack_ts_translation_unit_decl_value_fields (struct data_in *data_in, struct bitpack_d *bp, tree expr)
static void unpack_ts_target_option ()
static void unpack_ts_optimization ()
static void unpack_value_fields ()
struct bitpack_d streamer_read_tree_bitfields (struct lto_input_block *ib, struct data_in *data_in, tree expr)
tree streamer_alloc_tree (struct lto_input_block *ib, struct data_in *data_in, enum LTO_tags tag)
static void lto_input_ts_common_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr)
static void lto_input_ts_vector_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr)
static void lto_input_ts_complex_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr)
static void lto_input_ts_decl_minimal_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr)
static void lto_input_ts_decl_common_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr)
static void lto_input_ts_decl_non_common_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr)
static void lto_input_ts_decl_with_vis_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr)
static void lto_input_ts_field_decl_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr)
static void lto_input_ts_function_decl_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr)
static void lto_input_ts_type_common_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr)
static void lto_input_ts_type_non_common_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr)
static void lto_input_ts_list_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr)
static void lto_input_ts_vec_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr)
static void lto_input_ts_exp_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr)
static void lto_input_ts_block_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr)
static void lto_input_ts_binfo_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr)
static void lto_input_ts_constructor_tree_pointers (struct lto_input_block *ib, struct data_in *data_in, tree expr)
void streamer_read_tree_body (struct lto_input_block *ib, struct data_in *data_in, tree expr)
tree streamer_get_pickled_tree ()
tree streamer_get_builtin_tree ()

Function Documentation

static tree input_identifier ( )
static

Read an IDENTIFIER from the string table in DATA_IN using input block IB.

static void lto_input_ts_binfo_tree_pointers ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)
static

Read all pointer fields in the TS_BINFO structure of EXPR from input block IB. DATA_IN contains tables and descriptors for the file being read.

 Note that the number of slots in EXPR was read in
 streamer_alloc_tree when instantiating EXPR.  However, the
 vector is empty so we cannot rely on vec::length to know how many
 elements to read.  So, this list is emitted as a 0-terminated
 list on the writer side.   
 The vector of BINFO_BASE_ACCESSES is pre-allocated during
 unpacking the bitfield section.   
 Do not walk BINFO_INHERITANCE_CHAIN, BINFO_SUBVTT_INDEX
 and BINFO_VPTR_INDEX; these are used by C++ FE only.   
static void lto_input_ts_block_tree_pointers ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)
static

Read all pointer fields in the TS_BLOCK structure of EXPR from input block IB. DATA_IN contains tables and descriptors for the file being read.

 Stream BLOCK_ABSTRACT_ORIGIN and BLOCK_SOURCE_LOCATION for
 the limited cases we can handle - those that represent inlined
 function scopes.  For the rest them on the floor instead of ICEing in
 dwarf2out.c.   
 Do not stream BLOCK_NONLOCALIZED_VARS.  We cannot handle debug information
 for early inlined BLOCKs so drop it on the floor instead of ICEing in
 dwarf2out.c.   
 BLOCK_FRAGMENT_ORIGIN and BLOCK_FRAGMENT_CHAIN is not live at LTO
 streaming time.   
 We re-compute BLOCK_SUBBLOCKS of our parent here instead
 of streaming it.  For non-BLOCK BLOCK_SUPERCONTEXTs we still
 stream the child relationship explicitly.   
 The global block is rooted at the TU decl.  Hook it here to
 avoid the need to stream in this block during WPA time.   
 The function-level block is connected at the time we read in
 function bodies for the same reason.   

References BINFO_BASE_BINFOS, and stream_read_tree.

static void lto_input_ts_common_tree_pointers ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)
static

Read all pointer fields in the TS_COMMON structure of EXPR from input block IB. DATA_IN contains tables and descriptors for the file being read.

References DECL_CONTEXT, DECL_NAME, and stream_read_tree.

static void lto_input_ts_complex_tree_pointers ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)
static

Read all pointer fields in the TS_COMPLEX structure of EXPR from input block IB. DATA_IN contains tables and descriptors for the file being read.

static void lto_input_ts_constructor_tree_pointers ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)
static

Read all pointer fields in the TS_CONSTRUCTOR structure of EXPR from input block IB. DATA_IN contains tables and descriptors for the file being read.

static void lto_input_ts_decl_common_tree_pointers ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)
static

Read all pointer fields in the TS_DECL_COMMON structure of EXPR from input block IB. DATA_IN contains tables and descriptors for the file being read.

Do not stream DECL_ABSTRACT_ORIGIN. We cannot handle debug information for early inlining so drop it on the floor instead of ICEing in dwarf2out.c.

References DECL_COMDAT_GROUP, DECL_SECTION_NAME, gcc_assert, gdbhooks::IDENTIFIER_NODE, SET_DECL_ASSEMBLER_NAME, stream_read_tree, and TREE_CODE.

static void lto_input_ts_decl_minimal_tree_pointers ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)
static

Read all pointer fields in the TS_DECL_MINIMAL structure of EXPR from input block IB. DATA_IN contains tables and descriptors for the file being read.

References DECL_ORIGINAL_TYPE, DECL_VINDEX, stream_read_tree, TREE_CODE, and gdbhooks::TYPE_DECL.

static void lto_input_ts_decl_non_common_tree_pointers ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)
static

Read all pointer fields in the TS_DECL_NON_COMMON structure of EXPR from input block IB. DATA_IN contains tables and descriptors for the file being read.

static void lto_input_ts_decl_with_vis_tree_pointers ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)
static

Read all pointer fields in the TS_DECL_WITH_VIS structure of EXPR from input block IB. DATA_IN contains tables and descriptors for the file being read.

static void lto_input_ts_exp_tree_pointers ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)
static

Read all pointer fields in the TS_EXP structure of EXPR from input block IB. DATA_IN contains tables and descriptors for the file being read.

static void lto_input_ts_field_decl_tree_pointers ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)
static

Read all pointer fields in the TS_FIELD_DECL structure of EXPR from input block IB. DATA_IN contains tables and descriptors for the file being read.

static void lto_input_ts_function_decl_tree_pointers ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)
static

Read all pointer fields in the TS_FUNCTION_DECL structure of EXPR from input block IB. DATA_IN contains tables and descriptors for the file being read.

DECL_STRUCT_FUNCTION is handled by lto_input_function. FIXME lto, maybe it should be handled here?

 If the file contains a function with an EH personality set,
 then it was compiled with -fexceptions.  In that case, initialize
 the backend EH machinery.   

References POINTER_TYPE_P, RECORD_OR_UNION_TYPE_P, stream_read_tree, streamer_read_chain(), TREE_CODE, TYPE_ARG_TYPES, TYPE_BINFO, TYPE_DOMAIN, TYPE_FIELDS, TYPE_MAXVAL, TYPE_MINVAL, and TYPE_VALUES.

static void lto_input_ts_list_tree_pointers ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)
static

Read all pointer fields in the TS_LIST structure of EXPR from input block IB. DATA_IN contains tables and descriptors for the file being read.

static void lto_input_ts_type_common_tree_pointers ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)
static

Read all pointer fields in the TS_TYPE_COMMON structure of EXPR from input block IB. DATA_IN contains tables and descriptors for the file being read.

 Do not stream TYPE_POINTER_TO or TYPE_REFERENCE_TO.  They will be
 reconstructed during fixup.   
 Do not stream TYPE_NEXT_VARIANT, we reconstruct the variant lists
 during fixup.   
 TYPE_CANONICAL gets re-computed during type merging.   

References stream_read_tree, TREE_CHAIN, TREE_PURPOSE, and TREE_VALUE.

static void lto_input_ts_type_non_common_tree_pointers ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)
static

Read all pointer fields in the TS_TYPE_NON_COMMON structure of EXPR from input block IB. DATA_IN contains tables and descriptors for the file being read.

References stream_read_tree, TREE_OPERAND, TREE_OPERAND_LENGTH, and TREE_SET_BLOCK.

static void lto_input_ts_vec_tree_pointers ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)
static

Read all pointer fields in the TS_VEC structure of EXPR from input block IB. DATA_IN contains tables and descriptors for the file being read.

Note that TREE_VEC_LENGTH was read by streamer_alloc_tree to instantiate EXPR.

References BLOCK_CHAIN, BLOCK_SUBBLOCKS, and BLOCK_SUPERCONTEXT.

static void lto_input_ts_vector_tree_pointers ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)
static

Read all pointer fields in the TS_VECTOR structure of EXPR from input block IB. DATA_IN contains tables and descriptors for the file being read.

References DECL_ATTRIBUTES, DECL_SIZE, DECL_SIZE_UNIT, and stream_read_tree.

tree streamer_alloc_tree ( struct lto_input_block ib,
struct data_in data_in,
enum LTO_tags  tag 
)

Materialize a new tree from input block IB using descriptors in DATA_IN. The code for the new tree should match TAG. Store in *IX_P the index into the reader cache where the new tree is stored.

 We should never see an SSA_NAME tree.  Only the version numbers of
 SSA names are ever written out.  See input_ssa_names.   
 Instantiate a new tree using the header data.   
     For all other nodes, materialize the tree with a raw
     make_node call.   

Referenced by lto_read_tree_1().

tree streamer_get_builtin_tree ( )

Read a code and class from input block IB and return the corresponding builtin. DATA_IN is as in stream_read_tree.

tree streamer_get_pickled_tree ( )

Read an index IX from input block IB and return the tree node at DATA_IN->FILE_DATA->GLOBALS_INDEX[IX].

tree streamer_read_chain ( )

Read a chain of tree nodes from input block IB. DATA_IN contains tables and descriptors for the file being read.

The chain is written as NULL terminated list of trees.

References stream_read_tree, and TREE_CHAIN.

Referenced by lto_input_ts_function_decl_tree_pointers().

tree streamer_read_string_cst ( )

Routines for reading trees from a file stream.

Copyright (C) 2011-2013 Free Software Foundation, Inc. Contributed 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/. Read a STRING_CST from the string table in DATA_IN using input block IB.

Referenced by streamer_read_tree_bitfields().

struct bitpack_d streamer_read_tree_bitfields ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)
read

Read all the language-independent bitfield values for EXPR from IB. Return the partially unpacked bitpack so the caller can unpack any other bitfield values that the writer may have written.

 Read the bitpack of non-pointer values from IB.   
 The first word in BP contains the code of the tree that we
 are about to read.   
 Unpack all the value fields from BP.   

References CODE_CONTAINS_STRUCT, gcc_assert, HOST_WIDEST_INT, lto_tag_to_tree_code(), NULL_TREE, streamer_read_hwi(), and streamer_read_string_cst().

void streamer_read_tree_body ( struct lto_input_block ib,
struct data_in data_in,
tree  expr 
)

Read all pointer fields in EXPR from input block IB. DATA_IN contains tables and descriptors for the file being read.

static void unpack_ts_base_value_fields ( )
static

Unpack all the non-pointer fields of the TS_BASE structure of expression EXPR from bitpack BP.

Note that the code for EXPR has already been unpacked to create EXPR in streamer_alloc_tree.

     TREE_PUBLIC is used on types to indicate that the type
     has a TYPE_CACHED_VALUES vector.  This is not streamed out,
     so we skip it here.   
static void unpack_ts_block_value_fields ( struct data_in data_in,
struct bitpack_d bp,
tree  expr 
)
static

Unpack all the non-pointer fields of the TS_BLOCK structure of expression EXPR from bitpack BP.

BLOCK_NUMBER is recomputed.

References bp_unpack_value(), fatal_error(), and TREE_TARGET_OPTION.

static void unpack_ts_decl_common_value_fields ( )
static

Unpack all the non-pointer fields of the TS_DECL_COMMON structure of expression EXPR from bitpack BP.

Always assume an initial value of -1 for LABEL_DECL_UID to force gimple_set_bb to recreate label_to_block_map.

References bp_unpack_var_len_unsigned(), EH_LANDING_PAD_NR, and LABEL_DECL_UID.

static void unpack_ts_decl_with_vis_value_fields ( )
static

Unpack all the non-pointer fields of the TS_DECL_WITH_VIS structure of expression EXPR from bitpack BP.

static void unpack_ts_decl_wrtl_value_fields ( )
static

Unpack all the non-pointer fields of the TS_DECL_WRTL structure of expression EXPR from bitpack BP.

References bp_unpack_value(), DECL_HARD_REGISTER, DECL_IN_CONSTANT_POOL, and DECL_TLS_MODEL.

static void unpack_ts_fixed_cst_value_fields ( )
static

Unpack all the non-pointer fields of the TS_FIXED_CST structure of expression EXPR from bitpack BP.

References bp_unpack_enum, bp_unpack_value(), DECL_ABSTRACT, DECL_ARTIFICIAL, DECL_EXTERNAL, DECL_GIMPLE_REG_P, DECL_IGNORED_P, DECL_MODE, DECL_NONLOCAL, DECL_PRESERVE_P, DECL_USER_ALIGN, and DECL_VIRTUAL_P.

static void unpack_ts_function_decl_value_fields ( )
static

Unpack all the non-pointer fields of the TS_FUNCTION_DECL structure of expression EXPR from bitpack BP.

References bp_unpack_value(), BUILT_IN_MD, BUILT_IN_NORMAL, DECL_BUILT_IN_CLASS, DECL_FUNCTION_CODE, error_mark_node, fatal_error(), and targetm.

static void unpack_ts_int_cst_value_fields ( )
static

Unpack all the non-pointer fields of the TS_INT_CST structure of expression EXPR from bitpack BP.

References bp_unpack_value(), and REAL_VALUE_TYPE.

static void unpack_ts_optimization ( )
static

Unpack a TS_OPTIMIZATION tree from BP into EXPR.

static void unpack_ts_real_cst_value_fields ( )
static

Unpack all the non-pointer fields of the TS_REAL_CST structure of expression EXPR from bitpack BP.

static void unpack_ts_target_option ( )
static

Unpack a TS_TARGET_OPTION tree from BP into EXPR.

static void unpack_ts_translation_unit_decl_value_fields ( struct data_in data_in,
struct bitpack_d bp,
tree  expr 
)
static

Unpack all the non-pointer fields of the TS_TRANSLATION_UNIT_DECL structure of expression EXPR from bitpack BP.

static void unpack_ts_type_common_value_fields ( )
static

Unpack all the non-pointer fields of the TS_TYPE_COMMON structure of expression EXPR from bitpack BP.

static void unpack_value_fields ( )
static

Unpack all the non-pointer fields in EXPR into a bit pack.

Note that all these functions are highly sensitive to changes in the types and sizes of each of the fields being packed.