GCC Middle and Back End API Reference
tree-streamer.h File Reference
#include "streamer-hooks.h"
#include "data-streamer.h"
Include dependency graph for tree-streamer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  streamer_tree_cache_d
 

Functions

tree streamer_read_string_cst (class data_in *, class lto_input_block *)
 
tree streamer_alloc_tree (class lto_input_block *, class data_in *, enum LTO_tags)
 
void streamer_read_tree_body (class lto_input_block *, class data_in *, tree)
 
tree streamer_get_pickled_tree (class lto_input_block *, class data_in *)
 
void streamer_read_tree_bitfields (class lto_input_block *, class data_in *, tree)
 
void streamer_write_string_cst (struct output_block *, struct lto_output_stream *, tree)
 
void streamer_write_tree_header (struct output_block *, tree)
 
void streamer_write_tree_bitfields (struct output_block *, tree)
 
void streamer_write_tree_body (struct output_block *, tree)
 
void streamer_write_integer_cst (struct output_block *, tree)
 
void streamer_check_handled_ts_structures (void)
 
bool streamer_tree_cache_insert (struct streamer_tree_cache_d *, tree, hashval_t, unsigned *)
 
void streamer_tree_cache_replace_tree (struct streamer_tree_cache_d *, tree, unsigned)
 
void streamer_tree_cache_append (struct streamer_tree_cache_d *, tree, hashval_t)
 
bool streamer_tree_cache_lookup (struct streamer_tree_cache_d *, tree, unsigned *)
 
struct streamer_tree_cache_dstreamer_tree_cache_create (bool, bool, bool)
 
void streamer_tree_cache_delete (struct streamer_tree_cache_d *)
 
tree streamer_tree_cache_get_tree (struct streamer_tree_cache_d *cache, unsigned ix)
 
hashval_t streamer_tree_cache_get_hash (struct streamer_tree_cache_d *cache, unsigned ix)
 
void bp_pack_machine_mode (struct bitpack_d *bp, machine_mode mode)
 
machine_mode bp_unpack_machine_mode (struct bitpack_d *bp)
 

Variables

unsigned char streamer_mode_table [MAX_MACHINE_MODE]
 

Function Documentation

◆ bp_pack_machine_mode()

void bp_pack_machine_mode ( struct bitpack_d * bp,
machine_mode mode )
inline

◆ bp_unpack_machine_mode()

◆ streamer_alloc_tree()

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

◆ streamer_check_handled_ts_structures()

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().

◆ streamer_get_pickled_tree()

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().

◆ streamer_read_string_cst()

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-2024 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().

◆ streamer_read_tree_bitfields()

◆ streamer_read_tree_body()

◆ streamer_tree_cache_append()

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().

◆ streamer_tree_cache_create()

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().

◆ streamer_tree_cache_delete()

void streamer_tree_cache_delete ( struct streamer_tree_cache_d * c)

◆ streamer_tree_cache_get_hash()

hashval_t streamer_tree_cache_get_hash ( struct streamer_tree_cache_d * cache,
unsigned ix )
inline
Return the tree hash value at slot IX in CACHE.   

References cache.

Referenced by streamer_tree_cache_replace_tree().

◆ streamer_tree_cache_get_tree()

tree streamer_tree_cache_get_tree ( struct streamer_tree_cache_d * cache,
unsigned ix )
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().

◆ streamer_tree_cache_insert()

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().

◆ streamer_tree_cache_lookup()

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().

◆ streamer_tree_cache_replace_tree()

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().

◆ streamer_write_integer_cst()

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().

◆ streamer_write_string_cst()

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-2024 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().

◆ streamer_write_tree_bitfields()

◆ streamer_write_tree_body()

◆ streamer_write_tree_header()

void streamer_write_tree_header ( struct output_block * ob,
tree expr )

Variable Documentation

◆ streamer_mode_table

unsigned char streamer_mode_table[MAX_MACHINE_MODE]
extern
In tree-streamer.cc.   
Miscellaneous utilities for tree streaming.  Things that are used
   in both input and output are here.

   Copyright (C) 2011-2024 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().