static void write_ts_block_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { streamer_write_chain (ob, BLOCK_VARS (expr), ref_p); stream_write_tree (ob, BLOCK_SUPERCONTEXT (expr), ref_p); /* Stream BLOCK_ABSTRACT_ORIGIN 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. */ if (inlined_function_outer_scope_p (expr)) { tree ultimate_origin = block_ultimate_origin (expr); stream_write_tree (ob, ultimate_origin, ref_p); } else stream_write_tree (ob, NULL_TREE, ref_p); /* 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. */ /* Do not output BLOCK_SUBBLOCKS. Instead on streaming-in this list is re-constructed from BLOCK_SUPERCONTEXT. */ }
static void write_ts_decl_common_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { stream_write_tree (ob, DECL_SIZE (expr), ref_p); stream_write_tree (ob, DECL_SIZE_UNIT (expr), ref_p); /* Note, DECL_INITIAL is not handled here. Since DECL_INITIAL needs special handling in LTO, it must be handled by streamer hooks. */ stream_write_tree (ob, DECL_ATTRIBUTES (expr), ref_p); /* 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. */ if (TREE_CODE (expr) == PARM_DECL) streamer_write_chain (ob, TREE_CHAIN (expr), ref_p); if ((TREE_CODE (expr) == VAR_DECL || TREE_CODE (expr) == PARM_DECL) && DECL_HAS_VALUE_EXPR_P (expr)) stream_write_tree (ob, DECL_VALUE_EXPR (expr), ref_p); if (TREE_CODE (expr) == VAR_DECL) stream_write_tree (ob, DECL_DEBUG_EXPR (expr), ref_p); }
void streamer_write_chain (struct output_block *ob, tree t, bool ref_p) { while (t) { tree saved_chain; /* Clear TREE_CHAIN to avoid blindly recursing into the rest of the list. */ saved_chain = TREE_CHAIN (t); TREE_CHAIN (t) = NULL_TREE; /* We avoid outputting external vars or functions by reference to the global decls section as we do not want to have them enter decl merging. This is, of course, only for the call for streaming BLOCK_VARS, but other callers are safe. */ /* ??? FIXME wrt SCC streaming. Drop these for now. */ if (VAR_OR_FUNCTION_DECL_P (t) && DECL_EXTERNAL (t)) ; /* stream_write_tree_shallow_non_ref (ob, t, ref_p); */ else stream_write_tree (ob, t, ref_p); TREE_CHAIN (t) = saved_chain; t = TREE_CHAIN (t); } /* Write a sentinel to terminate the chain. */ stream_write_tree (ob, NULL_TREE, ref_p); }
static void write_ts_list_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { stream_write_tree (ob, TREE_PURPOSE (expr), ref_p); stream_write_tree (ob, TREE_VALUE (expr), ref_p); streamer_write_chain (ob, TREE_CHAIN (expr), ref_p); }
static void write_ts_decl_minimal_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { stream_write_tree (ob, DECL_NAME (expr), ref_p); stream_write_tree (ob, DECL_CONTEXT (expr), ref_p); }
static void write_ts_decl_minimal_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { stream_write_tree (ob, DECL_NAME (expr), ref_p); stream_write_tree (ob, DECL_CONTEXT (expr), ref_p); lto_output_location (ob, DECL_SOURCE_LOCATION (expr)); }
static void write_ts_decl_non_common_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { if (TREE_CODE (expr) == TYPE_DECL) stream_write_tree (ob, DECL_ORIGINAL_TYPE (expr), ref_p); stream_write_tree (ob, DECL_VINDEX (expr), ref_p); }
static void write_ts_exp_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { int i; for (i = 0; i < TREE_OPERAND_LENGTH (expr); i++) stream_write_tree (ob, TREE_OPERAND (expr, i), ref_p); stream_write_tree (ob, TREE_BLOCK (expr), ref_p); }
static void write_ts_field_decl_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { stream_write_tree (ob, DECL_FIELD_OFFSET (expr), ref_p); stream_write_tree (ob, DECL_BIT_FIELD_TYPE (expr), ref_p); stream_write_tree (ob, DECL_BIT_FIELD_REPRESENTATIVE (expr), ref_p); stream_write_tree (ob, DECL_FIELD_BIT_OFFSET (expr), ref_p); stream_write_tree (ob, DECL_FCONTEXT (expr), ref_p); }
static void write_ts_function_decl_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { /* DECL_STRUCT_FUNCTION is handled by lto_output_function. FIXME lto, maybe it should be handled here? */ stream_write_tree (ob, DECL_FUNCTION_PERSONALITY (expr), ref_p); stream_write_tree (ob, DECL_FUNCTION_SPECIFIC_TARGET (expr), ref_p); stream_write_tree (ob, DECL_FUNCTION_SPECIFIC_OPTIMIZATION (expr), ref_p); }
static void write_ts_decl_with_vis_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { /* Make sure we don't inadvertently set the assembler name. */ if (DECL_ASSEMBLER_NAME_SET_P (expr)) stream_write_tree (ob, DECL_ASSEMBLER_NAME (expr), ref_p); else stream_write_tree (ob, NULL_TREE, false); }
static void write_ts_binfo_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { unsigned i; tree t; /* Note that the number of BINFO slots has already been emitted in EXPR's header (see streamer_write_tree_header) because this length is needed to build the empty BINFO node on the reader side. */ FOR_EACH_VEC_ELT (tree, BINFO_BASE_BINFOS (expr), i, t) stream_write_tree (ob, t, ref_p); stream_write_tree (ob, NULL_TREE, false); stream_write_tree (ob, BINFO_OFFSET (expr), ref_p); stream_write_tree (ob, BINFO_VTABLE (expr), ref_p); stream_write_tree (ob, BINFO_VPTR_FIELD (expr), ref_p); streamer_write_uhwi (ob, VEC_length (tree, BINFO_BASE_ACCESSES (expr))); FOR_EACH_VEC_ELT (tree, BINFO_BASE_ACCESSES (expr), i, t) stream_write_tree (ob, t, ref_p); stream_write_tree (ob, BINFO_INHERITANCE_CHAIN (expr), ref_p); stream_write_tree (ob, BINFO_SUBVTT_INDEX (expr), ref_p); stream_write_tree (ob, BINFO_VPTR_INDEX (expr), ref_p); }
static void write_ts_field_decl_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { stream_write_tree (ob, DECL_FIELD_OFFSET (expr), ref_p); stream_write_tree (ob, DECL_BIT_FIELD_TYPE (expr), ref_p); stream_write_tree (ob, DECL_QUALIFIER (expr), ref_p); stream_write_tree (ob, DECL_FIELD_BIT_OFFSET (expr), ref_p); stream_write_tree (ob, DECL_FCONTEXT (expr), ref_p); streamer_write_chain (ob, TREE_CHAIN (expr), ref_p); }
static void write_ts_decl_non_common_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { if (TREE_CODE (expr) == FUNCTION_DECL) { stream_write_tree (ob, DECL_ARGUMENTS (expr), ref_p); stream_write_tree (ob, DECL_RESULT (expr), ref_p); } stream_write_tree (ob, DECL_VINDEX (expr), ref_p); }
static void write_ts_exp_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { int i; streamer_write_hwi (ob, TREE_OPERAND_LENGTH (expr)); for (i = 0; i < TREE_OPERAND_LENGTH (expr); i++) stream_write_tree (ob, TREE_OPERAND (expr, i), ref_p); lto_output_location (ob, EXPR_LOCATION (expr)); stream_write_tree (ob, TREE_BLOCK (expr), ref_p); }
static void write_ts_constructor_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { unsigned i; tree index, value; FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (expr), i, index, value) { stream_write_tree (ob, index, ref_p); stream_write_tree (ob, value, ref_p); }
static void write_ts_function_decl_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { stream_write_tree (ob, DECL_VINDEX (expr), ref_p); /* DECL_STRUCT_FUNCTION is handled by lto_output_function. */ stream_write_tree (ob, DECL_FUNCTION_PERSONALITY (expr), ref_p); /* Don't stream these when passing things to a different target. */ if (!lto_stream_offload_p) stream_write_tree (ob, DECL_FUNCTION_SPECIFIC_TARGET (expr), ref_p); stream_write_tree (ob, DECL_FUNCTION_SPECIFIC_OPTIMIZATION (expr), ref_p); }
static void write_ts_decl_minimal_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { /* Drop names that were created for anonymous entities. */ if (DECL_NAME (expr) && TREE_CODE (DECL_NAME (expr)) == IDENTIFIER_NODE && anon_aggrname_p (DECL_NAME (expr))) stream_write_tree (ob, NULL_TREE, ref_p); else stream_write_tree (ob, DECL_NAME (expr), ref_p); stream_write_tree (ob, DECL_CONTEXT (expr), ref_p); }
void streamer_write_chain (struct output_block *ob, tree t, bool ref_p) { int i, count; count = list_length (t); streamer_write_hwi (ob, count); for (i = 0; i < count; i++) { tree saved_chain; /* Clear TREE_CHAIN to avoid blindly recursing into the rest of the list. */ saved_chain = TREE_CHAIN (t); TREE_CHAIN (t) = NULL_TREE; /* We avoid outputting external vars or functions by reference to the global decls section as we do not want to have them enter decl merging. This is, of course, only for the call for streaming BLOCK_VARS, but other callers are safe. */ if (VAR_OR_FUNCTION_DECL_P (t) && DECL_EXTERNAL (t)) stream_write_tree_shallow_non_ref (ob, t, ref_p); else stream_write_tree (ob, t, ref_p); TREE_CHAIN (t) = saved_chain; t = TREE_CHAIN (t); } }
static void write_ts_vector_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { unsigned i; /* Note that the number of elements for EXPR has already been emitted in EXPR's header (see streamer_write_tree_header). */ for (i = 0; i < VECTOR_CST_NELTS (expr); ++i) stream_write_tree (ob, VECTOR_CST_ELT (expr, i), ref_p); }
static void write_ts_vec_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { int i; /* Note that the number of slots for EXPR has already been emitted in EXPR's header (see streamer_write_tree_header). */ for (i = 0; i < TREE_VEC_LENGTH (expr); i++) stream_write_tree (ob, TREE_VEC_ELT (expr, i), ref_p); }
static void write_ts_block_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { /* Do not stream BLOCK_SOURCE_LOCATION. We cannot handle debug information for early inlining so drop it on the floor instead of ICEing in dwarf2out.c. */ streamer_write_chain (ob, BLOCK_VARS (expr), ref_p); /* Do not stream BLOCK_NONLOCALIZED_VARS. We cannot handle debug information for early inlining so drop it on the floor instead of ICEing in dwarf2out.c. */ stream_write_tree (ob, BLOCK_SUPERCONTEXT (expr), ref_p); /* Do not stream BLOCK_ABSTRACT_ORIGIN. We cannot handle debug information for early inlining so drop it on the floor instead of ICEing in dwarf2out.c. */ stream_write_tree (ob, BLOCK_FRAGMENT_ORIGIN (expr), ref_p); stream_write_tree (ob, BLOCK_FRAGMENT_CHAIN (expr), ref_p); /* Do not output BLOCK_SUBBLOCKS. Instead on streaming-in this list is re-constructed from BLOCK_SUPERCONTEXT. */ }
static void write_ts_binfo_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { unsigned i; tree t; /* Note that the number of BINFO slots has already been emitted in EXPR's header (see streamer_write_tree_header) because this length is needed to build the empty BINFO node on the reader side. */ FOR_EACH_VEC_ELT (*BINFO_BASE_BINFOS (expr), i, t) stream_write_tree (ob, t, ref_p); stream_write_tree (ob, NULL_TREE, false); stream_write_tree (ob, BINFO_OFFSET (expr), ref_p); stream_write_tree (ob, BINFO_VTABLE (expr), ref_p); stream_write_tree (ob, BINFO_VPTR_FIELD (expr), ref_p); /* The number of BINFO_BASE_ACCESSES has already been emitted in EXPR's bitfield section. */ FOR_EACH_VEC_SAFE_ELT (BINFO_BASE_ACCESSES (expr), i, t) stream_write_tree (ob, t, ref_p); /* Do not walk BINFO_INHERITANCE_CHAIN, BINFO_SUBVTT_INDEX and BINFO_VPTR_INDEX; these are used by C++ FE only. */ }
void streamer_write_chain (struct output_block *ob, tree t, bool ref_p) { while (t) { /* We avoid outputting external vars or functions by reference to the global decls section as we do not want to have them enter decl merging. This is, of course, only for the call for streaming BLOCK_VARS, but other callers are safe. See also lto-streamer-out.c:DFS_write_tree_body. */ if (VAR_OR_FUNCTION_DECL_P (t) && DECL_EXTERNAL (t)) stream_write_tree_shallow_non_ref (ob, t, ref_p); else stream_write_tree (ob, t, ref_p); t = TREE_CHAIN (t); } /* Write a sentinel to terminate the chain. */ stream_write_tree (ob, NULL_TREE, ref_p); }
static void output_phi (struct output_block *ob, gimple phi) { unsigned i, len = gimple_phi_num_args (phi); streamer_write_record_start (ob, lto_gimple_code_to_tag (GIMPLE_PHI)); streamer_write_uhwi (ob, SSA_NAME_VERSION (PHI_RESULT (phi))); for (i = 0; i < len; i++) { stream_write_tree (ob, gimple_phi_arg_def (phi, i), true); streamer_write_uhwi (ob, gimple_phi_arg_edge (phi, i)->src->index); lto_output_location (ob, gimple_phi_arg_location (phi, i)); } }
static void write_ts_type_common_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { stream_write_tree (ob, TYPE_SIZE (expr), ref_p); stream_write_tree (ob, TYPE_SIZE_UNIT (expr), ref_p); stream_write_tree (ob, TYPE_ATTRIBUTES (expr), ref_p); stream_write_tree (ob, TYPE_NAME (expr), ref_p); /* 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. */ stream_write_tree (ob, TYPE_MAIN_VARIANT (expr), ref_p); stream_write_tree (ob, TYPE_CONTEXT (expr), ref_p); /* TYPE_CANONICAL is re-computed during type merging, so no need to stream it here. */ stream_write_tree (ob, TYPE_STUB_DECL (expr), ref_p); }
void streamer_write_chain (struct output_block *ob, tree t, bool ref_p) { int i, count; count = list_length (t); streamer_write_hwi (ob, count); for (i = 0; i < count; i++) { tree saved_chain; /* Clear TREE_CHAIN to avoid blindly recursing into the rest of the list. */ saved_chain = TREE_CHAIN (t); TREE_CHAIN (t) = NULL_TREE; stream_write_tree (ob, t, ref_p); TREE_CHAIN (t) = saved_chain; t = TREE_CHAIN (t); } }
static void write_ts_type_non_common_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { if (TREE_CODE (expr) == ENUMERAL_TYPE) stream_write_tree (ob, TYPE_VALUES (expr), ref_p); else if (TREE_CODE (expr) == ARRAY_TYPE) stream_write_tree (ob, TYPE_DOMAIN (expr), ref_p); else if (RECORD_OR_UNION_TYPE_P (expr)) stream_write_tree (ob, TYPE_FIELDS (expr), ref_p); else if (TREE_CODE (expr) == FUNCTION_TYPE || TREE_CODE (expr) == METHOD_TYPE) stream_write_tree (ob, TYPE_ARG_TYPES (expr), ref_p); if (!POINTER_TYPE_P (expr)) stream_write_tree (ob, TYPE_MINVAL (expr), ref_p); stream_write_tree (ob, TYPE_MAXVAL (expr), ref_p); if (RECORD_OR_UNION_TYPE_P (expr)) stream_write_tree (ob, TYPE_BINFO (expr), ref_p); }
static void write_ts_common_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { if (TREE_CODE (expr) != IDENTIFIER_NODE) stream_write_tree (ob, TREE_TYPE (expr), ref_p); }
static void write_ts_complex_tree_pointers (struct output_block *ob, tree expr, bool ref_p) { stream_write_tree (ob, TREE_REALPART (expr), ref_p); stream_write_tree (ob, TREE_IMAGPART (expr), ref_p); }