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

A profile data reader proxy that remaps the profile data from another 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"

Inheritance diagram for llvm::sampleprof::SampleProfileReaderItaniumRemapper:
Inheritance graph
[legend]
Collaboration diagram for llvm::sampleprof::SampleProfileReaderItaniumRemapper:
Collaboration graph
[legend]

Public Member Functions

 SampleProfileReaderItaniumRemapper (std::unique_ptr< MemoryBuffer > B, LLVMContext &C, std::unique_ptr< SampleProfileReader > Underlying)
 
std::error_code readHeader () override
 Read and validate the file header. More...
 
std::error_code read () override
 Read remapping file and apply it to the sample profile. More...
 
FunctionSamplesgetSamplesFor (StringRef FunctionName) override
 Return the samples collected for function F. More...
 
- Public Member Functions inherited from llvm::sampleprof::SampleProfileReader
 SampleProfileReader (std::unique_ptr< MemoryBuffer > B, LLVMContext &C, SampleProfileFormat Format=SPF_None)
 
virtual ~SampleProfileReader ()=default
 
void dumpFunctionProfile (StringRef FName, raw_ostream &OS=dbgs())
 Print the profile for FName on stream OS. More...
 
virtual void collectFuncsToUse (const Module &M)
 
void dump (raw_ostream &OS=dbgs())
 Print all the profiles on stream OS. More...
 
FunctionSamplesgetSamplesFor (const Function &F)
 Return the samples collected for function F. More...
 
StringMap< FunctionSamples > & getProfiles ()
 Return all the profiles. More...
 
void reportError (int64_t LineNumber, Twine Msg) const
 Report a parse error message. More...
 
ProfileSummarygetSummary ()
 Return the profile summary. More...
 
SampleProfileFormat getFormat ()
 Return the profile format. More...
 

Static Public Member Functions

static ErrorOr< std::unique_ptr< SampleProfileReader > > create (const Twine &Filename, LLVMContext &C, std::unique_ptr< SampleProfileReader > Underlying)
 Create a remapped sample profile from the given remapping file and underlying samples. More...
 
- Static Public Member Functions inherited from llvm::sampleprof::SampleProfileReader
static ErrorOr< std::unique_ptr< SampleProfileReader > > create (const Twine &Filename, LLVMContext &C)
 Create a sample profile reader appropriate to the file format. More...
 
static ErrorOr< std::unique_ptr< SampleProfileReader > > create (std::unique_ptr< MemoryBuffer > &B, LLVMContext &C)
 Create a sample profile reader from the supplied memory buffer. More...
 

Additional Inherited Members

- Protected Member Functions inherited from llvm::sampleprof::SampleProfileReader
void computeSummary ()
 Compute summary for this profile. More...
 
- Static Protected Member Functions inherited from llvm::sampleprof::SampleProfileReader
static std::unique_ptr< ProfileSummarytakeSummary (SampleProfileReader &Reader)
 Take ownership of the summary of this reader. More...
 
- Protected Attributes inherited from llvm::sampleprof::SampleProfileReader
StringMap< FunctionSamplesProfiles
 Map every function to its associated profile. More...
 
LLVMContextCtx
 LLVM context used to emit diagnostics. More...
 
std::unique_ptr< MemoryBufferBuffer
 Memory buffer holding the profile file. More...
 
std::unique_ptr< ProfileSummarySummary
 Profile summary information. More...
 
SampleProfileFormat Format = SPF_None
 The format of sample. More...
 

Detailed Description

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

Definition at line 543 of file SampleProfReader.h.

Constructor & Destructor Documentation

◆ SampleProfileReaderItaniumRemapper()

llvm::sampleprof::SampleProfileReaderItaniumRemapper::SampleProfileReaderItaniumRemapper ( std::unique_ptr< MemoryBuffer B,
LLVMContext C,
std::unique_ptr< SampleProfileReader Underlying 
)
inline

Member Function Documentation

◆ create()

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

Create a remapped sample profile from the given remapping file and underlying samples.

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

Parameters
FilenameThe file to open.
CThe LLVM context to use to emit diagnostics.
UnderlyingThe underlying profile data reader to remap.
Returns
an error code indicating the status of the created reader.

Definition at line 991 of file SampleProfReader.cpp.

References setupMemoryBuffer().

◆ getSamplesFor()

FunctionSamples * SampleProfileReaderItaniumRemapper::getSamplesFor ( StringRef  FunctionName)
overridevirtual

Return the samples collected for function F.

Reimplemented from llvm::sampleprof::SampleProfileReader.

Definition at line 942 of file SampleProfReader.cpp.

References llvm::sampleprof::SampleProfileReader::getSamplesFor().

◆ read()

std::error_code SampleProfileReaderItaniumRemapper::read ( )
overridevirtual

◆ readHeader()

std::error_code llvm::sampleprof::SampleProfileReaderItaniumRemapper::readHeader ( )
inlineoverridevirtual

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