LLVM: llvm::InstrProfSymtab Class Reference (original) (raw)

A symbol table used for function [IR]PGO name look-up with keys (such as pointers, md5hash values) to the function. More...

#include "[llvm/ProfileData/InstrProf.h](InstrProf%5F8h%5Fsource.html)"

Public Member Functions
InstrProfSymtab ()
InstrProfSymtab (const InstrProfSymtab &)=delete
InstrProfSymtab & operator= (const InstrProfSymtab &)=delete
InstrProfSymtab (InstrProfSymtab &&)=delete
InstrProfSymtab & operator= (InstrProfSymtab &&)=delete
LLVM_ABI Error create (object::SectionRef &Section)
Create InstrProfSymtab from an object file section which contains function PGO names.
LLVM_ABI Error create (StringRef NameStrings)
NameStrings is a string composed of one of more sub-strings encoded in the format described in collectPGOFuncNameStrings.
LLVM_ABI Error create (StringRef FuncNameStrings, StringRef VTableNameStrings)
Initialize symtab states with function names and vtable names.
LLVM_ABI Error initVTableNamesFromCompressedStrings (StringRef CompressedVTableNames)
Initialize 'this' with the set of vtable names encoded in CompressedVTableNames.
Error create (StringRef D, uint64_t BaseAddr)
This interface is used by reader of CoverageMapping test format.
LLVM_ABI Error create (Module &M, bool InLTO=false, bool AddCanonical=true)
A wrapper interface to populate the PGO symtab with functions decls from module M.
template
Error create (const NameIterRange &IterRange)
Create InstrProfSymtab from a set of names iteratable from IterRange.
template<typename FuncNameIterRange, typename VTableNameIterRange>
Error create (const FuncNameIterRange &FuncIterRange, const VTableNameIterRange &VTableIterRange)
Create InstrProfSymtab from a set of function names and vtable names iteratable from IterRange.
Error addSymbolName (StringRef SymbolName)
Error addFuncName (StringRef FuncName)
The method name is kept since there are many callers.
Error addVTableName (StringRef VTableName)
Adds VTableName as a known symbol, and inserts it to a map that tracks all vtable names.
const std::vector< std::pair< uint64_t, Function * > > & getIDToNameMap () const
const StringSet & getVTableNames () const
void mapAddress (uint64_t Addr, uint64_t MD5Val)
Map a function address to its name's MD5 hash.
void mapVTableAddress (uint64_t StartAddr, uint64_t EndAddr, uint64_t MD5Val)
Map the address range (i.e., [start_address, end_address)) of a variable to its names' MD5 hash.
LLVM_ABI uint64_t getFunctionHashFromAddress (uint64_t Address) const
Return a function's hash, or 0, if the function isn't in this SymTab.
LLVM_ABI uint64_t getVTableHashFromAddress (uint64_t Address) const
Return a vtable's hash, or 0 if the vtable doesn't exist in this SymTab.
LLVM_ABI StringRef getFuncName (uint64_t FuncNameAddress, size_t NameSize) const
Return function's PGO name from the function name's symbol address in the object file.
StringRef getFuncOrVarName (uint64_t ValMD5Hash) const
Return name of functions or global variables from the name's md5 hash value.
StringRef getFuncOrVarNameIfDefined (uint64_t ValMD5Hash) const
Just like getFuncOrVarName, except that it will return literal string 'External Symbol' if the function or global variable is external to this symbol table.
Function * getFunction (uint64_t FuncMD5Hash) const
Return function from the name's md5 hash. Return nullptr if not found.
GlobalVariable * getGlobalVariable (uint64_t MD5Hash) const
Return the global variable corresponding to md5 hash.
StringRef getNameData () const
Return the name section data.
LLVM_ABI void dumpNames (raw_ostream &OS) const
Dump the symbols in this table.

A symbol table used for function [IR]PGO name look-up with keys (such as pointers, md5hash values) to the function.

A function's [IR]PGO name or name's md5hash are used in retrieving the profile data of the function. See [getIRPGOFuncName()](namespacellvm.html#a1b3e6af13e7130b5bd9994948ec48ccd) and getPGOFuncName methods for details how [IR]PGO name is formed.

Definition at line 505 of file InstrProf.h.

AddrHashMap

llvm::InstrProfSymtab::InstrProfSymtab ( ) inline

InstrProfSymtab() [2/3]

InstrProfSymtab() [3/3]

addFuncName()

addSymbolName()

Error llvm::InstrProfSymtab::addSymbolName ( StringRef SymbolName) inline

addVTableName()

Error llvm::InstrProfSymtab::addVTableName ( StringRef VTableName) inline

create() [1/7]

template<typename FuncNameIterRange, typename VTableNameIterRange>

Error llvm::InstrProfSymtab::create ( const FuncNameIterRange & FuncIterRange,
const VTableNameIterRange & VTableIterRange )

create() [2/7]

template

Error llvm::InstrProfSymtab::create ( const NameIterRange & IterRange )

create() [3/7]

Error llvm::InstrProfSymtab::create ( Module & M,
bool InLTO = false,
bool AddCanonical = true )

create() [4/7]

create() [5/7]

create() [6/7]

Initialize symtab states with function names and vtable names.

FuncNameStrings is a string composed of one or more encoded function name strings, and VTableNameStrings composes of one or more encoded vtable names. This interface is solely used by raw profile reader.

Definition at line 624 of file InstrProf.cpp.

References addFuncName(), addVTableName(), and llvm::readAndDecodeStrings().

create() [7/7]

dumpNames()

void llvm::InstrProfSymtab::dumpNames ( raw_ostream & OS ) const

getCanonicalName()

getFuncName()

StringRef InstrProfSymtab::getFuncName ( uint64_t FuncNameAddress,
size_t NameSize ) const

Return function's PGO name from the function name's symbol address in the object file.

If an error occurs, return an empty string.

Definition at line 522 of file CoverageMappingReader.cpp.

References llvm::Offset, and Size.

getFuncOrVarName()

StringRef llvm::InstrProfSymtab::getFuncOrVarName ( uint64_t ValMD5Hash) const inline

getFuncOrVarNameIfDefined()

StringRef llvm::InstrProfSymtab::getFuncOrVarNameIfDefined ( uint64_t ValMD5Hash) const inline

getFunction()

Function * llvm::InstrProfSymtab::getFunction ( uint64_t FuncMD5Hash) const inline

getFunctionHashFromAddress()

uint64_t llvm::InstrProfSymtab::getFunctionHashFromAddress ( uint64_t Address ) const

getGlobalVariable()

getIDToNameMap()

const std::vector< std::pair< uint64_t, Function * > > & llvm::InstrProfSymtab::getIDToNameMap ( ) const inline

getNameData()

StringRef llvm::InstrProfSymtab::getNameData ( ) const inline

Return the name section data.

Definition at line 720 of file InstrProf.h.

getVTableHashFromAddress()

uint64_t llvm::InstrProfSymtab::getVTableHashFromAddress ( uint64_t Address ) const

Return a vtable's hash, or 0 if the vtable doesn't exist in this SymTab.

Definition at line 687 of file InstrProf.cpp.

getVTableNames()

const StringSet & llvm::InstrProfSymtab::getVTableNames ( ) const inline

initVTableNamesFromCompressedStrings()

Error llvm::InstrProfSymtab::initVTableNamesFromCompressedStrings ( StringRef CompressedVTableNames )

isExternalSymbol()

True if Symbol is the value used to represent external symbols.

Definition at line 708 of file InstrProf.h.

mapAddress()

Map a function address to its name's MD5 hash.

This interface is only used by the raw profiler reader.

Definition at line 675 of file InstrProf.h.

mapVTableAddress()

Map the address range (i.e., [start_address, end_address)) of a variable to its names' MD5 hash.

This interface is only used by the raw profile reader.

Definition at line 682 of file InstrProf.h.

operator=() [1/2]

operator=() [2/2]


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