LLVM API Documentation
Reader for the indexed binary instrprof format. More...
#include <InstrProfReader.h>
Public Member Functions | |
IndexedInstrProfReader (std::unique_ptr< MemoryBuffer > DataBuffer) | |
std::error_code | readHeader () override |
Read the file header. | |
std::error_code | readNextRecord (InstrProfRecord &Record) override |
Read a single record. | |
std::error_code | getFunctionCounts (StringRef FuncName, uint64_t FuncHash, std::vector< uint64_t > &Counts) |
Fill Counts with the profile data for the given function name. | |
uint64_t | getMaximumFunctionCount () |
Return the maximum of all known function counts. | |
Static Public Member Functions | |
static bool | hasFormat (const MemoryBuffer &DataBuffer) |
Return true if the given buffer is in an indexed instrprof format. | |
static std::error_code | create (std::string Path, std::unique_ptr< IndexedInstrProfReader > &Result) |
Factory method to create an indexed reader. |
Reader for the indexed binary instrprof format.
Definition at line 262 of file InstrProfReader.h.
llvm::IndexedInstrProfReader::IndexedInstrProfReader | ( | std::unique_ptr< MemoryBuffer > | DataBuffer | ) | [inline] |
Definition at line 281 of file InstrProfReader.h.
std::error_code IndexedInstrProfReader::create | ( | std::string | Path, |
std::unique_ptr< IndexedInstrProfReader > & | Result | ||
) | [static] |
Factory method to create an indexed reader.
Definition at line 64 of file InstrProfReader.cpp.
References llvm::bad_magic, hasFormat(), initializeReader(), and setupMemoryBuffer().
std::error_code IndexedInstrProfReader::getFunctionCounts | ( | StringRef | FuncName, |
uint64_t | FuncHash, | ||
std::vector< uint64_t > & | Counts | ||
) |
Fill Counts with the profile data for the given function name.
Definition at line 336 of file InstrProfReader.cpp.
References llvm::InstrProfReader::error(), llvm::hash_mismatch, I, llvm::malformed, llvm::ArrayRef< T >::size(), llvm::ArrayRef< T >::slice(), llvm::InstrProfReader::success(), and llvm::unknown_function.
uint64_t llvm::IndexedInstrProfReader::getMaximumFunctionCount | ( | ) | [inline] |
Return the maximum of all known function counts.
Definition at line 296 of file InstrProfReader.h.
bool IndexedInstrProfReader::hasFormat | ( | const MemoryBuffer & | DataBuffer | ) | [static] |
Return true if the given buffer is in an indexed instrprof format.
Definition at line 289 of file InstrProfReader.cpp.
References llvm::MemoryBuffer::getBufferSize(), llvm::MemoryBuffer::getBufferStart(), and Magic.
Referenced by llvm::InstrProfReader::create(), and create().
std::error_code IndexedInstrProfReader::readHeader | ( | ) | [override, virtual] |
Read the file header.
Implements llvm::InstrProfReader.
Definition at line 298 of file InstrProfReader.cpp.
References llvm::bad_magic, llvm::OnDiskIterableChainedHashTable< Info >::Create(), llvm::InstrProfReader::error(), llvm::IndexedInstrProf::HashType, llvm::IndexedInstrProf::Last, llvm::IndexedInstrProf::Magic, llvm::InstrProfReader::success(), llvm::truncated, llvm::unsupported_hash_type, llvm::unsupported_version, and llvm::IndexedInstrProf::Version.
std::error_code IndexedInstrProfReader::readNextRecord | ( | InstrProfRecord & | Record | ) | [override, virtual] |
Read a single record.
Implements llvm::InstrProfReader.
Definition at line 365 of file InstrProfReader.cpp.
References llvm::InstrProfRecord::Counts, llvm::eof, llvm::InstrProfReader::error(), llvm::InstrProfRecord::Hash, llvm::malformed, llvm::InstrProfRecord::Name, llvm::ArrayRef< T >::size(), llvm::ArrayRef< T >::slice(), and llvm::InstrProfReader::success().