LLVM 20.0.0git
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::DebugHandlerBase Class Referenceabstract

Base class for debug information backends. More...

#include "llvm/CodeGen/DebugHandlerBase.h"

Inheritance diagram for llvm::DebugHandlerBase:
Inheritance graph
[legend]

Public Member Functions

virtual ~DebugHandlerBase ()
 
virtual void setSymbolSize (const MCSymbol *Sym, uint64_t Size)
 For symbols that have a size designated (e.g.
 
virtual void beginModule (Module *M)
 
virtual void endModule ()=0
 
virtual void beginInstruction (const MachineInstr *MI)
 
virtual void endInstruction ()
 
void beginFunction (const MachineFunction *MF)
 
void endFunction (const MachineFunction *MF)
 
void beginBasicBlockSection (const MachineBasicBlock &MBB)
 
void endBasicBlockSection (const MachineBasicBlock &MBB)
 
virtual void beginCodeAlignment (const MachineBasicBlock &MBB)
 
MCSymbolgetLabelBeforeInsn (const MachineInstr *MI)
 Return Label preceding the instruction.
 
MCSymbolgetLabelAfterInsn (const MachineInstr *MI)
 Return Label immediately following the instruction.
 
const InstructionOrderinggetInstOrdering () const
 

Static Public Member Functions

static uint64_t getBaseTypeSize (const DIType *Ty)
 If this type is derived from a base type then return base type size.
 
static bool isUnsignedDIType (const DIType *Ty)
 Return true if type encoding is unsigned.
 

Protected Member Functions

 DebugHandlerBase (AsmPrinter *A)
 
void identifyScopeMarkers ()
 Indentify instructions that are marking the beginning of or ending of a scope.
 
void requestLabelBeforeInsn (const MachineInstr *MI)
 Ensure that a label will be emitted before MI.
 
void requestLabelAfterInsn (const MachineInstr *MI)
 Ensure that a label will be emitted after MI.
 
virtual void beginFunctionImpl (const MachineFunction *MF)=0
 
virtual void endFunctionImpl (const MachineFunction *MF)=0
 
virtual void skippedNonDebugFunction ()
 

Protected Attributes

AsmPrinterAsm = nullptr
 Target of debug info emission.
 
MachineModuleInfoMMI = nullptr
 Collected machine module information.
 
DebugLoc PrevInstLoc
 Previous instruction's location information.
 
MCSymbolPrevLabel = nullptr
 
const MachineBasicBlockPrevInstBB = nullptr
 
DebugLoc PrologEndLoc
 This location indicates end of function prologue and beginning of function body.
 
const MachineBasicBlockEpilogBeginBlock = nullptr
 This block includes epilogue instructions.
 
const MachineInstrCurMI = nullptr
 If nonnull, stores the current machine instruction we're processing.
 
LexicalScopes LScopes
 
DbgValueHistoryMap DbgValues
 History of DBG_VALUE and clobber instructions for each user variable.
 
DbgLabelInstrMap DbgLabels
 Mapping of inlined labels and DBG_LABEL machine instruction.
 
DenseMap< const MachineInstr *, MCSymbol * > LabelsBeforeInsn
 Maps instruction with label emitted before instruction.
 
DenseMap< const MachineInstr *, MCSymbol * > LabelsAfterInsn
 Maps instruction with label emitted after instruction.
 

Detailed Description

Base class for debug information backends.

Common functionality related to tracking which variables and scopes are alive at a given PC live here.

Definition at line 53 of file DebugHandlerBase.h.

Constructor & Destructor Documentation

◆ DebugHandlerBase()

DebugHandlerBase::DebugHandlerBase ( AsmPrinter A)
protected

Definition at line 101 of file DebugHandlerBase.cpp.

◆ ~DebugHandlerBase()

DebugHandlerBase::~DebugHandlerBase ( )
virtualdefault

Member Function Documentation

◆ beginBasicBlockSection()

void DebugHandlerBase::beginBasicBlockSection ( const MachineBasicBlock MBB)

◆ beginCodeAlignment()

virtual void llvm::DebugHandlerBase::beginCodeAlignment ( const MachineBasicBlock MBB)
inlinevirtual

Reimplemented in llvm::DwarfDebug.

Definition at line 140 of file DebugHandlerBase.h.

◆ beginFunction()

void DebugHandlerBase::beginFunction ( const MachineFunction MF)

◆ beginFunctionImpl()

virtual void llvm::DebugHandlerBase::beginFunctionImpl ( const MachineFunction MF)
protectedpure virtual

◆ beginInstruction()

void DebugHandlerBase::beginInstruction ( const MachineInstr MI)
virtual

◆ beginModule()

void DebugHandlerBase::beginModule ( Module M)
virtual

Reimplemented in llvm::CodeViewDebug, and llvm::DwarfDebug.

Definition at line 105 of file DebugHandlerBase.cpp.

References Asm.

Referenced by llvm::DwarfDebug::beginModule().

◆ endBasicBlockSection()

void DebugHandlerBase::endBasicBlockSection ( const MachineBasicBlock MBB)

Definition at line 430 of file DebugHandlerBase.cpp.

References PrevLabel.

◆ endFunction()

void DebugHandlerBase::endFunction ( const MachineFunction MF)

◆ endFunctionImpl()

virtual void llvm::DebugHandlerBase::endFunctionImpl ( const MachineFunction MF)
protectedpure virtual

Implemented in llvm::CodeViewDebug, llvm::DwarfDebug, and llvm::BTFDebug.

Referenced by endFunction().

◆ endInstruction()

void DebugHandlerBase::endInstruction ( )
virtual

◆ endModule()

virtual void llvm::DebugHandlerBase::endModule ( )
pure virtual

◆ getBaseTypeSize()

uint64_t DebugHandlerBase::getBaseTypeSize ( const DIType Ty)
static

If this type is derived from a base type then return base type size.

Definition at line 149 of file DebugHandlerBase.cpp.

References assert(), getBaseTypeSize(), llvm::DIType::getSizeInBits(), and llvm::DINode::getTag().

Referenced by getBaseTypeSize().

◆ getInstOrdering()

const InstructionOrdering & llvm::DebugHandlerBase::getInstOrdering ( ) const
inline

Definition at line 154 of file DebugHandlerBase.h.

◆ getLabelAfterInsn()

MCSymbol * DebugHandlerBase::getLabelAfterInsn ( const MachineInstr MI)

Return Label immediately following the instruction.

Definition at line 144 of file DebugHandlerBase.cpp.

References LabelsAfterInsn, and MI.

Referenced by llvm::DwarfCompileUnit::attachRangesOrLowHighPC(), llvm::CodeViewDebug::endFunctionImpl(), and llvm::DwarfDebug::isLexicalScopeDIENull().

◆ getLabelBeforeInsn()

MCSymbol * DebugHandlerBase::getLabelBeforeInsn ( const MachineInstr MI)

Return Label preceding the instruction.

Definition at line 137 of file DebugHandlerBase.cpp.

References assert(), LabelsBeforeInsn, and MI.

Referenced by llvm::DwarfCompileUnit::attachRangesOrLowHighPC(), and llvm::CodeViewDebug::endFunctionImpl().

◆ identifyScopeMarkers()

void DebugHandlerBase::identifyScopeMarkers ( )
protected

◆ isUnsignedDIType()

bool DebugHandlerBase::isUnsignedDIType ( const DIType Ty)
static

◆ requestLabelAfterInsn()

void llvm::DebugHandlerBase::requestLabelAfterInsn ( const MachineInstr MI)
inlineprotected

Ensure that a label will be emitted after MI.

Definition at line 112 of file DebugHandlerBase.h.

References LabelsAfterInsn, and MI.

Referenced by beginFunction(), llvm::CodeViewDebug::beginFunctionImpl(), llvm::DwarfDebug::beginInstruction(), and identifyScopeMarkers().

◆ requestLabelBeforeInsn()

void llvm::DebugHandlerBase::requestLabelBeforeInsn ( const MachineInstr MI)
inlineprotected

Ensure that a label will be emitted before MI.

Definition at line 107 of file DebugHandlerBase.h.

References LabelsBeforeInsn, and MI.

Referenced by beginFunction(), llvm::CodeViewDebug::beginFunctionImpl(), llvm::DwarfDebug::beginInstruction(), and identifyScopeMarkers().

◆ setSymbolSize()

virtual void llvm::DebugHandlerBase::setSymbolSize ( const MCSymbol Sym,
uint64_t  Size 
)
inlinevirtual

For symbols that have a size designated (e.g.

common symbols), this tracks that size. Only used by DWARF.

Reimplemented in llvm::DwarfDebug.

Definition at line 126 of file DebugHandlerBase.h.

◆ skippedNonDebugFunction()

virtual void llvm::DebugHandlerBase::skippedNonDebugFunction ( )
inlineprotectedvirtual

Reimplemented in llvm::DwarfDebug.

Definition at line 118 of file DebugHandlerBase.h.

Referenced by beginFunction().

Member Data Documentation

◆ Asm

AsmPrinter* llvm::DebugHandlerBase::Asm = nullptr
protected

◆ CurMI

const MachineInstr* llvm::DebugHandlerBase::CurMI = nullptr
protected

If nonnull, stores the current machine instruction we're processing.

Definition at line 83 of file DebugHandlerBase.h.

Referenced by beginInstruction(), llvm::DwarfDebug::beginInstruction(), llvm::BTFDebug::beginInstruction(), endInstruction(), and llvm::DwarfDebug::endModule().

◆ DbgLabels

DbgLabelInstrMap llvm::DebugHandlerBase::DbgLabels
protected

Mapping of inlined labels and DBG_LABEL machine instruction.

Definition at line 92 of file DebugHandlerBase.h.

Referenced by beginFunction(), and endFunction().

◆ DbgValues

DbgValueHistoryMap llvm::DebugHandlerBase::DbgValues
protected

History of DBG_VALUE and clobber instructions for each user variable.

Variables are listed in order of appearance.

Definition at line 89 of file DebugHandlerBase.h.

Referenced by beginFunction(), and endFunction().

◆ EpilogBeginBlock

const MachineBasicBlock* llvm::DebugHandlerBase::EpilogBeginBlock = nullptr
protected

This block includes epilogue instructions.

Definition at line 80 of file DebugHandlerBase.h.

Referenced by beginBasicBlockSection(), and llvm::DwarfDebug::beginInstruction().

◆ LabelsAfterInsn

DenseMap<const MachineInstr *, MCSymbol *> llvm::DebugHandlerBase::LabelsAfterInsn
protected

Maps instruction with label emitted after instruction.

Definition at line 100 of file DebugHandlerBase.h.

Referenced by endFunction(), endInstruction(), getLabelAfterInsn(), and requestLabelAfterInsn().

◆ LabelsBeforeInsn

DenseMap<const MachineInstr *, MCSymbol *> llvm::DebugHandlerBase::LabelsBeforeInsn
protected

Maps instruction with label emitted before instruction.

FIXME: Make this private from DwarfDebug, we have the necessary accessors for it.

Definition at line 97 of file DebugHandlerBase.h.

Referenced by beginFunction(), beginInstruction(), endFunction(), getLabelBeforeInsn(), and requestLabelBeforeInsn().

◆ LScopes

LexicalScopes llvm::DebugHandlerBase::LScopes
protected

◆ MMI

MachineModuleInfo* llvm::DebugHandlerBase::MMI = nullptr
protected

◆ PrevInstBB

const MachineBasicBlock* llvm::DebugHandlerBase::PrevInstBB = nullptr
protected

◆ PrevInstLoc

DebugLoc llvm::DebugHandlerBase::PrevInstLoc
protected

Previous instruction's location information.

This is used to determine label location to indicate scope boundaries in debug info. We track the previous instruction's source location (if not line 0), whether it was a label, and its parent BB.

Definition at line 71 of file DebugHandlerBase.h.

Referenced by beginFunction(), llvm::DwarfDebug::beginInstruction(), and llvm::BTFDebug::beginInstruction().

◆ PrevLabel

MCSymbol* llvm::DebugHandlerBase::PrevLabel = nullptr
protected

◆ PrologEndLoc

DebugLoc llvm::DebugHandlerBase::PrologEndLoc
protected

This location indicates end of function prologue and beginning of function body.

Definition at line 77 of file DebugHandlerBase.h.

Referenced by llvm::CodeViewDebug::beginFunctionImpl(), llvm::DwarfDebug::beginFunctionImpl(), llvm::DwarfDebug::beginInstruction(), and llvm::DwarfDebug::emitInitialLocDirective().


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