GCC Middle and Back End API Reference
string_concat_db Class Reference

#include <input.h>

Collaboration diagram for string_concat_db:

Public Member Functions

 string_concat_db ()
 
void record_string_concatenation (int num, location_t *locs)
 
bool get_string_concatenation (location_t loc, int *out_num, location_t **out_locs)
 

Private Member Functions

friend void::gt_ggc_mx_string_concat_db (void *x_p)
 
friend void::gt_pch_nx_string_concat_db (void *x_p)
 
friend void::gt_pch_p_16string_concat_db (void *this_obj, void *x_p, gt_pointer_operator op, void *cookie)
 

Static Private Member Functions

static location_t get_key_loc (location_t loc)
 

Private Attributes

hash_map< location_hash, string_concat * > * m_table
 

Constructor & Destructor Documentation

◆ string_concat_db()

string_concat_db::string_concat_db ( )
string_concat_db's constructor.   

References ggc_alloc(), and m_table.

Member Function Documentation

◆ get_key_loc()

location_t string_concat_db::get_key_loc ( location_t loc)
staticprivate
Internal function.  Canonicalize LOC into a form suitable for
use as a key within the database, stripping away macro expansion,
ad-hoc information, and range information, using the location of
the start of LOC within an ordinary linemap.   

References ggc_alloc(), line_table, and NULL.

Referenced by get_string_concatenation(), and record_string_concatenation().

◆ get_string_concatenation()

bool string_concat_db::get_string_concatenation ( location_t loc,
int * out_num,
location_t ** out_locs )
Determine if LOC was the location of the initial token of a
concatenation of string literal tokens.
If so, *OUT_NUM is written to with the number of tokens, and
*OUT_LOCS with the location of an array of locations of the
tokens, and return true.  *OUT_LOCS is a borrowed pointer to
storage owned by the string_concat_db.
Otherwise, return false.   

References gcc_assert, hash_map< KeyId, Value, Traits >::get(), get_key_loc(), ggc_alloc(), m_table, and RESERVED_LOCATION_P.

◆ record_string_concatenation()

void string_concat_db::record_string_concatenation ( int num,
location_t * locs )
Record that a string concatenation occurred, covering NUM
string literal tokens.  LOCS is an array of size NUM, containing the
locations of the tokens.  A copy of LOCS is taken.   

References gcc_assert, get_key_loc(), ggc_alloc(), m_table, hash_map< KeyId, Value, Traits >::put(), and RESERVED_LOCATION_P.

◆ void::gt_ggc_mx_string_concat_db()

string_concat_db::void::gt_ggc_mx_string_concat_db ( void * x_p)
private

◆ void::gt_pch_nx_string_concat_db()

string_concat_db::void::gt_pch_nx_string_concat_db ( void * x_p)
private

◆ void::gt_pch_p_16string_concat_db()

string_concat_db::void::gt_pch_p_16string_concat_db ( void * this_obj,
void * x_p,
gt_pointer_operator op,
void * cookie )
private

Field Documentation

◆ m_table


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