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

Representation of a single sample record. More...

#include <SampleProf.h>

Public Types

typedef StringMap< unsignedCallTargetMap
 

Public Member Functions

 SampleRecord ()
 
void addSamples (unsigned S)
 Increment the number of samples for this record by S. More...
 
void addCalledTarget (StringRef F, unsigned S)
 Add called function F with samples S. More...
 
bool hasCalls () const
 Return true if this sample record contains function calls. More...
 
unsigned getSamples () const
 
const CallTargetMapgetCallTargets () const
 
void merge (const SampleRecord &Other)
 Merge the samples in Other into this record. More...
 

Detailed Description

Representation of a single sample record.

A sample record is represented by a positive integer value, which indicates how frequently was the associated line location executed.

Additionally, if the associated location contains a function call, the record will hold a list of all the possible called targets. For direct calls, this will be the exact function being invoked. For indirect calls (function pointers, virtual table dispatch), this will be a list of one or more functions.

Definition at line 113 of file SampleProf.h.

Member Typedef Documentation

Definition at line 115 of file SampleProf.h.

Constructor & Destructor Documentation

llvm::sampleprof::SampleRecord::SampleRecord ( )
inline

Definition at line 117 of file SampleProf.h.

Member Function Documentation

void llvm::sampleprof::SampleRecord::addCalledTarget ( StringRef  F,
unsigned  S 
)
inline

Add called function F with samples S.

Sample counts accumulate using saturating arithmetic, to avoid wrapping around unsigned integers.

Definition at line 134 of file SampleProf.h.

References F().

Referenced by merge().

void llvm::sampleprof::SampleRecord::addSamples ( unsigned  S)
inline

Increment the number of samples for this record by S.

Sample counts accumulate using saturating arithmetic, to avoid wrapping around unsigned integers.

Definition at line 123 of file SampleProf.h.

Referenced by merge().

const CallTargetMap& llvm::sampleprof::SampleRecord::getCallTargets ( ) const
inline
unsigned llvm::sampleprof::SampleRecord::getSamples ( ) const
inline
bool llvm::sampleprof::SampleRecord::hasCalls ( ) const
inline

Return true if this sample record contains function calls.

Definition at line 143 of file SampleProf.h.

References llvm::StringMapImpl::size().

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

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

Merge the samples in Other into this record.

Definition at line 149 of file SampleProf.h.

References addCalledTarget(), addSamples(), getCallTargets(), getSamples(), and I.

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


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