class InstrProfReader

Declaration

class InstrProfReader { /* full declaration omitted */ };

Description

Base class and interface for reading profiling data of any known instrprof format. Provides an iterator over NamedInstrProfRecords.

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

Member Variables

protected std::unique_ptr<InstrProfSymtab> Symtab

Method Overview

Methods

InstrProfReader()

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

void accumulateCounts(
    llvm::CountSumOrPercent& Sum,
    bool IsCS)

Description

Compute the sum of counts and return in Sum.

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

Parameters

llvm::CountSumOrPercent& Sum
bool IsCS

llvm::InstrProfIterator begin()

Description

Iterator over profile data.

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

static Expected<std::unique_ptr<InstrProfReader>>
create(std::unique_ptr<MemoryBuffer> Buffer)

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

Parameters

std::unique_ptr<MemoryBuffer> Buffer

static Expected<std::unique_ptr<InstrProfReader>>
create(const llvm::Twine& Path)

Description

Factory method to create an appropriately typed reader for the given instrprof file.

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

Parameters

const llvm::Twine& Path

llvm::InstrProfIterator end()

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

llvm::Error error(llvm::instrprof_error Err)

Description

Set the current error and return same.

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

Parameters

llvm::instrprof_error Err

llvm::Error error(llvm::Error&& E)

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

Parameters

llvm::Error&& E

llvm::Error getError()

Description

Get the current error.

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

virtual 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:92

virtual bool hasCSIRLevelProfile() const

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

bool hasError()

Description

Return true if the reader encountered an error reading profiling data.

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

bool isEOF()

Description

Return true if the reader has finished reading the profile data.

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

virtual bool isIRLevelProfile() const

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

virtual llvm::Error readHeader()

Description

Read the header. Required before reading first record.

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

virtual llvm::Error readNextRecord(
    llvm::NamedInstrProfRecord& Record)

Description

Read a single record.

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

Parameters

llvm::NamedInstrProfRecord& Record

llvm::Error success()

Description

Clear the current error and return a successful one.

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

virtual ~InstrProfReader()

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