LLVM
8.0.1
|
A debug info location. More...
#include "llvm/IR/DebugLoc.h"
Public Types | |
enum | { ReplaceLastInlinedAt = true } |
Static Public Member Functions | |
static DebugLoc | get (unsigned Line, unsigned Col, const MDNode *Scope, const MDNode *InlinedAt=nullptr, bool ImplicitCode=false) |
Create a new DebugLoc. More... | |
static DebugLoc | appendInlinedAt (DebugLoc DL, DILocation *InlinedAt, LLVMContext &Ctx, DenseMap< const MDNode *, MDNode *> &Cache, bool ReplaceLast=false) |
Rebuild the entire inlined-at chain for this instruction so that the top of the chain now is inlined-at the new call site. More... | |
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 34 of file DebugLoc.h.
anonymous enum |
Enumerator | |
---|---|
ReplaceLastInlinedAt |
Definition at line 84 of file DebugLoc.h.
|
default |
Referenced by get(), and getFnDebugLoc().
DebugLoc::DebugLoc | ( | const DILocation * | L | ) |
Construct from an DILocation.
Definition at line 19 of file DebugLoc.cpp.
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 20 of file DebugLoc.cpp.
|
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. |
ReplaceLast | Replace the last location in the inlined-at chain. |
Definition at line 83 of file DebugLoc.cpp.
References llvm::MDNode::getDistinct(), llvm::SmallVectorTemplateBase< T >::push_back(), and llvm::reverse().
Referenced by fixupLineNumbers().
LLVM_DUMP_METHOD void DebugLoc::dump | ( | ) | const |
Definition at line 116 of file DebugLoc.cpp.
References llvm::dbgs(), and print().
Referenced by operator!=().
DILocation * DebugLoc::get | ( | ) | const |
Get the underlying DILocation.
isa<DILocation>(getAsMDNode())
. Definition at line 22 of file DebugLoc.cpp.
References llvm::TypedTrackingMDRef< T >::get().
Referenced by addLocIfNotPresent(), llvm::BTFDebug::beginInstruction(), CreatePrologue(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::MipsSEFrameLowering::emitEpilogue(), llvm::MSP430FrameLowering::emitEpilogue(), llvm::AVRFrameLowering::emitPrologue(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::SparcFrameLowering::emitPrologue(), llvm::MSP430FrameLowering::emitPrologue(), emitThumb1LoadConstPool(), fixupLineNumbers(), getFnDebugLoc(), INITIALIZE_PASS(), llvm::X86FrameLowering::inlineStackProbe(), isThunkProfitable(), llvm::PPCRegisterInfo::lowerCRBitRestore(), llvm::PPCRegisterInfo::lowerCRBitSpilling(), llvm::PPCRegisterInfo::lowerCRRestore(), llvm::PPCRegisterInfo::lowerCRSpilling(), llvm::PPCRegisterInfo::lowerDynamicAlloc(), llvm::PPCRegisterInfo::lowerDynamicAreaOffset(), llvm::PPCRegisterInfo::lowerVRSAVERestore(), llvm::PPCRegisterInfo::lowerVRSAVESpilling(), llvm::AVRFrameLowering::restoreCalleeSavedRegisters(), llvm::Thumb1FrameLowering::restoreCalleeSavedRegisters(), runOnFunction(), llvm::InsertNOPLoad::runOnMachineFunction(), llvm::FixAllFDIVSQRT::runOnMachineFunction(), llvm::AVRDynAllocaSR::runOnMachineFunction(), shouldInstrumentBlock(), llvm::AVRFrameLowering::spillCalleeSavedRegisters(), and StackMallocSizeClass().
|
static |
Create a new DebugLoc.
Create a new DebugLoc at the specified line/col and scope/inline. This forwards to DILocation::get().
If !Scope
, returns a default-constructed DebugLoc.
FIXME: Remove this. Users should use DILocation::get().
Definition at line 72 of file DebugLoc.cpp.
References DebugLoc(), llvm::MDNode::get(), and llvm::MDNode::getContext().
|
inline |
Return this
as a bar MDNode.
Definition at line 114 of file DebugLoc.h.
References isImplicitCode(), and setImplicitCode().
Referenced by getParentPad(), and getSubprogram().
unsigned DebugLoc::getCol | ( | ) | const |
Definition at line 31 of file DebugLoc.cpp.
References assert().
Referenced by addLocIfNotPresent(), llvm::DiagnosticInfoOptimizationBase::Argument::Argument(), llvm::BTFDebug::beginInstruction(), llvm::DwarfDebug::beginInstruction(), print(), and printDebugLoc().
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 50 of file DebugLoc.cpp.
References DebugLoc(), get(), llvm::getDISubprogram(), and getInlinedAtScope().
Referenced by llvm::CodeViewDebug::beginFunctionImpl().
DILocation * DebugLoc::getInlinedAt | ( | ) | const |
Definition at line 41 of file DebugLoc.cpp.
References assert().
Referenced by print(), and printDebugLoc().
MDNode * DebugLoc::getInlinedAtScope | ( | ) | const |
Get the fully inlined-at scope for a DebugLoc.
Gets the inlined-at scope for a DebugLoc.
Definition at line 46 of file DebugLoc.cpp.
Referenced by getFnDebugLoc().
unsigned DebugLoc::getLine | ( | ) | const |
Definition at line 26 of file DebugLoc.cpp.
References assert().
Referenced by addLocIfNotPresent(), llvm::DiagnosticInfoOptimizationBase::Argument::Argument(), llvm::BTFDebug::beginInstruction(), llvm::DwarfDebug::beginInstruction(), callsiteIsHot(), functionHasLines(), print(), printDebugLoc(), shouldKeepInEntry(), and SortCallTargets().
MDNode * DebugLoc::getScope | ( | ) | const |
Definition at line 36 of file DebugLoc.cpp.
References assert().
Referenced by llvm::DwarfDebug::beginInstruction(), print(), printDebugLoc(), and shouldKeepInEntry().
|
inline |
Check whether this has a trivial destructor.
Definition at line 70 of file DebugLoc.h.
References llvm::TypedTrackingMDRef< T >::hasTrivialDestructor().
Referenced by llvm::MachineInstr::addImplicitDefUseOperands(), llvm::SDNode::SDNode(), and llvm::MachineInstr::setDebugLoc().
bool DebugLoc::isImplicitCode | ( | ) | const |
Check if the DebugLoc corresponds to an implicit code.
Definition at line 59 of file DebugLoc.cpp.
Referenced by getAsMDNode(), and shouldKeepInEntry().
|
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 67 of file DebugLoc.h.
|
inline |
Definition at line 56 of file DebugLoc.h.
Definition at line 121 of file DebugLoc.h.
|
inline |
Definition at line 58 of file DebugLoc.h.
|
inline |
Definition at line 57 of file DebugLoc.h.
Definition at line 120 of file DebugLoc.h.
void DebugLoc::print | ( | raw_ostream & | OS | ) | const |
prints source location /path/to/file.exe:line:col @[inlined at]
Definition at line 119 of file DebugLoc.cpp.
References getCol(), getInlinedAt(), getLine(), and getScope().
Referenced by dump(), operator!=(), and llvm::MachineInstr::print().
void DebugLoc::setImplicitCode | ( | bool | ImplicitCode | ) |
Definition at line 66 of file DebugLoc.cpp.
Referenced by getAsMDNode().