GCC Middle and Back End API Reference
data-streamer.h File Reference

Go to the source code of this file.

Data Structures

struct  bitpack_d

Typedefs

typedef unsigned HOST_WIDE_INT bitpack_word_t

Functions

void bp_pack_var_len_unsigned (struct bitpack_d *, unsigned HOST_WIDE_INT)
void bp_pack_var_len_int (struct bitpack_d *, HOST_WIDE_INT)
unsigned HOST_WIDE_INT bp_unpack_var_len_unsigned (struct bitpack_d *)
HOST_WIDE_INT bp_unpack_var_len_int (struct bitpack_d *)
void streamer_write_zero (struct output_block *)
void streamer_write_uhwi (struct output_block *, unsigned HOST_WIDE_INT)
void streamer_write_hwi (struct output_block *, HOST_WIDE_INT)
void streamer_write_gcov_count (struct output_block *, gcov_type)
void streamer_write_string (struct output_block *, struct lto_output_stream *, const char *, bool)
unsigned streamer_string_index (struct output_block *, const char *, unsigned int, bool)
void streamer_write_string_with_length (struct output_block *, struct lto_output_stream *, const char *, unsigned int, bool)
void bp_pack_string_with_length (struct output_block *, struct bitpack_d *, const char *, unsigned int, bool)
void bp_pack_string (struct output_block *, struct bitpack_d *, const char *, bool)
void streamer_write_uhwi_stream (struct lto_output_stream *, unsigned HOST_WIDE_INT)
void streamer_write_hwi_stream (struct lto_output_stream *, HOST_WIDE_INT)
void streamer_write_gcov_count_stream (struct lto_output_stream *, gcov_type)
const char * string_for_index (struct data_in *, unsigned int, unsigned int *)
const char * streamer_read_string (struct data_in *, struct lto_input_block *)
const char * streamer_read_indexed_string (struct data_in *, struct lto_input_block *, unsigned int *)
const char * bp_unpack_indexed_string (struct data_in *, struct bitpack_d *, unsigned int *)
const char * bp_unpack_string (struct data_in *, struct bitpack_d *)
unsigned HOST_WIDE_INT streamer_read_uhwi (struct lto_input_block *)
HOST_WIDE_INT streamer_read_hwi (struct lto_input_block *)
gcov_type streamer_read_gcov_count (struct lto_input_block *)
static struct bitpack_d bitpack_create ()
static void bp_pack_value ()
static void streamer_write_bitpack ()
static struct bitpack_d streamer_read_bitpack ()
static bitpack_word_t bp_unpack_value ()
static void streamer_write_char_stream ()
static unsigned char streamer_read_uchar ()
static void streamer_write_hwi_in_range (struct lto_output_stream *obs, HOST_WIDE_INT min, HOST_WIDE_INT max, HOST_WIDE_INT val)
static HOST_WIDE_INT streamer_read_hwi_in_range (struct lto_input_block *ib, const char *purpose, HOST_WIDE_INT min, HOST_WIDE_INT max)
static void bp_pack_int_in_range (struct bitpack_d *bp, HOST_WIDE_INT min, HOST_WIDE_INT max, HOST_WIDE_INT val)
static HOST_WIDE_INT bp_unpack_int_in_range (struct bitpack_d *bp, const char *purpose, HOST_WIDE_INT min, HOST_WIDE_INT max)
static void streamer_write_record_start ()
static enum LTO_tags streamer_read_record_start ()

Variables

static unsigned const BITS_PER_BITPACK_WORD = HOST_BITS_PER_WIDE_INT

Typedef Documentation

typedef unsigned HOST_WIDE_INT bitpack_word_t

Function Documentation

static void bp_pack_int_in_range ( struct bitpack_d bp,
HOST_WIDE_INT  min,
HOST_WIDE_INT  max,
HOST_WIDE_INT  val 
)
inlinestatic
Output VAL into BP and verify it is in range MIN...MAX that is supposed
   to be compile time constant.
   Be host independent, limit range to 31bits.   

References bp_pack_value(), floor_log2(), and HOST_WIDE_INT.

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

Referenced by pack_ts_translation_unit_decl_value_fields().

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

void bp_pack_var_len_int ( struct bitpack_d ,
HOST_WIDE_INT   
)
void bp_pack_var_len_unsigned ( struct bitpack_d ,
unsigned  HOST_WIDE_INT 
)
In data-streamer.c   
const char* bp_unpack_indexed_string ( struct data_in data_in,
struct bitpack_d bp,
unsigned int *  rlen 
)
Read a string from the string table in DATA_IN using the bitpack BP.
   Write the length to RLEN.   

References bp_unpack_var_len_unsigned(), and string_for_index().

Referenced by bp_unpack_string().

static HOST_WIDE_INT bp_unpack_int_in_range ( struct bitpack_d bp,
const char *  purpose,
HOST_WIDE_INT  min,
HOST_WIDE_INT  max 
)
inlinestatic
Input VAL into BP and verify it is in range MIN...MAX that is supposed
   to be compile time constant.  PURPOSE is used for error reporting.   

References bp_unpack_value(), floor_log2(), HOST_WIDE_INT, and lto_value_range_error().

const char* bp_unpack_string ( struct data_in ,
struct bitpack_d  
)
HOST_WIDE_INT bp_unpack_var_len_int ( struct bitpack_d )
unsigned HOST_WIDE_INT bp_unpack_var_len_unsigned ( struct bitpack_d )
gcov_type streamer_read_gcov_count ( struct lto_input_block )
HOST_WIDE_INT streamer_read_hwi ( struct lto_input_block )
static HOST_WIDE_INT streamer_read_hwi_in_range ( struct lto_input_block ib,
const char *  purpose,
HOST_WIDE_INT  min,
HOST_WIDE_INT  max 
)
inlinestatic
Input VAL into OBS and verify it is in range MIN...MAX that is supposed
   to be compile time constant.  PURPOSE is used for error reporting.   

References HOST_WIDE_INT, lto_value_range_error(), and streamer_read_uhwi().

const char* streamer_read_indexed_string ( struct data_in data_in,
struct lto_input_block ib,
unsigned int *  rlen 
)
Read a string from the string table in DATA_IN using input block
   IB.  Write the length to RLEN.   

References streamer_read_uhwi(), and string_for_index().

Referenced by input_identifier(), streamer_read_string(), and streamer_read_string_cst().

static enum LTO_tags streamer_read_record_start ( )
inlinestatic
const char* streamer_read_string ( struct data_in ,
struct lto_input_block  
)
static unsigned char streamer_read_uchar ( )
inlinestatic
unsigned HOST_WIDE_INT streamer_read_uhwi ( struct lto_input_block )
unsigned streamer_string_index ( struct output_block ob,
const char *  s,
unsigned int  len,
bool  persistent 
)
@verbatim Routines for saving various data types to a file stream.  This deals

with various data types like strings, integers, enums, etc.

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/.

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, Allocator >::find_slot(), len, string_slot::len, lto_output_data_stream(), memcpy(), output_block::obstack, string_slot::s, string_slot::slot_num, 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(), lto_output_location(), and streamer_write_string_with_length().

void streamer_write_gcov_count ( struct output_block ,
gcov_type   
)
void streamer_write_gcov_count_stream ( struct lto_output_stream ,
gcov_type   
)
void streamer_write_hwi ( struct output_block ,
HOST_WIDE_INT   
)
static void streamer_write_hwi_in_range ( struct lto_output_stream obs,
HOST_WIDE_INT  min,
HOST_WIDE_INT  max,
HOST_WIDE_INT  val 
)
inlinestatic
Output VAL into OBS and verify it is in range MIN...MAX that is supposed
   to be compile time constant.
   Be host independent, limit range to 31bits.   

References HOST_WIDE_INT, and streamer_write_uhwi_stream().

void streamer_write_hwi_stream ( struct lto_output_stream ,
HOST_WIDE_INT   
)
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(), streamer_write_string_with_length(), and strlen().

Referenced by output_gimple_stmt(), and streamer_write_builtin().

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 streamer_string_index(), streamer_write_char_stream(), and streamer_write_uhwi_stream().

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

void streamer_write_uhwi ( struct output_block ,
unsigned  HOST_WIDE_INT 
)
void streamer_write_zero ( struct output_block )
In data-streamer-out.c   
const char* string_for_index ( struct data_in ,
unsigned  int,
unsigned int *   
)
In data-streamer-in.c   

Variable Documentation

unsigned const BITS_PER_BITPACK_WORD = HOST_BITS_PER_WIDE_INT
static
Data structures used to pack values and bitflags into a vector of
   words.  Used to stream values of a fixed number of bits in a space
   efficient way.   

Referenced by bp_pack_value(), and bp_unpack_value().