|
GCC Middle and Back End API Reference
|

Public Member Functions | |
| string_table () | |
| ~string_table () | |
| int | get_index (const char *name) const |
| int | get_index_by_decl (tree decl) const |
| const char * | get_symbol_name (int index) const |
| const char * | get_filename (int index) const |
| int | get_filename_by_symbol (int index) const |
| int | get_filename_by_symbol (const char *name) const |
| int | get_filename_index (const char *name) const |
| std::pair< const char *, int > | get_original_name (const char *name) const |
| bool | read () |
| size_t | num_entries () |
| int | add_symbol_name (const char *string, int filename_idx) |
| int | add_filename (const char *name) |
| cgraph_node * | get_cgraph_node (int) |
Static Public Attributes | |
| static const int | unknown_filename = -1 |
Private Types | |
| typedef std::map< const char *, unsigned, string_compare > | string_index_map |
| typedef std::map< const char *, auto_vec< unsigned >, string_compare > | clashing_name_map |
| typedef std::map< const char *, char *, string_compare > | string_string_map |
Store a string array, indexed by string position in the array.
|
private |
|
private |
|
private |
|
inline |
| autofdo::string_table::~string_table | ( | ) |
Member functions for string_table.
Deconstructor.
References filenames_, free(), i, original_names_map_, and symbol_names_.
| int autofdo::string_table::add_filename | ( | const char * | name | ) |
Add new filename and return its index (returning the same if it already exists).
References filename_map_, and filenames_.
| int autofdo::string_table::add_symbol_name | ( | const char * | string, |
| int | filename_idx ) |
Add new symbol name STRING (with an associated file name FILENAME_IDX) and return its index.
References filenames_, gcc_checking_assert, symbol_name_map_, symbol_names_, symbol_to_filename_map_, and unknown_filename.
| cgraph_node * autofdo::string_table::get_cgraph_node | ( | int | name_index | ) |
Return cgraph node corresponding to given NAME_INDEX, NULL if unavailable.
References dyn_cast(), cgraph_node::get_for_asmname(), get_identifier(), get_symbol_name(), and NULL.
| const char * autofdo::string_table::get_filename | ( | int | index | ) | const |
For a given index, returns the string.
References fatal_error(), filenames_, unknown_filename, and UNKNOWN_LOCATION.
Referenced by get_original_name().
| int autofdo::string_table::get_filename_by_symbol | ( | const char * | name | ) | const |
For a given function name, returns the filename index.
References filenames_, symbol_to_filename_map_, and unknown_filename.
| int autofdo::string_table::get_filename_by_symbol | ( | int | index | ) | const |
For a given symbol name index, returns the filename index.
References get_filename_by_symbol(), and get_symbol_name().
Referenced by get_filename_by_symbol(), and get_original_name().
| int autofdo::string_table::get_filename_index | ( | const char * | name | ) | const |
For a given filename, returns the index.
References filename_map_, and unknown_filename.
| int autofdo::string_table::get_index | ( | const char * | name | ) | const |
Return the index of a given function NAME. Return -1 if NAME is not found in string table.
References NULL, and symbol_name_map_.
Referenced by get_index_by_decl().
| int autofdo::string_table::get_index_by_decl | ( | tree | decl | ) | const |
Return the index of a given function DECL. Return -1 if DECL is not found in string table.
References DECL_ABSTRACT_ORIGIN, DECL_FROM_INLINE, get_index(), get_index_by_decl(), and autofdo::raw_symbol_name().
Referenced by get_index_by_decl().
| std::pair< const char *, int > autofdo::string_table::get_original_name | ( | const char * | name | ) | const |
Get the original name and file name index for a node. This will return the name from the current TU if there are multiple symbols that map to NAME.
References clashing_names_map_, DECL_SOURCE_FILE, dyn_cast(), gcc_checking_assert, get_filename(), get_filename_by_symbol(), cgraph_node::get_for_asmname(), get_identifier(), autofdo::get_normalized_path(), is_a(), and original_names_map_.
| const char * autofdo::string_table::get_symbol_name | ( | int | index | ) | const |
Return the function name of a given INDEX.
References fatal_error(), symbol_names_, and UNKNOWN_LOCATION.
Referenced by get_cgraph_node(), and get_filename_by_symbol().
|
inline |
References symbol_names_.
| bool autofdo::string_table::read | ( | ) |
Read the string table. Return TRUE if reading is successful.
References clashing_names_map_, filename_map_, filenames_, free(), gcov_is_error(), gcov_read_string(), gcov_read_unsigned(), GCOV_TAG_AFDO_FILE_NAMES, autofdo::get_normalized_path(), autofdo::get_original_name(), i, original_names_map_, symbol_name_map_, symbol_names_, and symbol_to_filename_map_.
|
private |
Referenced by get_original_name(), and read().
|
private |
Referenced by add_filename(), get_filename_index(), and read().
|
private |
Referenced by add_filename(), add_symbol_name(), get_filename(), get_filename_by_symbol(), read(), and ~string_table().
|
private |
Referenced by get_original_name(), read(), and ~string_table().
|
private |
Referenced by add_symbol_name(), get_index(), and read().
|
private |
Referenced by add_symbol_name(), get_symbol_name(), num_entries(), read(), and ~string_table().
|
private |
Referenced by add_symbol_name(), get_filename_by_symbol(), and read().
|
static |