LLVM: llvm::DebugLoc Class Reference (original) (raw)

A debug info location. More...

#include "[llvm/IR/DebugLoc.h](DebugLoc%5F8h%5Fsource.html)"

Public Types
enum { ReplaceLastInlinedAt = true }
Public Member Functions
DebugLoc ()=default
LLVM_ABI DebugLoc (const DILocation *L)
Construct from an DILocation.
LLVM_ABI DebugLoc (const MDNode *N)
Construct from an MDNode.
DebugLoc orElse (DebugLoc Other) const
If this DebugLoc is non-empty, returns this DebugLoc; otherwise, selects Other.
DebugLoc getCopied () const
operator bool () const
Check for null.
bool hasTrivialDestructor () const
Check whether this has a trivial destructor.
bool isSameSourceLocation (const DebugLoc &Other) const
Return true if the source locations match, ignoring isImplicitCode and source atom info.
LLVM_ABI unsigned getLine () const
LLVM_ABI unsigned getCol () const
LLVM_ABI MDNode * getScope () const
LLVM_ABI DILocation * getInlinedAt () const
LLVM_ABI MDNode * getInlinedAtScope () const
Get the fully inlined-at scope for a DebugLoc.
LLVM_ABI DebugLoc getFnDebugLoc () const
Find the debug info location for the start of the function.
MDNode * getAsMDNode () const
Return this as a bar MDNode.
LLVM_ABI bool isImplicitCode () const
Check if the DebugLoc corresponds to an implicit code.
LLVM_ABI void setImplicitCode (bool ImplicitCode)
bool operator== (const DebugLoc &DL) const
bool operator!= (const DebugLoc &DL) const
LLVM_ABI void dump () const
LLVM_ABI void print (raw_ostream &OS) const
prints source location /path/to/file.exe:line:col @[inlined at]
LLVM_ABI DILocation * get () const
Get the underlying DILocation.
operator DILocation * () const
DILocation * operator-> () const
DILocation & operator* () const
Static Public Member Functions
static DebugLoc getTemporary ()
static DebugLoc getUnknown ()
static DebugLoc getCompilerGenerated ()
static DebugLoc getDropped ()
static LLVM_ABI DebugLoc getMergedLocation (DebugLoc LocA, DebugLoc LocB)
When two instructions are combined into a single instruction we also need to combine the original locations into a single location.
static LLVM_ABI DebugLoc getMergedLocations (ArrayRef< DebugLoc > Locs)
Try to combine the vector of locations passed as input in a single one.
static LLVM_ABI DebugLoc appendInlinedAt (const DebugLoc &DL, DILocation *InlinedAt, LLVMContext &Ctx, DenseMap< const MDNode *, MDNode * > &Cache)
Rebuild the entire inlined-at chain for this instruction so that the top of the chain now is inlined-at the new call site.
static LLVM_ABI DebugLoc replaceInlinedAtSubprogram (const DebugLoc &DL, DISubprogram &NewSP, LLVMContext &Ctx, DenseMap< const MDNode *, MDNode * > &Cache)
Rebuild the entire inline-at chain by replacing the subprogram at the end of the chain with NewSP.

A debug info location.

This class is a wrapper around a tracking reference to an DILocation pointer.

To avoid extra includes, DebugLoc doubles the DILocation API with a one based on relatively opaque MDNode pointers.

Definition at line 123 of file DebugLoc.h.

anonymous enum

Enumerator
ReplaceLastInlinedAt

Definition at line 245 of file DebugLoc.h.

DebugLoc() [1/3]

llvm::DebugLoc::DebugLoc ( ) default

References LLVM_ABI, and N.

Referenced by appendInlinedAt(), getCompilerGenerated(), getCopied(), getDropped(), getFnDebugLoc(), getMergedLocation(), getMergedLocations(), getTemporary(), getUnknown(), isSameSourceLocation(), operator!=(), operator==(), orElse(), print(), and replaceInlinedAtSubprogram().

DebugLoc() [2/3]

DebugLoc() [3/3]

Construct from an MDNode.

Note: if N is not an DILocation, a verifier check will fail, and accessors will crash. However, construction from other nodes is supported in order to handle forward references when reading textual IR.

Definition at line 46 of file DebugLoc.cpp.

appendInlinedAt()

dump()

get()

Get the underlying DILocation.

Precondition

!*this or isa<DILocation>(getAsMDNode()).

Definition at line 48 of file DebugLoc.cpp.

References llvm::cast_or_null().

Referenced by llvm::addLocationToRemarks(), llvm::ConvertDebugDeclareToDebugValue(), llvm::ConvertDebugDeclareToDebugValue(), fixupLineNumbers(), llvm::formatCallSiteLocation(), getCol(), getInlinedAt(), getLine(), getScope(), insertDbgValueOrDbgVariableRecord(), isImplicitCode(), isSameSourceLocation(), operator DILocation *(), operator*(), operator->(), llvm::DebugInfoFinder::processDbgRecord(), and setImplicitCode().

getAsMDNode()

MDNode * llvm::DebugLoc::getAsMDNode ( ) const inline

getCol()

getCompilerGenerated()

DebugLoc llvm::DebugLoc::getCompilerGenerated ( ) inlinestatic

getCopied()

DebugLoc llvm::DebugLoc::getCopied ( ) const inline

getDropped()

DebugLoc llvm::DebugLoc::getDropped ( ) inlinestatic

getFnDebugLoc()

DebugLoc DebugLoc::getFnDebugLoc ( ) const

getInlinedAt()

getInlinedAtScope()

MDNode * DebugLoc::getInlinedAtScope ( ) const

getLine()

getMergedLocation()

When two instructions are combined into a single instruction we also need to combine the original locations into a single location.

When the locations are the same we can use either location. When they differ, we need a third location which is distinct from either. If they share a common scope, use this scope and compare the line/column pair of the locations with the common scope:

LocA LocB: The locations to be merged.

Definition at line 179 of file DebugLoc.cpp.

References DebugLoc(), and llvm::DILocation::getMergedLocation().

Referenced by llvm::Instruction::applyMergedLocation(), llvm::MachineBasicBlock::findBranchDebugLoc(), getMergedLocations(), mergeCompatibleInvokesImpl(), mergeDebugLocs(), llvm::InstCombinerImpl::mergeStoreIntoSuccessor(), performBlockTailMerging(), performSink(), and llvm::LegalizationArtifactCombiner::tryCombineAnyExt().

getMergedLocations()

getScope()

MDNode * DebugLoc::getScope ( ) const

getTemporary()

DebugLoc llvm::DebugLoc::getTemporary ( ) inlinestatic

getUnknown()

DebugLoc llvm::DebugLoc::getUnknown ( ) inlinestatic

Definition at line 161 of file DebugLoc.h.

References DebugLoc().

Referenced by llvm::VPlanTransforms::addExplicitVectorLength(), llvm::VPlanTransforms::addMinimumIterationCheck(), llvm::VPlanTransforms::addMinimumVectorEpilogueIterationCheck(), addVPLaneMaskPhiAndUpdateExitBranch(), llvm::checkDebugInfoMetadata(), llvm::VPBuilder::createAnd(), llvm::SSAUpdaterTraits< SSAUpdater >::CreateEmptyPHI(), llvm::VPBuilder::createFCmp(), llvm::VPBuilder::createICmp(), llvm::VPBuilder::createLogicalAnd(), llvm::VPBuilder::createNaryOp(), llvm::VPBuilder::createNot(), llvm::VPBuilder::createNoWrapPtrAdd(), llvm::VPBuilder::createOr(), llvm::VPBuilder::createPtrAdd(), createReplicateRegion(), llvm::VPBuilder::createSelect(), llvm::VPBuilder::createWidePtrAdd(), expandVPWidenIntOrFpInduction(), findDebugLoc(), getDebugLocFromInstOrOperands(), getDebugLocFromPHI(), llvm::VPlanTransforms::handleUncountableEarlyExit(), llvm::InlineFunctionImpl(), optimizeLatchExitInductionUser(), transformRecipestoEVLRecipes(), llvm::VPlanTransforms::updateScalarResumePhis(), llvm::VPHeaderPHIRecipe::VPHeaderPHIRecipe(), llvm::VPHistogramRecipe::VPHistogramRecipe(), llvm::VPRecipeBase::VPRecipeBase(), llvm::VPRecipeWithIRFlags::VPRecipeWithIRFlags(), llvm::VPReductionEVLRecipe::VPReductionEVLRecipe(), llvm::VPReductionRecipe::VPReductionRecipe(), llvm::VPReductionRecipe::VPReductionRecipe(), llvm::VPScalarIVStepsRecipe::VPScalarIVStepsRecipe(), llvm::VPSingleDefRecipe::VPSingleDefRecipe(), llvm::VPSingleDefRecipe::VPSingleDefRecipe(), and llvm::VPWidenPHIRecipe::VPWidenPHIRecipe().

hasTrivialDestructor()

bool llvm::DebugLoc::hasTrivialDestructor ( ) const inline

isImplicitCode()

bool DebugLoc::isImplicitCode ( ) const

isSameSourceLocation()

operator bool()

llvm::DebugLoc::operator bool ( ) const inlineexplicit

operator DILocation *()

llvm::DebugLoc::operator DILocation * ( ) const inline

operator!=()

operator*()

DILocation & llvm::DebugLoc::operator* ( ) const inline

operator->()

DILocation * llvm::DebugLoc::operator-> ( ) const inline

operator==()

orElse()

If this DebugLoc is non-empty, returns this DebugLoc; otherwise, selects Other.

In coverage-tracking builds, this also accounts for whether this or Other have an annotative DebugLocKind applied, such that if both are empty but exactly one has an annotation, we prefer that annotated location.

Definition at line 195 of file DebugLoc.h.

References DebugLoc(), and llvm::Other.

print()

replaceInlinedAtSubprogram()

setImplicitCode()

void DebugLoc::setImplicitCode ( bool ImplicitCode )

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