class TextInstrProfReader
Declaration
class TextInstrProfReader : public InstrProfReader { /* full declaration omitted */ };
Description
Reader for the simple text based instrprof format. This format is a simple text format that's suitable for test data. Records are separated by one or more blank lines, and record fields are separated by new lines. Each record consists of a function name, a function hash, a number of counters, and then each counter value, in that order.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:195
Inherits from: InstrProfReader
Member Variables
- private std::unique_ptr<MemoryBuffer> DataBuffer
- The profile data file contents.
- private llvm::line_iterator Line
- Iterator over the profile data.
- private llvm::InstrProfKind ProfileKind = InstrProfKind::Unknown
- The attributes of the current profile.
Inherited from InstrProfReader:
Method Overview
- public TextInstrProfReader(std::unique_ptr<MemoryBuffer> DataBuffer_)
- public TextInstrProfReader(const llvm::TextInstrProfReader &)
- public bool functionEntryOnly() const
- public llvm::InstrProfKind getProfileKind() const
- public llvm::InstrProfSymtab & getSymtab()
- public bool hasCSIRLevelProfile() const
- public static bool hasFormat(const llvm::MemoryBuffer & Buffer)
- public bool hasSingleByteCoverage() const
- public bool instrEntryBBEnabled() const
- public bool isIRLevelProfile() const
- public llvm::Error readHeader()
- public llvm::Error readNextRecord(llvm::NamedInstrProfRecord & Record)
- private llvm::Error readValueProfileData(llvm::InstrProfRecord & Record)
Inherited from InstrProfReader:
- public accumulateCounts
- public begin
- public create
- public create
- public end
- protected error
- protected error
- public functionEntryOnly
- public getError
- public getProfileKind
- public getSymtab
- public hasCSIRLevelProfile
- public hasError
- public hasSingleByteCoverage
- public instrEntryBBEnabled
- public isEOF
- public isIRLevelProfile
- public printBinaryIds
- public readHeader
- public readNextRecord
- protected success
- public useDebugInfoCorrelate
Methods
¶TextInstrProfReader(
std::unique_ptr<MemoryBuffer> DataBuffer_)
TextInstrProfReader(
std::unique_ptr<MemoryBuffer> DataBuffer_)
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:207
Parameters
- std::unique_ptr<MemoryBuffer> DataBuffer_
¶TextInstrProfReader(
const llvm::TextInstrProfReader&)
TextInstrProfReader(
const llvm::TextInstrProfReader&)
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:209
Parameters
- const llvm::TextInstrProfReader&
¶bool functionEntryOnly() const
bool functionEntryOnly() const
Description
Return true if the profile only instruments function entries.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:232
¶llvm::InstrProfKind getProfileKind() const
llvm::InstrProfKind getProfileKind() const
Description
Returns a BitsetEnum describing the attributes of the profile. To check individual attributes prefer using the helpers above.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:236
¶llvm::InstrProfSymtab& getSymtab()
llvm::InstrProfSymtab& getSymtab()
Description
Return the PGO symtab. There are three different readers: Raw, Text, and Indexed profile readers. The first two types of readers are used only by llvm-profdata tool, while the indexed profile reader is also used by llvm-cov tool and the compiler ( backend or frontend). Since creating PGO symtab can create significant runtime and memory overhead (as it touches data for the whole program), InstrProfSymtab for the indexed profile reader should be created on demand and it is recommended to be only used for dumping purpose with llvm-proftool, not with the compiler.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:244
¶bool hasCSIRLevelProfile() const
bool hasCSIRLevelProfile() const
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:219
¶static bool hasFormat(
const llvm::MemoryBuffer& Buffer)
static bool hasFormat(
const llvm::MemoryBuffer& Buffer)
Description
Return true if the given buffer is in text instrprof format.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:213
Parameters
- const llvm::MemoryBuffer& Buffer
¶bool hasSingleByteCoverage() const
bool hasSingleByteCoverage() const
Description
Return true if the profile has single byte counters representing coverage.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:228
¶bool instrEntryBBEnabled() const
bool instrEntryBBEnabled() const
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:223
¶bool isIRLevelProfile() const
bool isIRLevelProfile() const
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:215
¶llvm::Error readHeader()
llvm::Error readHeader()
Description
Read the header.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:239
¶llvm::Error readNextRecord(
llvm::NamedInstrProfRecord& Record)
llvm::Error readNextRecord(
llvm::NamedInstrProfRecord& Record)
Description
Read a single record.
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:242
Parameters
- llvm::NamedInstrProfRecord& Record
¶llvm::Error readValueProfileData(
llvm::InstrProfRecord& Record)
llvm::Error readValueProfileData(
llvm::InstrProfRecord& Record)
Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:204
Parameters
- llvm::InstrProfRecord& Record