LLVM  3.7.0
Public Member Functions | List of all members
llvm::sampleprof::FunctionSamples Class Reference

Representation of the samples collected for a function. More...

#include <SampleProf.h>

Public Member Functions

 FunctionSamples ()
 
void print (raw_ostream &OS=dbgs())
 Print the samples collected for a function on stream OS. More...
 
void addTotalSamples (unsigned Num)
 
void addHeadSamples (unsigned Num)
 
void addBodySamples (int LineOffset, unsigned Discriminator, unsigned Num)
 
void addCalledTargetSamples (int LineOffset, unsigned Discriminator, std::string FName, unsigned Num)
 
SampleRecordsampleRecordAt (const LineLocation &Loc)
 Return the sample record at the given location. More...
 
unsigned samplesAt (int LineOffset, unsigned Discriminator)
 Return the number of samples collected at the given location. More...
 
bool empty () const
 
unsigned getTotalSamples () const
 Return the total number of samples collected inside the function. More...
 
unsigned getHeadSamples () const
 Return the total number of samples collected at the head of the function. More...
 
const BodySampleMapgetBodySamples () const
 Return all the samples collected in the body of the function. More...
 
void merge (const FunctionSamples &Other)
 Merge the samples in Other into this one. More...
 

Detailed Description

Representation of the samples collected for a function.

This data structure contains all the collected samples for the body of a function. Each sample corresponds to a LineLocation instance within the body of the function.

Definition at line 167 of file SampleProf.h.

Constructor & Destructor Documentation

llvm::sampleprof::FunctionSamples::FunctionSamples ( )
inline

Definition at line 169 of file SampleProf.h.

Member Function Documentation

void llvm::sampleprof::FunctionSamples::addBodySamples ( int  LineOffset,
unsigned  Discriminator,
unsigned  Num 
)
inline
void llvm::sampleprof::FunctionSamples::addCalledTargetSamples ( int  LineOffset,
unsigned  Discriminator,
std::string  FName,
unsigned  Num 
)
inline
void llvm::sampleprof::FunctionSamples::addHeadSamples ( unsigned  Num)
inline
void llvm::sampleprof::FunctionSamples::addTotalSamples ( unsigned  Num)
inline
bool llvm::sampleprof::FunctionSamples::empty ( ) const
inline
const BodySampleMap& llvm::sampleprof::FunctionSamples::getBodySamples ( ) const
inline

Return all the samples collected in the body of the function.

Definition at line 212 of file SampleProf.h.

Referenced by merge(), llvm::sampleprof::SampleProfileWriterText::write(), and llvm::sampleprof::SampleProfileWriterBinary::write().

unsigned llvm::sampleprof::FunctionSamples::getHeadSamples ( ) const
inline

Return the total number of samples collected at the head of the function.

Definition at line 209 of file SampleProf.h.

Referenced by merge(), llvm::sampleprof::SampleProfileWriterText::write(), and llvm::sampleprof::SampleProfileWriterBinary::write().

unsigned llvm::sampleprof::FunctionSamples::getTotalSamples ( ) const
inline

Return the total number of samples collected inside the function.

Definition at line 205 of file SampleProf.h.

Referenced by merge(), llvm::sampleprof::SampleProfileWriterText::write(), and llvm::sampleprof::SampleProfileWriterBinary::write().

void llvm::sampleprof::FunctionSamples::merge ( const FunctionSamples Other)
inline

Merge the samples in Other into this one.

Definition at line 215 of file SampleProf.h.

References addHeadSamples(), addTotalSamples(), getBodySamples(), getHeadSamples(), getTotalSamples(), I, llvm::sampleprof::SampleRecord::merge(), and sampleRecordAt().

void FunctionSamples::print ( raw_ostream OS = dbgs())
SampleRecord& llvm::sampleprof::FunctionSamples::sampleRecordAt ( const LineLocation Loc)
inline

Return the sample record at the given location.

Each location is specified by LineOffset and Discriminator.

Definition at line 192 of file SampleProf.h.

Referenced by merge(), and samplesAt().

unsigned llvm::sampleprof::FunctionSamples::samplesAt ( int  LineOffset,
unsigned  Discriminator 
)
inline

Return the number of samples collected at the given location.

Each location is specified by LineOffset and Discriminator.

Definition at line 198 of file SampleProf.h.

References llvm::sampleprof::SampleRecord::getSamples(), and sampleRecordAt().


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