GCC Middle and Back End API Reference
autofdo::string_table Class Reference
Collaboration diagram for autofdo::string_table:

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_name (int index) const
bool read ()

Private Types

typedef std::map< const char *, unsigned, string_comparestring_index_map

Private Attributes

string_vector vector_
string_index_map map_

Detailed Description

Store a string array, indexed by string position in the array.   

Member Typedef Documentation

◆ string_index_map

typedef std::map<const char *, unsigned, string_compare> autofdo::string_table::string_index_map

Constructor & Destructor Documentation

◆ string_table()

autofdo::string_table::string_table ( )

◆ ~string_table()

autofdo::string_table::~string_table ( )
Member functions for string_table.   

References free(), i, and vector_.

Member Function Documentation

◆ get_index()

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 map_, and NULL.

Referenced by autofdo::autofdo_source_profile::get_callsite_total_count(), autofdo::function_instance::get_function_instance_by_decl(), and get_index_by_decl().

◆ get_index_by_decl()

◆ get_name()

const char * autofdo::string_table::get_name ( int index) const
Return the function name of a given INDEX.   

References gcc_assert, and vector_.

Referenced by autofdo::afdo_indirect_call(), and autofdo::function_instance::find_icall_target_map().

◆ read()

bool autofdo::string_table::read ( )
Read the string table. Return TRUE if reading is successful.   

References gcov_read_string(), gcov_read_unsigned(), GCOV_TAG_AFDO_FILE_NAMES, autofdo::get_original_name(), i, map_, and vector_.

Referenced by autofdo::read_profile().

Field Documentation

◆ map_

string_index_map autofdo::string_table::map_

Referenced by get_index(), and read().

◆ vector_

string_vector autofdo::string_table::vector_

Referenced by get_name(), read(), and ~string_table().

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