|
LLVM 23.0.0git
|
A debug info location. More...
#include "llvm/IR/DebugLoc.h"
Public Types | |
| enum | { ReplaceLastInlinedAt = true } |
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 an DILocation pointer.
To avoid extra includes, DebugLoc doubles the DILocation API with a one based on relatively opaque MDNode pointers.
Definition at line 124 of file DebugLoc.h.
| anonymous enum |
| Enumerator | |
|---|---|
| ReplaceLastInlinedAt | |
Definition at line 232 of file DebugLoc.h.
|
inline |
Construct from an DILocation.
Definition at line 129 of file DebugLoc.h.
Referenced by appendInlinedAt(), getCompilerGenerated(), getCopied(), getDropped(), getFnDebugLoc(), getMergedLocation(), getMergedLocations(), getTemporary(), getUnknown(), isSameSourceLocation(), operator!=(), operator==(), orElse(), print(), and replaceInlinedAtSubprogram().
|
static |
Rebuild the entire inlined-at chain for this instruction so that the top of the chain now is inlined-at the new call site.
| InlinedAt | The new outermost inlined-at in the chain. |
Definition at line 126 of file DebugLoc.cpp.
References llvm::cast(), DebugLoc(), DL, llvm::MDNode::getDistinct(), llvm::Last, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::reverse().
Referenced by inlineDebugLoc().
| LLVM_DUMP_METHOD void DebugLoc::dump | ( | ) | const |
Definition at line 187 of file DebugLoc.cpp.
References llvm::dbgs(), LLVM_DUMP_METHOD, and print().
|
inline |
Get the underlying DILocation.
isa<DILocation>(getAsMDNode()). Definition at line 218 of file DebugLoc.h.
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().
| MDNode * DebugLoc::getAsMDNode | ( | ) | const |
Return this as a bar MDNode.
Definition at line 73 of file DebugLoc.cpp.
| unsigned DebugLoc::getCol | ( | ) | const |
Definition at line 45 of file DebugLoc.cpp.
References assert(), and get().
Referenced by inlineDebugLoc(), isSameSourceLocation(), print(), and llvm::MachineBasicBlock::SplitCriticalEdge().
|
inlinestatic |
Definition at line 152 of file DebugLoc.h.
References DebugLoc(), and llvm::dwarf_linker::DebugLoc.
Referenced by llvm::VPlanTransforms::addExplicitVectorLength(), buildPartialInvariantUnswitchConditionalBranch(), buildPartialUnswitchConditionalBranch(), expandVPDerivedIV(), HandleByValArgument(), llvm::VPlanTransforms::materializeAliasMask(), llvm::VPlanTransforms::materializeAliasMaskCheckBlock(), llvm::VPlanTransforms::materializeBackedgeTakenCount(), llvm::VPlanTransforms::materializeVectorTripCount(), and processInternalGlobal().
|
inline |
Definition at line 211 of file DebugLoc.h.
References DebugLoc().
|
inlinestatic |
Definition at line 153 of file DebugLoc.h.
References DebugLoc(), and llvm::dwarf_linker::DebugLoc.
Referenced by cloneInstructionsIntoPredecessorBlockAndUpdateSSAUses(), llvm::Instruction::dropLocation(), llvm::InstCombinerImpl::foldPHIArgZextsIntoPHI(), hoistBOAssociation(), hoistMulAddAssociation(), hoistSubAddAssociation(), moveFunctionData(), llvm::promoteLoopAccessesToScalars(), replaceArgumentUses(), llvm::JumpThreadingPass::simplifyPartiallyRedundantLoad(), and unswitchNontrivialInvariants().
| DebugLoc DebugLoc::getFnDebugLoc | ( | ) | const |
Find the debug info location for the start of the function.
Walk up the scope chain of given debug loc and find line number info for the function.
FIXME: Remove this. Users should use DILocation/DILocalScope API to find the subprogram, and then DILocation::get().
Definition at line 64 of file DebugLoc.cpp.
References DebugLoc(), llvm::dwarf_linker::DebugLoc, llvm::MDNode::get(), llvm::getDISubprogram(), and getInlinedAtScope().
| DILocation * DebugLoc::getInlinedAt | ( | ) | const |
Definition at line 55 of file DebugLoc.cpp.
References assert(), and get().
Referenced by buildOverlapMapAndRecordDeclares(), findVarsWithStackSlot(), fixupDebugInfoPostExtraction(), getAggregateVariable(), llvm::getDebugValueLoc(), llvm::SelectionDAGBuilder::handleDebugValue(), isSameSourceLocation(), llvm::DroppedVariableStats::populateVarIDSetAndInlinedMap(), and print().
| MDNode * DebugLoc::getInlinedAtScope | ( | ) | const |
Get the fully inlined-at scope for a DebugLoc.
Gets the inlined-at scope for a DebugLoc.
Definition at line 60 of file DebugLoc.cpp.
References llvm::cast().
Referenced by getFnDebugLoc().
| unsigned DebugLoc::getLine | ( | ) | const |
Definition at line 40 of file DebugLoc.cpp.
References assert(), and get().
Referenced by llvm::applyDebugifyMetadataToMachineFunction(), llvm::SampleProfileLoaderBaseImpl< FT >::getInstWeightImpl(), inlineDebugLoc(), isSameSourceLocation(), print(), and llvm::MachineBasicBlock::SplitCriticalEdge().
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 169 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().
Try to combine the vector of locations passed as input in a single one.
This function applies getMergedLocation() repeatedly left-to-right.
Locs: The locations to be merged.
Definition at line 156 of file DebugLoc.cpp.
References DebugLoc(), llvm::dwarf_linker::DebugLoc, DL, llvm::drop_begin(), llvm::ArrayRef< T >::empty(), getMergedLocation(), and llvm::ArrayRef< T >::size().
Referenced by mergeConsecutivePartStores(), and llvm::promoteLoopAccessesToScalars().
| MDNode * DebugLoc::getScope | ( | ) | const |
Definition at line 50 of file DebugLoc.cpp.
References assert(), and get().
Referenced by llvm::getDebugValueLoc(), inlineDebugLoc(), isSameSourceLocation(), and print().
|
inlinestatic |
Definition at line 150 of file DebugLoc.h.
References DebugLoc(), and llvm::dwarf_linker::DebugLoc.
Referenced by createUnreachableSwitchDefault(), llvm::InlineFunctionImpl(), markAliveBlocks(), mergeCompatibleInvokesImpl(), processSwitch(), llvm::SCCPSolver::removeNonFeasibleEdges(), and llvm::JumpThreadingPass::tryToUnfoldSelectInCurrBB().
|
inlinestatic |
Definition at line 151 of file DebugLoc.h.
References DebugLoc(), and llvm::dwarf_linker::DebugLoc.
Referenced by llvm::VPlanTransforms::addExplicitVectorLength(), llvm::VPlanTransforms::addMinimumVectorEpilogueIterationCheck(), addVPLaneMaskPhiAndUpdateExitBranch(), llvm::VPlanTransforms::attachAliasMaskToHeaderMask(), llvm::checkDebugInfoMetadata(), llvm::VPlanTransforms::convertToStridedAccesses(), llvm::VPBuilder::createAdd(), llvm::VPBuilder::createAnd(), llvm::SSAUpdaterTraits< SSAUpdater >::CreateEmptyPHI(), llvm::VPBuilder::createFCmp(), llvm::VPBuilder::createFirstActiveLane(), llvm::VPBuilder::createICmp(), llvm::VPBuilder::createLastActiveLane(), llvm::VPBuilder::createLogicalAnd(), llvm::VPBuilder::createLogicalOr(), createLoopRegion(), llvm::VPBuilder::createNaryOp(), llvm::VPBuilder::createNot(), llvm::VPBuilder::createNoWrapPtrAdd(), llvm::VPBuilder::createOr(), llvm::VPBuilder::createPtrAdd(), createReplicateRegion(), llvm::VPBuilder::createScalarPhi(), llvm::VPBuilder::createSelect(), llvm::VPBuilder::createSub(), llvm::VPBuilder::createWidenPhi(), llvm::VPBuilder::createWidePtrAdd(), expandVPWidenIntOrFpInduction(), findDebugLoc(), fixupVFUsersForEVL(), getDebugLocFromInstOrOperands(), getDebugLocFromPHI(), llvm::VPlanTransforms::handleUncountableEarlyExits(), llvm::InlineFunctionImpl(), llvm::VPlanTransforms::materializeAliasMask(), llvm::VPVectorEndPointerRecipe::materializeOffset(), optimizeLatchExitInductionUser(), optimizeMaskToEVL(), llvm::VPHeaderPHIRecipe::VPHeaderPHIRecipe(), llvm::VPRecipeBase::VPRecipeBase(), llvm::VPRecipeWithIRFlags::VPRecipeWithIRFlags(), llvm::VPRecipeWithIRFlags::VPRecipeWithIRFlags(), llvm::VPReductionEVLRecipe::VPReductionEVLRecipe(), llvm::VPReductionRecipe::VPReductionRecipe(), llvm::VPReductionRecipe::VPReductionRecipe(), llvm::VPScalarIVStepsRecipe::VPScalarIVStepsRecipe(), llvm::VPSingleDefRecipe::VPSingleDefRecipe(), llvm::VPSingleDefRecipe::VPSingleDefRecipe(), llvm::VPSingleDefRecipe::VPSingleDefRecipe(), and llvm::VPWidenPHIRecipe::VPWidenPHIRecipe().
| bool DebugLoc::isImplicitCode | ( | ) | const |
Check if the DebugLoc corresponds to an implicit code.
Definition at line 75 of file DebugLoc.cpp.
References get().
Referenced by inlineDebugLoc().
Return true if the source locations match, ignoring isImplicitCode and source atom info.
Definition at line 242 of file DebugLoc.h.
References DebugLoc(), get(), getCol(), getInlinedAt(), getLine(), getScope(), and llvm::Other.
Referenced by cloneInstructionsIntoPredecessorBlockAndUpdateSSAUses().
|
inlineexplicit |
Check for null.
Check for null in a way that is safe with broken debug info. Unlike the conversion to DILocation, this doesn't require that Loc is of the right type. Important for cases like llvm::StripDebugInfo() and Instruction::hasMetadata().
Definition at line 230 of file DebugLoc.h.
|
inline |
Definition at line 219 of file DebugLoc.h.
References get().
Definition at line 284 of file DebugLoc.h.
References DebugLoc(), and DL.
|
inline |
Definition at line 221 of file DebugLoc.h.
References get().
|
inline |
Definition at line 220 of file DebugLoc.h.
References get().
Definition at line 283 of file DebugLoc.h.
References DebugLoc(), and DL.
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 185 of file DebugLoc.h.
References DebugLoc(), and llvm::Other.
| void DebugLoc::print | ( | raw_ostream & | OS | ) | const |
prints source location /path/to/file.exe:line:col @[inlined at]
Definition at line 190 of file DebugLoc.cpp.
References llvm::cast(), DebugLoc(), getCol(), getInlinedAt(), getLine(), and getScope().
Referenced by dump().
|
static |
Rebuild the entire inline-at chain by replacing the subprogram at the end of the chain with NewSP.
Definition at line 86 of file DebugLoc.cpp.
References llvm::cast(), llvm::DILocalScope::cloneScopeForSubprogram(), DebugLoc(), llvm::MDNode::get(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::reverse().
Referenced by fixupDebugInfoPostExtraction().
| void DebugLoc::setImplicitCode | ( | bool | ImplicitCode | ) |
Definition at line 81 of file DebugLoc.cpp.
References get().