GCC Middle and Back End API Reference
lto_location_cache Class Reference

#include <lto-streamer.h>

Collaboration diagram for lto_location_cache:

Data Structures

struct  cached_location

Public Member Functions

bool apply_location_cache ()
void accept_location_cache ()
void revert_location_cache ()
void input_location (location_t *dest, struct bitpack_d *bp, class data_in *data_in)
void input_location_and_block (location_t *dest, struct bitpack_d *bp, class lto_input_block *ib, class data_in *data_in)
void set_linemap_offset (unsigned offset)
 lto_location_cache (lto_file_decl_data *loc_data)
 ~lto_location_cache ()

Static Public Attributes

static lto_location_cachecurrent_cache

Private Attributes

lto_file_decl_data *const decl_data
const lto_loc_mapcur_loc_map = nullptr
unsigned linemap_offset = 0
auto_vec< cached_locationloc_cache
tree stream_block = NULL_TREE
unsigned stream_discr = 0
size_t stream_map_idx = 0
location_t stream_loc_offset = 0
cached_location current_cloc = {}
location_t current_loc = UNKNOWN_LOCATION
unsigned accepted_length = 0

Detailed Description

The location cache holds the ancillary data for streamed in trees.  This is
done to reduce memory usage in the libcpp linemap; we don't need to create an
adhoc location and store the ancillary data if the tree ends up being
merged.   

Constructor & Destructor Documentation

◆ lto_location_cache()

lto_location_cache::lto_location_cache ( lto_file_decl_data * loc_data)
inlineexplicit

References current_cache, decl_data, and gcc_assert.

◆ ~lto_location_cache()

lto_location_cache::~lto_location_cache ( )
inline

Member Function Documentation

◆ accept_location_cache()

void lto_location_cache::accept_location_cache ( )
Tree merging did not succeed; mark all changes in the cache as accepted.   

References accepted_length, current_cache, gcc_assert, and loc_cache.

◆ apply_location_cache()

bool lto_location_cache::apply_location_cache ( )
Apply all changes in location cache.  Add locations into linemap and patch
trees.   

References accepted_length, current_cloc, current_loc, line_table, and loc_cache.

Referenced by input_function(), ipa_odr_read_section(), lto_input_ts_exp_tree_pointers(), lto_read_body_or_constructor(), and ~lto_location_cache().

◆ input_location()

void lto_location_cache::input_location ( location_t * dest,
struct bitpack_d * bp,
class data_in * data_in )

References input_location_and_block(), and NULL.

Referenced by lto_input_location().

◆ input_location_and_block()

void lto_location_cache::input_location_and_block ( location_t * dest,
struct bitpack_d * bp,
class lto_input_block * ib,
class data_in * data_in )

◆ revert_location_cache()

void lto_location_cache::revert_location_cache ( )
Tree merging did succeed; throw away recent changes.   

References accepted_length, and loc_cache.

Referenced by ipa_odr_read_section().

◆ set_linemap_offset()

void lto_location_cache::set_linemap_offset ( unsigned offset)
inline

References linemap_offset.

Referenced by lto_read_body_or_constructor().

Field Documentation

◆ accepted_length

unsigned lto_location_cache::accepted_length = 0
private

◆ cur_loc_map

const lto_loc_map* lto_location_cache::cur_loc_map = nullptr
private

◆ current_cache

lto_location_cache * lto_location_cache::current_cache
static
Pointer to currently alive instance of lto_location_cache.   

Referenced by accept_location_cache(), add_type_duplicate(), lto_location_cache(), warn_odr(), and ~lto_location_cache().

◆ current_cloc

cached_location lto_location_cache::current_cloc = {}
private

◆ current_loc

location_t lto_location_cache::current_loc = UNKNOWN_LOCATION
private

◆ decl_data

lto_file_decl_data* const lto_location_cache::decl_data
private

◆ linemap_offset

unsigned lto_location_cache::linemap_offset = 0
private

◆ loc_cache

◆ stream_block

tree lto_location_cache::stream_block = NULL_TREE
private

◆ stream_discr

unsigned lto_location_cache::stream_discr = 0
private

◆ stream_loc_offset

location_t lto_location_cache::stream_loc_offset = 0
private

◆ stream_map_idx

size_t lto_location_cache::stream_map_idx = 0
private

The documentation for this class was generated from the following files: