LLVM 20.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::sampleprof::LineLocation Struct Reference

Represents the relative location of an instruction. More...

#include "llvm/ProfileData/SampleProf.h"

Public Member Functions

 LineLocation (uint32_t L, uint32_t D)
 
void print (raw_ostream &OS) const
 
void dump () const
 
bool operator< (const LineLocation &O) const
 
bool operator== (const LineLocation &O) const
 
bool operator!= (const LineLocation &O) const
 
uint64_t getHashCode () const
 

Public Attributes

uint32_t LineOffset
 
uint32_t Discriminator
 

Detailed Description

Represents the relative location of an instruction.

Instruction locations are specified by the line offset from the beginning of the function (marked by the line where the function header is) and the discriminator value within that line.

The discriminator value is useful to distinguish instructions that are on the same line but belong to different basic blocks (e.g., the two post-increment instructions in "if (p) x++; else y++;").

Definition at line 280 of file SampleProf.h.

Constructor & Destructor Documentation

◆ LineLocation()

llvm::sampleprof::LineLocation::LineLocation ( uint32_t  L,
uint32_t  D 
)
inline

Definition at line 281 of file SampleProf.h.

Member Function Documentation

◆ dump()

LLVM_DUMP_METHOD void LineLocation::dump ( ) const

Definition at line 130 of file SampleProf.cpp.

References llvm::dbgs(), and print().

◆ getHashCode()

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

◆ operator!=()

bool llvm::sampleprof::LineLocation::operator!= ( const LineLocation O) const
inline

Definition at line 295 of file SampleProf.h.

References Discriminator, and LineOffset.

◆ operator<()

bool llvm::sampleprof::LineLocation::operator< ( const LineLocation O) const
inline

Definition at line 286 of file SampleProf.h.

References Discriminator, and LineOffset.

◆ operator==()

bool llvm::sampleprof::LineLocation::operator== ( const LineLocation O) const
inline

Definition at line 291 of file SampleProf.h.

References Discriminator, and LineOffset.

◆ print()

void LineLocation::print ( raw_ostream OS) const

Definition at line 105 of file SampleProf.cpp.

References Discriminator, LineOffset, and OS.

Referenced by dump(), and llvm::sampleprof::operator<<().

Member Data Documentation

◆ Discriminator

uint32_t llvm::sampleprof::LineLocation::Discriminator

◆ LineOffset

uint32_t llvm::sampleprof::LineLocation::LineOffset

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