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:

protected Symtab

Method Overview

Inherited from InstrProfReader:

Methods

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&)

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:209

Parameters

const llvm::TextInstrProfReader&

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

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()

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

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:219

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

Description

Return true if the profile has single byte counters representing coverage.

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:228

bool instrEntryBBEnabled() const

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:223

bool isIRLevelProfile() const

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:215

llvm::Error readHeader()

Description

Read the header.

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:239

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)

Declared at: llvm/include/llvm/ProfileData/InstrProfReader.h:204

Parameters

llvm::InstrProfRecord& Record