|
LLVM
3.7.0
|
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. More... | |
| std::error_code | readNextRecord (InstrProfRecord &Record) override |
| Read a single record. More... | |
| 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. More... | |
| uint64_t | getMaximumFunctionCount () |
| Return the maximum of all known function counts. More... | |
Public Member Functions inherited from llvm::InstrProfReader | |
| InstrProfReader () | |
| virtual | ~InstrProfReader () |
| InstrProfIterator | begin () |
| Iterator over profile data. More... | |
| InstrProfIterator | end () |
| bool | isEOF () |
| Return true if the reader has finished reading the profile data. More... | |
| bool | hasError () |
| Return true if the reader encountered an error reading profiling data. More... | |
| std::error_code | getError () |
| Get the current error code. More... | |
Static Public Member Functions | |
| static bool | hasFormat (const MemoryBuffer &DataBuffer) |
| Return true if the given buffer is in an indexed instrprof format. More... | |
| static ErrorOr < std::unique_ptr < IndexedInstrProfReader > > | create (std::string Path) |
| Factory method to create an indexed reader. More... | |
| static ErrorOr < std::unique_ptr < IndexedInstrProfReader > > | create (std::unique_ptr< MemoryBuffer > Buffer) |
Static Public Member Functions inherited from llvm::InstrProfReader | |
| static ErrorOr < std::unique_ptr < InstrProfReader > > | create (std::string Path) |
| Factory method to create an appropriately typed reader for the given instrprof file. More... | |
| static ErrorOr < std::unique_ptr < InstrProfReader > > | create (std::unique_ptr< MemoryBuffer > Buffer) |
Additional Inherited Members | |
Protected Member Functions inherited from llvm::InstrProfReader | |
| std::error_code | error (std::error_code EC) |
| Set the current std::error_code and return same. More... | |
| std::error_code | success () |
| Clear the current error code and return a successful one. More... | |
Reader for the indexed binary instrprof format.
Definition at line 234 of file InstrProfReader.h.
|
inline |
Definition at line 250 of file InstrProfReader.h.
|
static |
Factory method to create an indexed reader.
Definition at line 69 of file InstrProfReader.cpp.
References setupMemoryBuffer().
Referenced by llvm::coverage::CoverageMapping::load().
|
static |
Definition at line 79 of file InstrProfReader.cpp.
References llvm::bad_magic, hasFormat(), initializeReader(), and llvm::too_large.
| 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 393 of file InstrProfReader.cpp.
References llvm::Data, llvm::ArrayRef< T >::empty(), error(), fuzzer::Hash(), llvm::hash_mismatch, I, llvm::malformed, llvm::ArrayRef< T >::size(), llvm::success, and llvm::unknown_function.
Referenced by llvm::coverage::CoverageMapping::load().
|
inline |
Return the maximum of all known function counts.
Definition at line 265 of file InstrProfReader.h.
|
static |
Return true if the given buffer is in an indexed instrprof format.
Definition at line 345 of file InstrProfReader.cpp.
References llvm::MemoryBuffer::getBufferSize(), llvm::MemoryBuffer::getBufferStart(), and llvm::IndexedInstrProf::Magic.
Referenced by llvm::InstrProfReader::create(), and create().
|
overridevirtual |
Read the file header.
Implements llvm::InstrProfReader.
Definition at line 354 of file InstrProfReader.cpp.
References llvm::bad_magic, llvm::OnDiskIterableChainedHashTable< Info >::Create(), error(), llvm::InstrProfLookupTrait::InstrProfLookupTrait(), llvm::IndexedInstrProf::Last, llvm::IndexedInstrProf::Magic, llvm::success, llvm::truncated, llvm::unsupported_hash_type, llvm::unsupported_version, and llvm::IndexedInstrProf::Version.
|
overridevirtual |
Read a single record.
Implements llvm::InstrProfReader.
Definition at line 415 of file InstrProfReader.cpp.
References llvm::Data, llvm::eof, error(), llvm::malformed, llvm::ArrayRef< T >::size(), and llvm::success.
1.8.6