GCC Middle and Back End API Reference
|
Go to the source code of this file.
Data Structures | |
struct | streamer_tree_cache_d |
Variables | |
unsigned char | streamer_mode_table [MAX_MACHINE_MODE] |
|
inline |
References bp_pack_enum, ceil_log2(), last, and streamer_mode_table.
Referenced by pack_ts_decl_common_value_fields(), pack_ts_fixed_cst_value_fields(), and pack_ts_type_common_value_fields().
|
inline |
tree streamer_alloc_tree | ( | class lto_input_block * | ib, |
class 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.
References bp_unpack_value(), build_omp_clause(), build_vl_exp(), CODE_CONTAINS_STRUCT, gcc_assert, input_identifier(), lto_tag_to_tree_code(), make_int_cst(), make_node(), make_tree_binfo(), make_tree_vec(), make_vector(), NULL_TREE, RAW_DATA_LENGTH, RAW_DATA_POINTER, streamer_read_bitpack(), streamer_read_hwi(), streamer_read_string_cst(), streamer_read_uhwi(), and UNKNOWN_LOCATION.
Referenced by lto_input_scc(), and lto_read_tree().
void streamer_check_handled_ts_structures | ( | void | ) |
Check that all the TS_* structures handled by the streamer_write_* and streamer_read_* routines are exactly ALL the structures defined in treestruct.def.
References gcc_assert, i, and LAST_TS_ENUM.
Referenced by lto_streamer_init().
tree streamer_get_pickled_tree | ( | class lto_input_block * | ib, |
class data_in * | data_in ) |
Read an index IX from input block IB and return the tree node at DATA_IN->FILE_DATA->GLOBALS_INDEX[IX].
References data_in::reader_cache, streamer_read_uhwi(), and streamer_tree_cache_get_tree().
Referenced by lto_input_tree_1().
tree streamer_read_string_cst | ( | class data_in * | data_in, |
class lto_input_block * | ib ) |
In tree-streamer-in.cc.
Routines for reading trees from a file stream. Copyright (C) 2011-2025 Free Software Foundation, Inc. Contributed 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/>.
Read a STRING_CST from the string table in DATA_IN using input block IB.
References build_string(), NULL, and streamer_read_indexed_string().
Referenced by input_gimple_stmt(), lto_input_toplevel_asms(), and streamer_alloc_tree().
void streamer_read_tree_bitfields | ( | class lto_input_block * | ib, |
class data_in * | data_in, | ||
tree | expr ) |
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.
References bp_unpack_enum, bp_unpack_value(), bp_unpack_var_len_unsigned(), CALL_EXPR_IFN, cl_optimization_stream_in(), cl_target_option_stream_in(), CLOBBER_KIND, CLOBBER_LAST, CODE_CONTAINS_STRUCT, CONSTRUCTOR_ELTS, DECL_SOURCE_LOCATION, exp(), EXPR_CHECK, MR_DEPENDENCE_BASE, MR_DEPENDENCE_CLIQUE, stream_input_location, streamer_read_bitpack(), targetm, TREE_CODE, TREE_OPTIMIZATION, TREE_TARGET_OPTION, unpack_ts_base_value_fields(), unpack_ts_block_value_fields(), unpack_ts_decl_common_value_fields(), unpack_ts_decl_with_vis_value_fields(), unpack_ts_decl_wrtl_value_fields(), unpack_ts_fixed_cst_value_fields(), unpack_ts_function_decl_value_fields(), unpack_ts_int_cst_value_fields(), unpack_ts_omp_clause_value_fields(), unpack_ts_real_cst_value_fields(), unpack_ts_translation_unit_decl_value_fields(), unpack_ts_type_common_value_fields(), and vec_safe_grow().
Referenced by lto_read_tree_1().
void streamer_read_tree_body | ( | class lto_input_block * | ib, |
class 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.
References CODE_CONTAINS_STRUCT, lto_input_ts_binfo_tree_pointers(), lto_input_ts_block_tree_pointers(), lto_input_ts_common_tree_pointers(), lto_input_ts_complex_tree_pointers(), lto_input_ts_constructor_tree_pointers(), lto_input_ts_decl_common_tree_pointers(), lto_input_ts_decl_minimal_tree_pointers(), lto_input_ts_decl_non_common_tree_pointers(), lto_input_ts_decl_with_vis_tree_pointers(), lto_input_ts_exp_tree_pointers(), lto_input_ts_field_decl_tree_pointers(), lto_input_ts_function_decl_tree_pointers(), lto_input_ts_list_tree_pointers(), lto_input_ts_omp_clause_tree_pointers(), lto_input_ts_poly_tree_pointers(), lto_input_ts_raw_data_cst_tree_pointers(), lto_input_ts_type_common_tree_pointers(), lto_input_ts_type_non_common_tree_pointers(), lto_input_ts_vec_tree_pointers(), lto_input_ts_vector_tree_pointers(), and TREE_CODE.
Referenced by lto_read_tree_1().
void streamer_tree_cache_append | ( | struct streamer_tree_cache_d * | cache, |
tree | t, | ||
hashval_t | hash ) |
Appends tree node T to CACHE, even if T already existed in it.
References cache, streamer_tree_cache_add_to_node_array(), and streamer_tree_cache_insert_1().
Referenced by lto_input_scc(), lto_input_tree_1(), lto_read_tree(), and record_common_node().
struct streamer_tree_cache_d * streamer_tree_cache_create | ( | bool | with_hashes, |
bool | with_map, | ||
bool | with_vec ) |
Create a cache of pickled nodes.
References cache, and preload_common_nodes().
Referenced by create_output_block(), and lto_data_in_create().
void streamer_tree_cache_delete | ( | struct streamer_tree_cache_d * | c | ) |
Delete the streamer cache C.
References free(), streamer_tree_cache_d::hashes, streamer_tree_cache_d::node_map, streamer_tree_cache_d::nodes, and NULL.
Referenced by destroy_output_block(), and lto_data_in_delete().
|
inline |
Return the tree hash value at slot IX in CACHE.
References cache.
Referenced by streamer_tree_cache_replace_tree().
|
inline |
Return the tree node at slot IX in CACHE.
References cache.
Referenced by lto_input_scc(), lto_read_body_or_constructor(), stream_read_tree_ref(), and streamer_get_pickled_tree().
bool streamer_tree_cache_insert | ( | struct streamer_tree_cache_d * | cache, |
tree | t, | ||
hashval_t | hash, | ||
unsigned * | ix_p ) |
Insert tree node T in CACHE. If T already existed in the cache return true. Otherwise, return false. If IX_P is non-null, update it with the index into the cache where T has been stored.
References cache, and streamer_tree_cache_insert_1().
Referenced by DFS::DFS(), and lto_output_tree_1().
bool streamer_tree_cache_lookup | ( | struct streamer_tree_cache_d * | cache, |
tree | t, | ||
unsigned * | ix_p ) |
Return true if tree node T exists in CACHE, otherwise false. If IX_P is not NULL, write to *IX_P the index into the cache where T is stored ((unsigned)-1 if T is not found).
References cache, gcc_assert, and NULL.
Referenced by DFS::DFS_write_tree(), lto_output_decl_state_refs(), lto_output_tree(), stream_write_tree_ref(), verify_common_node_recorded(), write_global_references(), write_global_stream(), and write_symbol().
void streamer_tree_cache_replace_tree | ( | struct streamer_tree_cache_d * | cache, |
tree | t, | ||
unsigned | ix ) |
Replace the tree node with T in CACHE at slot IX.
References cache, streamer_tree_cache_add_to_node_array(), streamer_tree_cache_get_hash(), and streamer_tree_cache_insert_1().
void streamer_write_integer_cst | ( | struct output_block * | ob, |
tree | cst ) |
Emit the integer constant CST to output block OB. If REF_P is true, CST's type will be emitted as a reference.
References gcc_assert, i, LTO_integer_cst, print_node_brief(), stream_write_tree_ref(), streamer_dump_file, streamer_write_hwi(), streamer_write_record_start(), streamer_write_uhwi(), TREE_INT_CST_ELT, TREE_INT_CST_NUNITS, TREE_OVERFLOW, and TREE_TYPE.
Referenced by lto_output_tree_1().
void streamer_write_string_cst | ( | struct output_block * | ob, |
struct lto_output_stream * | index_stream, | ||
tree | string ) |
In tree-streamer-out.cc.
Routines for emitting trees to a file stream. Copyright (C) 2011-2025 Free Software Foundation, Inc. Contributed 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/>.
Output the STRING constant to the string table in OB. Then put the index onto the INDEX_STREAM.
References NULL, streamer_write_string_with_length(), TREE_STRING_LENGTH, and TREE_STRING_POINTER.
Referenced by lto_output_toplevel_asms(), and streamer_write_tree_header().
void streamer_write_tree_bitfields | ( | struct output_block * | ob, |
tree | expr ) |
Pack all the bitfields in EXPR into a bit pack.
References bitpack_create(), bp_pack_enum, bp_pack_value(), bp_pack_var_len_unsigned(), CALL_EXPR_IFN, cl_optimization_stream_out(), cl_target_option_stream_out(), CLOBBER_KIND, CLOBBER_LAST, CODE_CONTAINS_STRUCT, CONSTRUCTOR_NELTS, DECL_SOURCE_LOCATION, EXPR_LOCATION, lto_stream_offload_p, output_block::main_stream, MR_DEPENDENCE_BASE, MR_DEPENDENCE_CLIQUE, pack_ts_base_value_fields(), pack_ts_block_value_fields(), pack_ts_decl_common_value_fields(), pack_ts_decl_with_vis_value_fields(), pack_ts_decl_wrtl_value_fields(), pack_ts_fixed_cst_value_fields(), pack_ts_function_decl_value_fields(), pack_ts_int_cst_value_fields(), pack_ts_omp_clause_value_fields(), pack_ts_real_cst_value_fields(), pack_ts_translation_unit_decl_value_fields(), pack_ts_type_common_value_fields(), stream_output_location, streamer_write_bitpack(), TREE_CODE, TREE_OPTIMIZATION, and TREE_TARGET_OPTION.
Referenced by lto_write_tree_1().
void streamer_write_tree_body | ( | struct output_block * | ob, |
tree | expr ) |
Write all pointer fields in EXPR to output block OB. If REF_P is true, the leaves of EXPR are emitted as references.
References CODE_CONTAINS_STRUCT, lto_stats, lto_stats_d::num_tree_bodies_output, TREE_CODE, write_ts_binfo_tree_pointers(), write_ts_block_tree_pointers(), write_ts_common_tree_pointers(), write_ts_complex_tree_pointers(), write_ts_constructor_tree_pointers(), write_ts_decl_common_tree_pointers(), write_ts_decl_minimal_tree_pointers(), write_ts_decl_non_common_tree_pointers(), write_ts_decl_with_vis_tree_pointers(), write_ts_exp_tree_pointers(), write_ts_field_decl_tree_pointers(), write_ts_function_decl_tree_pointers(), write_ts_list_tree_pointers(), write_ts_omp_clause_tree_pointers(), write_ts_poly_tree_pointers(), write_ts_raw_data_cst_tree_pointers(), write_ts_type_common_tree_pointers(), write_ts_type_non_common_tree_pointers(), write_ts_vec_tree_pointers(), and write_ts_vector_tree_pointers().
Referenced by lto_write_tree_1().
void streamer_write_tree_header | ( | struct output_block * | ob, |
tree | expr ) |
Emit header information for tree EXPR to output block OB. The header contains everything needed to instantiate an empty skeleton for EXPR on the reading side. IX is the index into the streamer cache where EXPR is stored.
References BINFO_N_BASE_BINFOS, bitpack_create(), bp_pack_value(), call_expr_nargs, CODE_CONTAINS_STRUCT, gcc_checking_assert, lto_section_name, lto_tree_code_to_tag(), output_block::main_stream, NULL_TREE, OMP_CLAUSE_CODE, print_node_brief(), RAW_DATA_LENGTH, RAW_DATA_OWNER, RAW_DATA_POINTER, output_block::section_type, streamer_dump_file, streamer_write_bitpack(), streamer_write_hwi(), streamer_write_record_start(), streamer_write_string_cst(), streamer_write_string_with_length(), streamer_write_uhwi(), TREE_CODE, TREE_INT_CST_EXT_NUNITS, TREE_INT_CST_NUNITS, TREE_STRING_POINTER, TREE_VEC_LENGTH, VECTOR_CST_LOG2_NPATTERNS, VECTOR_CST_NELTS_PER_PATTERN, and write_identifier().
Referenced by DFS::DFS(), and lto_write_tree().
|
extern |
In tree-streamer.cc.
Miscellaneous utilities for tree streaming. Things that are used in both input and output are here. Copyright (C) 2011-2025 Free Software Foundation, Inc. Contributed 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/>.
Table indexed by machine_mode, used for 2 different purposes. During streaming out we record there non-zero value for all modes that were streamed out. During streaming in, we translate the on the disk mode using this table. For normal LTO it is set to identity, for ACCEL_COMPILER depending on the mode_table content.
Referenced by bp_pack_machine_mode(), lto_output_init_mode_table(), and lto_write_mode_table().