LLVM 19.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.
 
bool hasApplied ()
 
void insert (StringRef FunctionName)
 Insert function name into remapper.
 
bool exist (StringRef FunctionName)
 Query whether there is equivalent in the remapper which has been inserted.
 
std::optional< StringReflookUpNameInProfile (StringRef FunctionName)
 Return the equivalent name in the profile for FunctionName if it exists.
 

Static Public Member Functions

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

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 265 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 267 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,
vfs::FileSystem FS,
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 1845 of file SampleProfReader.cpp.

References llvm::CallingConv::C, create(), and setupMemoryBuffer().

Referenced by create(), and 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 1866 of file SampleProfReader.cpp.

References B, llvm::CallingConv::C, 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 296 of file SampleProfReader.h.

◆ hasApplied()

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

Definition at line 289 of file SampleProfReader.h.

◆ insert()

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

Insert function name into remapper.

Definition at line 292 of file SampleProfReader.h.

◆ lookUpNameInProfile()

std::optional< StringRef > SampleProfileReaderItaniumRemapper::lookUpNameInProfile ( StringRef  FunctionName)

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

Definition at line 1790 of file SampleProfReader.cpp.

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


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