LLVM  10.0.0svn
Public Member Functions | Static Public Member Functions | List of all members
llvm::sampleprof::SampleProfileReaderItaniumRemapper Class Reference

SampleProfileReaderItaniumRemapper remaps the profile data from a sample profile data reader, by applying a provided set of equivalences between components of the symbol names in the profile. More...

#include "llvm/ProfileData/SampleProfReader.h"

Public Member Functions

 SampleProfileReaderItaniumRemapper (std::unique_ptr< MemoryBuffer > B, std::unique_ptr< SymbolRemappingReader > SRR, SampleProfileReader &R)
 
void applyRemapping (LLVMContext &Ctx)
 Apply remappings to the profile read by Reader. More...
 
bool hasApplied ()
 
void insert (StringRef FunctionName)
 Insert function name into remapper. More...
 
bool exist (StringRef FunctionName)
 Query whether there is equivalent in the remapper which has been inserted. More...
 
FunctionSamplesgetSamplesFor (StringRef FunctionName)
 Return the samples collected for function F if remapper knows it is present in SampleMap. More...
 

Static Public Member Functions

static ErrorOr< std::unique_ptr< SampleProfileReaderItaniumRemapper > > create (const std::string Filename, SampleProfileReader &Reader, LLVMContext &C)
 Create a remapper from the given remapping file. More...
 
static ErrorOr< std::unique_ptr< SampleProfileReaderItaniumRemapper > > create (std::unique_ptr< MemoryBuffer > &B, SampleProfileReader &Reader, LLVMContext &C)
 Create a remapper from the given Buffer. More...
 

Detailed Description

SampleProfileReaderItaniumRemapper remaps the profile data from a sample profile data reader, by applying a provided set of equivalences between components of the symbol names in the profile.

Definition at line 243 of file SampleProfReader.h.

Constructor & Destructor Documentation

◆ SampleProfileReaderItaniumRemapper()

llvm::sampleprof::SampleProfileReaderItaniumRemapper::SampleProfileReaderItaniumRemapper ( std::unique_ptr< MemoryBuffer B,
std::unique_ptr< SymbolRemappingReader SRR,
SampleProfileReader R 
)
inline

Definition at line 245 of file SampleProfReader.h.

References applyRemapping(), assert(), B, C, and create().

Member Function Documentation

◆ applyRemapping()

void SampleProfileReaderItaniumRemapper::applyRemapping ( LLVMContext Ctx)

Apply remappings to the profile read by Reader.

Definition at line 1212 of file SampleProfReader.cpp.

References assert(), llvm::LLVMContext::diagnose(), llvm::DS_Warning, and llvm::sampleprof::SPF_Compact_Binary.

Referenced by SampleProfileReaderItaniumRemapper().

◆ create() [1/2]

ErrorOr< std::unique_ptr< SampleProfileReaderItaniumRemapper > > SampleProfileReaderItaniumRemapper::create ( const std::string  Filename,
SampleProfileReader Reader,
LLVMContext C 
)
static

Create a remapper from the given remapping file.

Create a sample profile remapper from the given input, to remap the function names in the given profile data.

The remapper will be used for profile read in by Reader.

Parameters
FilenameThe file to open.
ReaderThe profile reader the remapper is going to be applied to.
CThe LLVM context to use to emit diagnostics.
Returns
an error code indicating the status of the created reader.

Definition at line 1285 of file SampleProfReader.cpp.

References C, llvm::sampleprof::SampleProfileReader::create(), and setupMemoryBuffer().

Referenced by llvm::sampleprof::SampleProfileReader::create(), llvm::sampleprof::SampleProfileReader::reportError(), and SampleProfileReaderItaniumRemapper().

◆ create() [2/2]

ErrorOr< std::unique_ptr< SampleProfileReaderItaniumRemapper > > SampleProfileReaderItaniumRemapper::create ( std::unique_ptr< MemoryBuffer > &  B,
SampleProfileReader Reader,
LLVMContext C 
)
static

Create a remapper from the given Buffer.

Create a sample profile remapper from the given input, to remap the function names in the given profile data.

The remapper will be used for profile read in by Reader.

Parameters
BThe memory buffer to create the reader from (assumes ownership).
CThe LLVM context to use to emit diagnostics.
ReaderThe profile reader the remapper is going to be applied to.
Returns
an error code indicating the status of the created reader.

Definition at line 1305 of file SampleProfReader.cpp.

References llvm::LLVMContext::diagnose(), E, llvm::SymbolRemappingParseError::getLineNum(), llvm::SymbolRemappingParseError::getMessage(), llvm::handleAllErrors(), and llvm::malformed.

◆ exist()

bool llvm::sampleprof::SampleProfileReaderItaniumRemapper::exist ( StringRef  FunctionName)
inline

Query whether there is equivalent in the remapper which has been inserted.

Definition at line 274 of file SampleProfReader.h.

References getSamplesFor().

◆ getSamplesFor()

FunctionSamples * SampleProfileReaderItaniumRemapper::getSamplesFor ( StringRef  FunctionName)

Return the samples collected for function F if remapper knows it is present in SampleMap.

Definition at line 1233 of file SampleProfReader.cpp.

Referenced by exist(), and llvm::sampleprof::SampleProfileReader::getSamplesFor().

◆ hasApplied()

bool llvm::sampleprof::SampleProfileReaderItaniumRemapper::hasApplied ( )
inline

Definition at line 267 of file SampleProfReader.h.

◆ insert()

void llvm::sampleprof::SampleProfileReaderItaniumRemapper::insert ( StringRef  FunctionName)
inline

Insert function name into remapper.

Definition at line 270 of file SampleProfReader.h.


The documentation for this class was generated from the following files: