LLVM  14.0.0git
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...
 
Optional< StringReflookUpNameInProfile (StringRef FunctionName)
 Return the equivalent name in the profile for FunctionName if it exists. 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 264 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 266 of file SampleProfReader.h.

References assert().

Member Function Documentation

◆ applyRemapping()

void SampleProfileReaderItaniumRemapper::applyRemapping ( LLVMContext Ctx)

◆ 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 1745 of file SampleProfReader.cpp.

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

Referenced by llvm::sampleprof::SampleProfileReader::create().

◆ 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 1765 of file SampleProfReader.cpp.

References B, E, llvm::SymbolRemappingParseError::getLineNum(), llvm::SymbolRemappingParseError::getMessage(), llvm::handleAllErrors(), llvm::malformed, and move.

◆ exist()

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

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

Definition at line 295 of file SampleProfReader.h.

◆ hasApplied()

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

Definition at line 288 of file SampleProfReader.h.

◆ insert()

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

Insert function name into remapper.

Definition at line 291 of file SampleProfReader.h.

◆ lookUpNameInProfile()

Optional< StringRef > SampleProfileReaderItaniumRemapper::lookUpNameInProfile ( StringRef  FunctionName)

Return the equivalent name in the profile for FunctionName if it exists.

Definition at line 1690 of file SampleProfReader.cpp.

References llvm::None.

Referenced by llvm::sampleprof::FunctionSamples::findFunctionSamplesAt().


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