LLVM 20.0.0git
|
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< StringRef > | lookUpNameInProfile (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 (StringRef 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. | |
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.
|
inline |
Definition at line 267 of file SampleProfReader.h.
References assert().
void SampleProfileReaderItaniumRemapper::applyRemapping | ( | LLVMContext & | Ctx | ) |
Apply remappings to the profile read by Reader.
Definition at line 1762 of file SampleProfReader.cpp.
References assert(), llvm::LLVMContext::diagnose(), llvm::DS_Warning, llvm::sampleprof::SampleProfileReader::getBuffer(), llvm::MemoryBuffer::getBufferIdentifier(), llvm::sampleprof::SampleProfileReader::getProfiles(), Name, and llvm::sampleprof::SampleProfileReader::useMD5().
|
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.
B | The memory buffer to create the reader from (assumes ownership). |
C | The LLVM context to use to emit diagnostics. |
Reader | The profile reader the remapper is going to be applied to. |
Definition at line 1867 of file SampleProfReader.cpp.
References B, llvm::CallingConv::C, llvm::SymbolRemappingParseError::getLineNum(), llvm::SymbolRemappingParseError::getMessage(), llvm::handleAllErrors(), and llvm::malformed.
|
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.
Filename | The file to open. |
Reader | The profile reader the remapper is going to be applied to. |
C | The LLVM context to use to emit diagnostics. |
Definition at line 1846 of file SampleProfReader.cpp.
References llvm::CallingConv::C, create(), and setupMemoryBuffer().
Referenced by llvm::sampleprof::SampleProfileReader::create(), and create().
Query whether there is equivalent in the remapper which has been inserted.
Definition at line 296 of file SampleProfReader.h.
|
inline |
Definition at line 289 of file SampleProfReader.h.
|
inline |
Insert function name into remapper.
Definition at line 292 of file SampleProfReader.h.
std::optional< StringRef > SampleProfileReaderItaniumRemapper::lookUpNameInProfile | ( | StringRef | FunctionName | ) |
Return the equivalent name in the profile for FunctionName
if it exists.
Definition at line 1791 of file SampleProfReader.cpp.
Referenced by llvm::sampleprof::FunctionSamples::findFunctionSamplesAt().