LLVM 24.0.0git
llvm::sampleprof::SampleContext Class Reference

#include "llvm/ProfileData/SampleProf.h"

Classes

struct  Hash

Public Member Functions

 SampleContext ()
 SampleContext (StringRef Name)
 SampleContext (FunctionId Func)
 SampleContext (SampleContextFrames Context, ContextStateMask CState=RawContext)
 SampleContext (StringRef ContextStr, std::list< SampleContextFrameVector > &CSNameTable, ContextStateMask CState=RawContext)
 operator SampleContextFrames () const
bool hasAttribute (ContextAttributeMask A)
void setAttribute (ContextAttributeMask A)
uint32_t getAllAttributes ()
void setAllAttributes (uint32_t A)
bool hasState (ContextStateMask S)
void setState (ContextStateMask S)
void clearState (ContextStateMask S)
bool hasContext () const
bool isBaseContext () const
FunctionId getFunction () const
SampleContextFrames getContextFrames () const
std::string toString () const
uint64_t getHashCode () const
void setFunction (FunctionId NewFunctionID)
 Set the name of the function and clear the current context.
void setContext (SampleContextFrames Context, ContextStateMask CState=RawContext)
bool operator== (const SampleContext &That) const
bool operator!= (const SampleContext &That) const
bool operator< (const SampleContext &That) const
bool isPrefixOf (const SampleContext &That) const

Static Public Member Functions

static void createCtxVectorFromStr (StringRef ContextStr, SampleContextFrameVector &Context)
 Create a context vector from a given context string and save it in Context.
static void decodeContextString (StringRef ContextStr, FunctionId &Func, LineLocation &LineLoc)
static std::string getContextString (SampleContextFrames Context, bool IncludeLeafLineLocation=false)

Detailed Description

Definition at line 633 of file SampleProf.h.

Constructor & Destructor Documentation

◆ SampleContext() [1/5]

llvm::sampleprof::SampleContext::SampleContext ( )
inline

◆ SampleContext() [2/5]

llvm::sampleprof::SampleContext::SampleContext ( StringRef Name)
inline

◆ SampleContext() [3/5]

llvm::sampleprof::SampleContext::SampleContext ( FunctionId Func)
inline

◆ SampleContext() [4/5]

llvm::sampleprof::SampleContext::SampleContext ( SampleContextFrames Context,
ContextStateMask CState = RawContext )
inline

◆ SampleContext() [5/5]

llvm::sampleprof::SampleContext::SampleContext ( StringRef ContextStr,
std::list< SampleContextFrameVector > & CSNameTable,
ContextStateMask CState = RawContext )
inline

Member Function Documentation

◆ clearState()

void llvm::sampleprof::SampleContext::clearState ( ContextStateMask S)
inline

Definition at line 723 of file SampleProf.h.

◆ createCtxVectorFromStr()

void llvm::sampleprof::SampleContext::createCtxVectorFromStr ( StringRef ContextStr,
SampleContextFrameVector & Context )
inlinestatic

Create a context vector from a given context string and save it in Context.

Definition at line 676 of file SampleProf.h.

References decodeContextString(), llvm::StringRef::empty(), llvm::StringRef::size(), llvm::StringRef::split(), and llvm::StringRef::substr().

Referenced by SampleContext().

◆ decodeContextString()

void llvm::sampleprof::SampleContext::decodeContextString ( StringRef ContextStr,
FunctionId & Func,
LineLocation & LineLoc )
inlinestatic

◆ getAllAttributes()

uint32_t llvm::sampleprof::SampleContext::getAllAttributes ( )
inline

◆ getContextFrames()

SampleContextFrames llvm::sampleprof::SampleContext::getContextFrames ( ) const
inline

Definition at line 727 of file SampleProf.h.

Referenced by getHashCode().

◆ getContextString()

std::string llvm::sampleprof::SampleContext::getContextString ( SampleContextFrames Context,
bool IncludeLeafLineLocation = false )
inlinestatic

Definition at line 729 of file SampleProf.h.

References I.

Referenced by llvm::SampleContextTracker::getContextString(), and toString().

◆ getFunction()

FunctionId llvm::sampleprof::SampleContext::getFunction ( ) const
inline

◆ getHashCode()

uint64_t llvm::sampleprof::SampleContext::getHashCode ( ) const
inline

◆ hasAttribute()

bool llvm::sampleprof::SampleContext::hasAttribute ( ContextAttributeMask A)
inline

Definition at line 717 of file SampleProf.h.

References A().

◆ hasContext()

bool llvm::sampleprof::SampleContext::hasContext ( ) const
inline

◆ hasState()

bool llvm::sampleprof::SampleContext::hasState ( ContextStateMask S)
inline

◆ isBaseContext()

bool llvm::sampleprof::SampleContext::isBaseContext ( ) const
inline

Definition at line 725 of file SampleProf.h.

◆ isPrefixOf()

bool llvm::sampleprof::SampleContext::isPrefixOf ( const SampleContext & That) const
inline

◆ operator SampleContextFrames()

llvm::sampleprof::SampleContext::operator SampleContextFrames ( ) const
inline

Definition at line 716 of file SampleProf.h.

◆ operator!=()

bool llvm::sampleprof::SampleContext::operator!= ( const SampleContext & That) const
inline

Definition at line 774 of file SampleProf.h.

References SampleContext().

◆ operator<()

bool llvm::sampleprof::SampleContext::operator< ( const SampleContext & That) const
inline

Definition at line 776 of file SampleProf.h.

References hasContext(), I, SampleContext(), llvm::ArrayRef< T >::size(), and uint64_t.

◆ operator==()

bool llvm::sampleprof::SampleContext::operator== ( const SampleContext & That) const
inline

Definition at line 769 of file SampleProf.h.

References SampleContext().

◆ setAllAttributes()

void llvm::sampleprof::SampleContext::setAllAttributes ( uint32_t A)
inline

◆ setAttribute()

void llvm::sampleprof::SampleContext::setAttribute ( ContextAttributeMask A)
inline

Definition at line 718 of file SampleProf.h.

References A().

◆ setContext()

void llvm::sampleprof::SampleContext::setContext ( SampleContextFrames Context,
ContextStateMask CState = RawContext )
inline

◆ setFunction()

void llvm::sampleprof::SampleContext::setFunction ( FunctionId NewFunctionID)
inline

Set the name of the function and clear the current context.

Definition at line 755 of file SampleProf.h.

References llvm::sampleprof::UnknownContext.

◆ setState()

◆ toString()

std::string llvm::sampleprof::SampleContext::toString ( ) const
inline

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