GCC Middle and Back End API Reference
data-streamer-out.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "backend.h"
#include "tree.h"
#include "gimple.h"
#include "cgraph.h"
#include "data-streamer.h"
#include "value-range.h"
#include "streamer-hooks.h"
Include dependency graph for data-streamer-out.cc:

Functions

void lto_append_block (struct lto_output_stream *obs)
 
static unsigned streamer_string_index (struct output_block *ob, const char *s, unsigned int len, bool persistent)
 
void streamer_write_string_with_length (struct output_block *ob, struct lto_output_stream *index_stream, const char *s, unsigned int len, bool persistent)
 
void streamer_write_string (struct output_block *ob, struct lto_output_stream *index_stream, const char *string, bool persistent)
 
void bp_pack_string_with_length (struct output_block *ob, struct bitpack_d *bp, const char *s, unsigned int len, bool persistent)
 
void bp_pack_string (struct output_block *ob, struct bitpack_d *bp, const char *s, bool persistent)
 
void streamer_write_zero (struct output_block *ob)
 
void streamer_write_uhwi (struct output_block *ob, unsigned HOST_WIDE_INT work)
 
void streamer_write_hwi (struct output_block *ob, HOST_WIDE_INT work)
 
void streamer_write_poly_uint64 (struct output_block *ob, poly_uint64 work)
 
void streamer_write_poly_int64 (struct output_block *ob, poly_int64 work)
 
void streamer_write_gcov_count (struct output_block *ob, gcov_type work)
 
void streamer_write_uhwi_stream (struct lto_output_stream *obs, unsigned HOST_WIDE_INT work)
 
void streamer_write_hwi_stream (struct lto_output_stream *obs, HOST_WIDE_INT work)
 
void streamer_write_gcov_count_stream (struct lto_output_stream *obs, gcov_type work)
 
void streamer_write_data_stream (struct lto_output_stream *obs, const void *data, size_t len)
 
void streamer_write_real_value (struct output_block *ob, const REAL_VALUE_TYPE *r)
 
void streamer_write_vrange (struct output_block *ob, const vrange &v)
 
void streamer_write_wide_int (struct output_block *ob, const wide_int &val)
 
void streamer_write_widest_int (struct output_block *ob, const widest_int &w)
 

Function Documentation

◆ bp_pack_string()

void bp_pack_string ( struct output_block * ob,
struct bitpack_d * bp,
const char * s,
bool persistent )
Output the '\0' terminated STRING to the string
table in OB.  Then put the index onto the bitpack BP.
When PERSISTENT is set, the string S is supposed to not change during
duration of the OB and thus OB can keep pointer into it.   

References bp_pack_var_len_unsigned(), string_slot::s, and streamer_string_index().

Referenced by lto_output_location_1(), lto_write_mode_table(), and pack_ts_translation_unit_decl_value_fields().

◆ bp_pack_string_with_length()

void bp_pack_string_with_length ( struct output_block * ob,
struct bitpack_d * bp,
const char * s,
unsigned int len,
bool persistent )
Output STRING of LEN characters to the string table in OB.  Then
put the index into BP.
When PERSISTENT is set, the string S is supposed to not change during
duration of the OB and thus OB can keep pointer into it.   

References bp_pack_var_len_unsigned(), string_slot::len, string_slot::s, and streamer_string_index().

◆ lto_append_block()

void lto_append_block ( struct lto_output_stream * obs)
Routines for saving various data types to a file stream.  This deals
   with various data types like strings, integers, enums, etc.

   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/>.   
Adds a new block to output stream OBS.   

References lto_output_stream::block_size, lto_output_stream::current_block, lto_output_stream::current_pointer, lto_output_stream::first_block, gcc_assert, lto_output_stream::left_in_block, NULL, and lto_char_ptr_base::ptr.

Referenced by streamer_write_char_stream(), streamer_write_data_stream(), streamer_write_hwi_stream(), and streamer_write_uhwi_stream().

◆ streamer_string_index()

static unsigned streamer_string_index ( struct output_block * ob,
const char * s,
unsigned int len,
bool persistent )
static
Return index used to reference STRING of LEN characters in the string table
in OB.  The string might or might not include a trailing '\0'.
Then put the index onto the INDEX_STREAM.
When PERSISTENT is set, the string S is supposed to not change during
duration of the OB and thus OB can keep pointer into it.   

References hash_table< Descriptor, Lazy, Allocator >::find_slot(), string_slot::len, NULL, output_block::obstack, string_slot::s, string_slot::slot_num, streamer_write_data_stream(), streamer_write_uhwi_stream(), output_block::string_hash_table, output_block::string_stream, and lto_output_stream::total_size.

Referenced by bp_pack_string(), bp_pack_string_with_length(), and streamer_write_string_with_length().

◆ streamer_write_data_stream()

void streamer_write_data_stream ( struct lto_output_stream * obs,
const void * data,
size_t len )

◆ streamer_write_gcov_count()

void streamer_write_gcov_count ( struct output_block * ob,
gcov_type work )
Write a gcov counter value WORK to OB->main_stream.   

References output_block::main_stream, and streamer_write_gcov_count_stream().

Referenced by profile_count::stream_out(), and stream_out_histogram_value().

◆ streamer_write_gcov_count_stream()

void streamer_write_gcov_count_stream ( struct lto_output_stream * obs,
gcov_type work )

◆ streamer_write_hwi()

◆ streamer_write_hwi_stream()

◆ streamer_write_poly_int64()

void streamer_write_poly_int64 ( struct output_block * ob,
poly_int64 work )
Write a poly_int64 value WORK to OB->main_stream.   

References poly_int< N, C >::coeffs, i, output_block::main_stream, NUM_POLY_INT_COEFFS, and streamer_write_hwi_stream().

Referenced by modref_access_node::stream_out().

◆ streamer_write_poly_uint64()

void streamer_write_poly_uint64 ( struct output_block * ob,
poly_uint64 work )
Write a poly_uint64 value WORK to OB->main_stream.   

References poly_int< N, C >::coeffs, i, output_block::main_stream, NUM_POLY_INT_COEFFS, and streamer_write_uhwi_stream().

◆ streamer_write_real_value()

void streamer_write_real_value ( struct output_block * ob,
const REAL_VALUE_TYPE * r )

◆ streamer_write_string()

void streamer_write_string ( struct output_block * ob,
struct lto_output_stream * index_stream,
const char * string,
bool persistent )
Output the '\0' terminated STRING to the string
table in OB.  Then put the index onto the INDEX_STREAM.
When PERSISTENT is set, the string S is supposed to not change during
duration of the OB and thus OB can keep pointer into it.   

References streamer_write_char_stream(), and streamer_write_string_with_length().

Referenced by ipa_odr_summary_write(), lto_write_tree_1(), and output_gimple_stmt().

◆ streamer_write_string_with_length()

void streamer_write_string_with_length ( struct output_block * ob,
struct lto_output_stream * index_stream,
const char * s,
unsigned int len,
bool persistent )
Output STRING of LEN characters to the string table in OB. The
string might or might not include a trailing '\0'. Then put the
index onto the INDEX_STREAM.
When PERSISTENT is set, the string S is supposed to not change during
duration of the OB and thus OB can keep pointer into it.   

References string_slot::len, string_slot::s, streamer_string_index(), streamer_write_char_stream(), and streamer_write_uhwi_stream().

Referenced by streamer_write_string(), streamer_write_string_cst(), streamer_write_tree_header(), and write_identifier().

◆ streamer_write_uhwi()

◆ streamer_write_uhwi_stream()

◆ streamer_write_vrange()

void streamer_write_vrange ( struct output_block * ob,
const vrange & v )

Referenced by ipa_vr::streamer_write().

◆ streamer_write_wide_int()

void streamer_write_wide_int ( struct output_block * ob,
const wide_int & val )

◆ streamer_write_widest_int()

void streamer_write_widest_int ( struct output_block * ob,
const widest_int & w )

◆ streamer_write_zero()

void streamer_write_zero ( struct output_block * ob)