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 *loc, struct bitpack_d *bp, class data_in *data_in)
 
void input_location_and_block (location_t *loc, struct bitpack_d *bp, class lto_input_block *ib, class data_in *data_in)
 
 lto_location_cache ()
 
 ~lto_location_cache ()
 

Static Public Attributes

static lto_location_cachecurrent_cache
 

Static Private Member Functions

static int cmp_loc (const void *pa, const void *pb)
 

Private Attributes

auto_vec< cached_locationloc_cache
 
int accepted_length
 
const char * current_file
 
int current_line
 
int current_col
 
bool current_sysp
 
location_t current_loc
 
tree current_block
 
unsigned current_discr
 

Detailed Description

The location cache holds expanded locations for streamed in trees.
This is done to reduce memory usage of libcpp linemap that strongly prefers
locations to be inserted in the source order.   

Constructor & Destructor Documentation

◆ lto_location_cache()

lto_location_cache::lto_location_cache ( )
inline

References current_cache, 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()

◆ cmp_loc()

int lto_location_cache::cmp_loc ( const void * pa,
const void * pb )
staticprivate
Sort locations in source order. Start with file from last application.   

References a, b, BLOCK_NUMBER, current_cache, current_file, current_line, and NULL_TREE.

Referenced by apply_location_cache().

◆ input_location()

void lto_location_cache::input_location ( location_t * loc,
struct bitpack_d * bp,
class data_in * data_in )
Read a location bitpack from bit pack BP and either update *LOC directly
or add it to the location cache.
It is neccesary to call apply_location_cache to get *LOC updated.   

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 * loc,
struct bitpack_d * bp,
class lto_input_block * ib,
class data_in * data_in )
Read a location bitpack from bit pack BP and either update *LOC directly
or add it to the location cache.  If IB is non-NULL, stream in a block
afterwards.
It is neccesary to call apply_location_cache to get *LOC updated.   

References bp_unpack_int_in_range(), bp_unpack_string(), bp_unpack_value(), bp_unpack_var_len_unsigned(), canon_file_name(), canon_relative_path_prefix(), current_block, current_cache, current_col, current_discr, current_file, current_line, current_loc, current_sysp, gcc_assert, get_src_pwd(), loc_cache, LOCATION_LOCUS, NULL, NULL_TREE, set_block(), src_pwd, and stream_read_tree.

Referenced by input_cfg(), input_gimple_stmt(), input_location(), and input_phi().

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

Field Documentation

◆ accepted_length

int lto_location_cache::accepted_length
private

◆ current_block

tree lto_location_cache::current_block
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(), cmp_loc(), input_location_and_block(), lto_location_cache(), warn_odr(), and ~lto_location_cache().

◆ current_col

int lto_location_cache::current_col
private

◆ current_discr

unsigned lto_location_cache::current_discr
private

◆ current_file

const char* lto_location_cache::current_file
private

◆ current_line

int lto_location_cache::current_line
private

◆ current_loc

location_t lto_location_cache::current_loc
private

◆ current_sysp

bool lto_location_cache::current_sysp
private

◆ loc_cache


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