class SampleProfileReaderExtBinary

Declaration

class SampleProfileReaderExtBinary
    : public SampleProfileReaderExtBinaryBase { /* full declaration omitted */ };

Description

SampleProfileReaderExtBinaryBase/SampleProfileWriterExtBinaryBase defines the basic structure of the extensible binary format. The format is organized in sections except the magic and version number at the beginning. There is a section table before all the sections, and each entry in the table describes the entry type, start, size and attributes. The format in each section is defined by the section itself. It is easy to add a new section while maintaining the backward compatibility of the profile. Nothing extra needs to be done. If we want to extend an existing section, like add cache misses information in addition to the sample count in the profile body, we can add a new section with the extension and retire the existing section, and we could choose to keep the parser of the old section if we want the reader to be able to read both new and old format profile. SampleProfileReaderExtBinary/SampleProfileWriterExtBinary define the commonly used sections of a profile in extensible binary format. It is possible to define other types of profile inherited from SampleProfileReaderExtBinaryBase/SampleProfileWriterExtBinaryBase.

Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:610

Inherits from: SampleProfileReaderExtBinaryBase

Member Variables

Inherited from SampleProfileReaderExtBinaryBase:

protected SecHdrTable
protected ProfSymList

Inherited from SampleProfileReaderBinary:

protected Data = nullptr
protected End = nullptr
protected NameTable

Inherited from SampleProfileReader:

protected Profiles
protected Ctx
protected Buffer
protected Summary
protected Remapper
protected Format = SPF_None

Method Overview

Inherited from SampleProfileReaderExtBinaryBase:

Inherited from SampleProfileReaderBinary:

Inherited from SampleProfileReader:

Methods

SampleProfileReaderExtBinary(
    std::unique_ptr<MemoryBuffer> B,
    llvm::LLVMContext& C,
    llvm::sampleprof::SampleProfileFormat Format =
        SPF_Ext_Binary)

Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:628

Parameters

std::unique_ptr<MemoryBuffer> B
llvm::LLVMContext& C
llvm::sampleprof::SampleProfileFormat Format = SPF_Ext_Binary

void collectFuncsFrom(const llvm::Module& M)

Description

Collect functions with definitions in Module \p M.

Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:640

Parameters

const llvm::Module& M

virtual std::unique_ptr<ProfileSymbolList>
getProfileSymbolList()

Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:635

static bool hasFormat(
    const llvm::MemoryBuffer& Buffer)

Description

Return true if \p Buffer is in the format supported by this class.

Declared at: llvm/include/llvm/ProfileData/SampleProfReader.h:633

Parameters

const llvm::MemoryBuffer& Buffer