LLVM 17.0.0git
|
Collects and handles dwarf debug information. More...
#include "CodeGen/AsmPrinter/DwarfDebug.h"
Public Types | |
enum class | MinimizeAddrInV5 { Default , Disabled , Ranges , Expressions , Form } |
Public Member Functions | |
DwarfDebug (AsmPrinter *A) | |
~DwarfDebug () override | |
void | beginModule (Module *M) override |
Emit all Dwarf sections that should come prior to the content. | |
void | endModule () override |
Emit all Dwarf sections that should come after the content. | |
DebugLoc | emitInitialLocDirective (const MachineFunction &MF, unsigned CUID) |
Emits inital debug location directive. | |
void | beginInstruction (const MachineInstr *MI) override |
Process beginning of an instruction. | |
void | addDwarfTypeUnitType (DwarfCompileUnit &CU, StringRef Identifier, DIE &Die, const DICompositeType *CTy) |
Add a DIE to the set of types that we're going to pull into type units. | |
void | addArangeLabel (SymbolCU SCU) |
Add a label so that arange data can be generated for it. | |
void | setSymbolSize (const MCSymbol *Sym, uint64_t Size) override |
For symbols that have a size designated (e.g. | |
bool | useAllLinkageNames () const |
Returns whether we should emit all DW_AT_[MIPS_]linkage_name. | |
bool | useGNUTLSOpcode () const |
Returns whether to use DW_OP_GNU_push_tls_address, instead of the standard DW_OP_form_tls_address opcode. | |
bool | useDWARF2Bitfields () const |
Returns whether to use the DWARF2 format for bitfields instyead of the DWARF4 format. | |
bool | useInlineStrings () const |
Returns whether to use inline strings. | |
bool | useRangesSection () const |
Returns whether ranges section should be emitted. | |
bool | alwaysUseRanges (const DwarfCompileUnit &) const |
Returns whether range encodings should be used for single entry range lists. | |
bool | useAddrOffsetExpressions () const |
bool | useAddrOffsetForm () const |
bool | useSectionsAsReferences () const |
Returns whether to use sections as labels rather than temp symbols. | |
bool | useLocSection () const |
Returns whether .debug_loc section should be emitted. | |
bool | generateTypeUnits () const |
Returns whether to generate DWARF v4 type units. | |
AccelTableKind | getAccelTableKind () const |
Returns what kind (if any) of accelerator tables to emit. | |
bool | useAppleExtensionAttributes () const |
bool | useSplitDwarf () const |
Returns whether or not to change the current debug info for the split dwarf proposal support. | |
bool | useSegmentedStringOffsetsTable () const |
Returns whether to generate a string offsets table with (possibly shared) contributions from each CU and type unit. | |
bool | emitDebugEntryValues () const |
bool | useOpConvert () const |
bool | shareAcrossDWOCUs () const |
uint16_t | getDwarfVersion () const |
Returns the Dwarf Version. | |
dwarf::Form | getDwarfSectionOffsetForm () const |
Returns a suitable DWARF form to represent a section offset, i.e. | |
const DwarfCompileUnit * | getPrevCU () const |
Returns the previous CU that was being updated. | |
void | setPrevCU (const DwarfCompileUnit *PrevCU) |
void | terminateLineTable (const DwarfCompileUnit *CU) |
Terminate the line table by adding the last range label. | |
const DebugLocStream & | getDebugLocs () const |
Returns the entries for the .debug_loc section. | |
void | emitDebugLocEntry (ByteStreamer &Streamer, const DebugLocStream::Entry &Entry, const DwarfCompileUnit *CU) |
Emit an entry for the debug loc section. | |
void | emitDebugLocEntryLocation (const DebugLocStream::Entry &Entry, const DwarfCompileUnit *CU) |
Emit the location for a debug loc entry, including the size header. | |
void | addSubprogramNames (const DICompileUnit &CU, const DISubprogram *SP, DIE &Die) |
AddressPool & | getAddressPool () |
void | addAccelName (const DICompileUnit &CU, StringRef Name, const DIE &Die) |
void | addAccelObjC (const DICompileUnit &CU, StringRef Name, const DIE &Die) |
void | addAccelNamespace (const DICompileUnit &CU, StringRef Name, const DIE &Die) |
void | addAccelType (const DICompileUnit &CU, StringRef Name, const DIE &Die, char Flags) |
const MachineFunction * | getCurrentFunction () const |
bool | isLexicalScopeDIENull (LexicalScope *Scope) |
A helper function to check whether the DIE for a given Scope is going to be null. | |
DwarfCompileUnit * | lookupCU (const DIE *Die) |
Find the matching DwarfCompileUnit for the given CU DIE. | |
const DwarfCompileUnit * | lookupCU (const DIE *Die) const |
unsigned | getStringTypeLoc (const DIStringType *ST) const |
void | addStringTypeLoc (const DIStringType *ST, unsigned Loc) |
bool | tuneForGDB () const |
bool | tuneForLLDB () const |
bool | tuneForSCE () const |
bool | tuneForDBX () const |
const MCSymbol * | getSectionLabel (const MCSection *S) |
void | insertSectionLabel (const MCSymbol *S) |
std::optional< MD5::MD5Result > | getMD5AsBytes (const DIFile *File) const |
If the File has an MD5 checksum, return it as an MD5Result allocated in the MCContext. | |
![]() | |
void | beginModule (Module *M) override |
void | beginInstruction (const MachineInstr *MI) override |
Process beginning of an instruction. | |
void | endInstruction () override |
Process end of an instruction. | |
void | beginFunction (const MachineFunction *MF) override |
Gather pre-function debug information. | |
void | endFunction (const MachineFunction *MF) override |
Gather post-function debug information. | |
void | beginBasicBlockSection (const MachineBasicBlock &MBB) override |
Process the beginning of a new basic-block-section within a function. | |
void | endBasicBlockSection (const MachineBasicBlock &MBB) override |
Process the end of a basic-block-section within a function. | |
MCSymbol * | getLabelBeforeInsn (const MachineInstr *MI) |
Return Label preceding the instruction. | |
MCSymbol * | getLabelAfterInsn (const MachineInstr *MI) |
Return Label immediately following the instruction. | |
const InstructionOrdering & | getInstOrdering () const |
![]() | |
virtual | ~AsmPrinterHandler () |
Pin vtable to this file. | |
virtual void | setSymbolSize (const MCSymbol *Sym, uint64_t Size)=0 |
For symbols that have a size designated (e.g. | |
virtual void | beginModule (Module *M) |
virtual void | endModule ()=0 |
Emit all sections that should come after the content. | |
virtual void | beginFunction (const MachineFunction *MF)=0 |
Gather pre-function debug information. | |
virtual void | markFunctionEnd () |
virtual void | endFunction (const MachineFunction *MF)=0 |
Gather post-function debug information. | |
virtual void | beginBasicBlockSection (const MachineBasicBlock &MBB) |
Process the beginning of a new basic-block-section within a function. | |
virtual void | endBasicBlockSection (const MachineBasicBlock &MBB) |
Process the end of a basic-block-section within a function. | |
virtual void | beginFunclet (const MachineBasicBlock &MBB, MCSymbol *Sym=nullptr) |
Emit target-specific EH funclet machinery. | |
virtual void | endFunclet () |
virtual void | beginInstruction (const MachineInstr *MI)=0 |
Process beginning of an instruction. | |
virtual void | endInstruction ()=0 |
Process end of an instruction. | |
Static Public Member Functions | |
static uint64_t | makeTypeSignature (StringRef Identifier) |
Perform an MD5 checksum of Identifier and return the lower 64 bits. | |
static void | emitDebugLocValue (const AsmPrinter &AP, const DIBasicType *BT, const DbgValueLoc &Value, DwarfExpression &DwarfExpr) |
![]() | |
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 | |
void | beginFunctionImpl (const MachineFunction *MF) override |
Gather pre-function debug information. | |
void | endFunctionImpl (const MachineFunction *MF) override |
Gather and emit post-function debug information. | |
unsigned | getDwarfCompileUnitIDForLineTable (const DwarfCompileUnit &CU) |
Get Dwarf compile unit ID for line table. | |
void | skippedNonDebugFunction () override |
![]() | |
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 () |
Additional Inherited Members | |
![]() | |
AsmPrinter * | Asm = nullptr |
Target of debug info emission. | |
MachineModuleInfo * | MMI = nullptr |
Collected machine module information. | |
DebugLoc | PrevInstLoc |
Previous instruction's location information. | |
MCSymbol * | PrevLabel = nullptr |
const MachineBasicBlock * | PrevInstBB = nullptr |
DebugLoc | PrologEndLoc |
This location indicates end of function prologue and beginning of function body. | |
const MachineBasicBlock * | EpilogBeginBlock = nullptr |
This block includes epilogue instructions. | |
const MachineInstr * | CurMI = 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. | |
Collects and handles dwarf debug information.
Definition at line 296 of file DwarfDebug.h.
|
strong |
Enumerator | |
---|---|
Default | |
Disabled | |
Ranges | |
Expressions | |
Form |
Definition at line 383 of file DwarfDebug.h.
DwarfDebug::DwarfDebug | ( | AsmPrinter * | A | ) |
Definition at line 348 of file DwarfDebug.cpp.
References A, AllLinkageNames, llvm::DebugHandlerBase::Asm, computeAccelTableKind(), llvm::DBX, llvm::TargetOptions::DebuggerTuning, llvm::Default, Default, DefaultLinkageNames, llvm::dwarf::DWARF32, llvm::dwarf::DWARF64, llvm::MCTargetOptions::Dwarf64, llvm::dwarf::DWARF_VERSION, DwarfInlinedStrings, DwarfLinkageNames, DwarfOpConvert, DwarfSectionsAsReferences, llvm::MCTargetOptions::DwarfVersion, llvm::Enable, llvm::GDB, GenerateDwarfTypeUnits, llvm::Module::getDwarfVersion(), llvm::MachineModuleInfo::getModule(), llvm::TargetMachine::getTargetTriple(), llvm::Module::isDwarf64(), llvm::LLDB, llvm::TargetOptions::MCOptions, MinimizeAddrInV5Option, llvm::DebugHandlerBase::MMI, NoDwarfRangesSection, llvm::TargetMachine::Options, llvm::AsmPrinter::OutStreamer, llvm::report_fatal_error(), llvm::SCE, llvm::TargetOptions::ShouldEmitDebugEntryValues(), llvm::MCTargetOptions::SplitDwarfFile, llvm::AsmPrinter::TM, tuneForDBX(), tuneForGDB(), tuneForLLDB(), tuneForSCE(), UseGNUDebugMacro, and useSplitDwarf().
|
overridedefault |
void DwarfDebug::addAccelName | ( | const DICompileUnit & | CU, |
StringRef | Name, | ||
const DIE & | Die | ||
) |
Definition at line 3563 of file DwarfDebug.cpp.
References Name.
Referenced by llvm::DwarfCompileUnit::addLocationAttribute(), and addSubprogramNames().
void DwarfDebug::addAccelNamespace | ( | const DICompileUnit & | CU, |
StringRef | Name, | ||
const DIE & | Die | ||
) |
Definition at line 3575 of file DwarfDebug.cpp.
References Name.
Referenced by llvm::DwarfCompileUnit::constructImportedEntityDIE(), and llvm::DwarfUnit::getOrCreateNameSpace().
void DwarfDebug::addAccelObjC | ( | const DICompileUnit & | CU, |
StringRef | Name, | ||
const DIE & | Die | ||
) |
Definition at line 3568 of file DwarfDebug.cpp.
References llvm::Apple, getAccelTableKind(), and Name.
Referenced by addSubprogramNames().
void DwarfDebug::addAccelType | ( | const DICompileUnit & | CU, |
StringRef | Name, | ||
const DIE & | Die, | ||
char | Flags | ||
) |
Definition at line 3580 of file DwarfDebug.cpp.
References Name.
|
inline |
Add a label so that arange data can be generated for it.
Definition at line 671 of file DwarfDebug.h.
Referenced by llvm::DwarfCompileUnit::addLabelAddress(), llvm::DwarfCompileUnit::addLocationAttribute(), and endFunctionImpl().
void DwarfDebug::addDwarfTypeUnitType | ( | DwarfCompileUnit & | CU, |
StringRef | Identifier, | ||
DIE & | Die, | ||
const DICompositeType * | CTy | ||
) |
Add a DIE to the set of types that we're going to pull into type units.
Definition at line 3445 of file DwarfDebug.cpp.
References llvm::DwarfUnit::addStringOffsetsStart(), llvm::DwarfUnit::addUInt(), llvm::DebugHandlerBase::Asm, llvm::DwarfFile::computeSizeAndOffsetsForUnit(), llvm::DwarfUnit::createTypeDIE(), llvm::DwarfFile::emitUnit(), llvm::MCObjectFileInfo::getDwarfInfoDWOSection(), llvm::MCObjectFileInfo::getDwarfInfoSection(), llvm::MCObjectFileInfo::getDwarfTypesDWOSection(), llvm::MCObjectFileInfo::getDwarfTypesSection(), getDwarfVersion(), llvm::AsmPrinter::getObjFileLowering(), llvm::DIEUnit::getUnitDie(), llvm::AddressPool::hasBeenUsed(), makeTypeSignature(), llvm::AddressPool::resetUsedFlag(), llvm::DIEUnit::setSection(), llvm::DwarfTypeUnit::setType(), llvm::DwarfTypeUnit::setTypeSignature(), useSegmentedStringOffsetsTable(), and useSplitDwarf().
Referenced by llvm::DwarfUnit::createTypeDIE().
|
inline |
Definition at line 817 of file DwarfDebug.h.
References assert().
void DwarfDebug::addSubprogramNames | ( | const DICompileUnit & | CU, |
const DISubprogram * | SP, | ||
DIE & | Die | ||
) |
Definition at line 494 of file DwarfDebug.cpp.
References addAccelName(), addAccelObjC(), llvm::Apple, llvm::DwarfFile::getAbstractSPDies(), getAccelTableKind(), llvm::DIScope::getName(), getObjCClassCategory(), getObjCMethodName(), isObjCClass(), llvm::DICompileUnit::None, and useAllLinkageNames().
Referenced by llvm::DwarfCompileUnit::constructInlinedScopeDIE(), and llvm::DwarfCompileUnit::updateSubprogramScopeDIEImpl().
bool DwarfDebug::alwaysUseRanges | ( | const DwarfCompileUnit & | CU | ) | const |
Returns whether range encodings should be used for single entry range lists.
Definition at line 3628 of file DwarfDebug.cpp.
References Default, Ranges, and useSplitDwarf().
Referenced by llvm::DwarfCompileUnit::attachRangesOrLowHighPC().
|
overrideprotectedvirtual |
Gather pre-function debug information.
Implements llvm::DebugHandlerBase.
Definition at line 2218 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm, assert(), emitInitialLocDirective(), llvm::LexicalScopes::empty(), llvm::LexicalScopes::getCurrentFunctionScope(), getDwarfCompileUnitIDForLineTable(), llvm::MachineFunction::getFunction(), llvm::LexicalScope::getScopeNode(), llvm::Function::getSubprogram(), llvm::DebugHandlerBase::LScopes, llvm::DICompileUnit::NoDebug, llvm::AsmPrinter::OutStreamer, and llvm::DebugHandlerBase::PrologEndLoc.
|
overridevirtual |
Process beginning of an instruction.
Reimplemented from llvm::DebugHandlerBase.
Definition at line 2001 of file DwarfDebug.cpp.
References llvm::MachineInstr::AnyInBundle, llvm::DebugHandlerBase::Asm, assert(), llvm::DebugHandlerBase::beginInstruction(), llvm::DebugHandlerBase::CurMI, llvm::Disable, DL, DWARF2_FLAG_EPILOGUE_BEGIN, DWARF2_FLAG_IS_STMT, DWARF2_FLAG_PROLOGUE_END, llvm::Enable, llvm::DebugHandlerBase::EpilogBeginBlock, Flags, llvm::MachineInstr::FrameDestroy, llvm::MachineInstr::FrameSetup, llvm::DebugLoc::getCol(), llvm::MachineFunction::getFunction(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::DebugLoc::getLine(), llvm::DebugLoc::getScope(), llvm::MachineBasicBlock::getSectionIDNum(), llvm::Function::getSubprogram(), llvm::MachineFunction::getSubtarget(), llvm::HexagonInstrInfo::isTailCall(), MBB, MI, llvm::DICompileUnit::NoDebug, llvm::AsmPrinter::OutStreamer, llvm::DebugHandlerBase::PrevInstBB, llvm::DebugHandlerBase::PrevInstLoc, llvm::DebugHandlerBase::PrevLabel, llvm::DebugHandlerBase::PrologEndLoc, llvm::DebugHandlerBase::requestLabelAfterInsn(), llvm::DebugHandlerBase::requestLabelBeforeInsn(), TII, and UnknownLocations.
|
overridevirtual |
Emit all Dwarf sections that should come prior to the content.
Reimplemented from llvm::DebugHandlerBase.
Definition at line 1171 of file DwarfDebug.cpp.
References llvm::any_of(), llvm::DebugHandlerBase::Asm, assert(), llvm::DebugHandlerBase::beginModule(), llvm::AsmPrinter::createTempSymbol(), getDwarfVersion(), llvm::Global, llvm::MachineModuleInfo::hasDebugInfo(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), llvm::DebugHandlerBase::MMI, llvm::AddressPool::setLabel(), llvm::DwarfFile::setRnglistsTableBaseSym(), llvm::DebugLocStream::setSym(), sortGlobalExprs(), useSegmentedStringOffsetsTable(), and useSplitDwarf().
|
inline |
Definition at line 747 of file DwarfDebug.h.
void DwarfDebug::emitDebugLocEntry | ( | ByteStreamer & | Streamer, |
const DebugLocStream::Entry & | Entry, | ||
const DwarfCompileUnit * | CU | ||
) |
Emit an entry for the debug loc section.
This can be used to handle an entry that's going to be emitted into the debug loc section.
Definition at line 2587 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm, assert(), llvm::ArrayRef< T >::data(), llvm::Data, llvm::ByteStreamer::emitDIERef(), llvm::ByteStreamer::emitInt8(), End, llvm::DebugLocStream::getBytes(), llvm::MCAsmInfo::getCodePointerSize(), llvm::DebugLocStream::getComments(), llvm::AsmPrinter::getDataLayout(), llvm::MCContext::getDwarfFormat(), I, llvm::DataLayout::isLittleEndian(), llvm::Length, llvm::AsmPrinter::MAI, llvm::Offset, llvm::AsmPrinter::OutContext, and llvm::ArrayRef< T >::size().
Referenced by emitDebugLocEntryLocation().
void DwarfDebug::emitDebugLocEntryLocation | ( | const DebugLocStream::Entry & | Entry, |
const DwarfCompileUnit * | CU | ||
) |
Emit the location for a debug loc entry, including the size header.
Definition at line 2757 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm, emitDebugLocEntry(), llvm::AsmPrinter::emitInt16(), llvm::AsmPrinter::emitULEB128(), llvm::DebugLocStream::getBytes(), getDwarfVersion(), llvm::AsmPrinter::OutStreamer, and llvm::ArrayRef< T >::size().
|
static |
Definition at line 2632 of file DwarfDebug.cpp.
References llvm::DwarfExpression::addConstantFP(), llvm::DwarfExpression::addExpression(), llvm::DwarfExpression::addFragmentOffset(), llvm::DwarfExpression::addMachineRegExpression(), llvm::DwarfExpression::addSignedConstant(), llvm::DwarfExpression::addUnsignedConstant(), llvm::DwarfExpression::addWasmLocation(), llvm::any_of(), assert(), llvm::DwarfExpression::beginEntryValueExpression(), llvm::dbgs(), llvm::AsmPrinter::getDwarfDebug(), llvm::AsmPrinter::getDwarfVersion(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::TargetMachine::getTargetTriple(), Idx, llvm::TargetIndexLocation::Index, llvm::Triple::isWasm(), LLVM_DEBUG, llvm::AsmPrinter::MF, llvm::TargetIndexLocation::Offset, llvm::DwarfExpression::setLocation(), llvm::DwarfExpression::setMemoryLocationKind(), llvm::AsmPrinter::TM, TRI, and tuneForSCE().
Referenced by llvm::DwarfCompileUnit::constructCallSiteParmEntryDIEs(), and llvm::DebugLocEntry::finalize().
DebugLoc DwarfDebug::emitInitialLocDirective | ( | const MachineFunction & | MF, |
unsigned | CUID | ||
) |
Emits inital debug location directive.
Definition at line 2190 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm, DWARF2_FLAG_IS_STMT, findPrologueEndLoc(), getDwarfVersion(), llvm::MachineFunction::getFunction(), llvm::Function::getSubprogram(), and llvm::DebugHandlerBase::PrologEndLoc.
Referenced by beginFunctionImpl(), and llvm::AsmPrinter::emitInitialRawDwarfLocDirective().
|
overrideprotectedvirtual |
Gather and emit post-function debug information.
Implements llvm::DebugHandlerBase.
Definition at line 2269 of file DwarfDebug.cpp.
References addArangeLabel(), llvm::DwarfCompileUnit::addRange(), llvm::DebugHandlerBase::Asm, assert(), llvm::DwarfCompileUnit::constructSubprogramScopeDIE(), DL, llvm::LexicalScopes::getAbstractScopesList(), llvm::DwarfUnit::getCUNode(), llvm::LexicalScopes::getCurrentFunctionScope(), llvm::DICompileUnit::getDebugInfoForProfiling(), llvm::DICompileUnit::getEmissionKind(), llvm::MachineFunction::getFunction(), llvm::DwarfFile::getScopeLabels(), llvm::LexicalScope::getScopeNode(), llvm::DwarfFile::getScopeVariables(), llvm::DwarfCompileUnit::getSkeleton(), llvm::DICompileUnit::getSplitDebugInlining(), llvm::Function::getSubprogram(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), llvm::DICompileUnit::isDebugDirectivesOnly(), llvm::DICompileUnit::LineTablesOnly, llvm_unreachable, llvm::DebugHandlerBase::LScopes, llvm::AsmPrinter::MBBSectionRanges, llvm::AsmPrinter::OutStreamer, and llvm::DebugHandlerBase::PrevLabel.
|
overridevirtual |
Emit all Dwarf sections that should come after the content.
Implements llvm::AsmPrinterHandler.
Definition at line 1436 of file DwarfDebug.cpp.
References llvm::Apple, llvm::DebugHandlerBase::Asm, assert(), llvm::DebugHandlerBase::CurMI, llvm::Default, llvm::Dwarf, GenerateARangeSection, getAccelTableKind(), llvm::MachineModuleInfo::hasDebugInfo(), llvm_unreachable, llvm::DebugHandlerBase::MMI, llvm::None, P, terminateLineTable(), and useSplitDwarf().
|
inline |
Returns whether to generate DWARF v4 type units.
Definition at line 722 of file DwarfDebug.h.
Referenced by llvm::DwarfUnit::createTypeDIE(), and llvm::DwarfUnit::isShareableAcrossCUs().
|
inline |
Returns what kind (if any) of accelerator tables to emit.
Definition at line 727 of file DwarfDebug.h.
Referenced by addAccelObjC(), addSubprogramNames(), endModule(), and llvm::DwarfCompileUnit::hasDwarfPubSections().
|
inline |
Definition at line 789 of file DwarfDebug.h.
Referenced by llvm::DwarfCompileUnit::addAddrTableBase(), llvm::DwarfCompileUnit::addLabelAddress(), llvm::DwarfCompileUnit::addLocationAttribute(), llvm::DwarfUnit::addPoolOpAddress(), and emitRangeList().
|
inline |
Definition at line 801 of file DwarfDebug.h.
Referenced by llvm::DwarfCompileUnit::updateSubprogramScopeDIEImpl().
|
inline |
Returns the entries for the .debug_loc section.
Definition at line 774 of file DwarfDebug.h.
Referenced by emitLocList(), emitLoclistsTableHeader(), and llvm::DIELocList::emitValue().
|
protected |
Get Dwarf compile unit ID for line table.
Definition at line 2237 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm, and llvm::AsmPrinter::OutStreamer.
Referenced by beginFunctionImpl(), and terminateLineTable().
dwarf::Form DwarfDebug::getDwarfSectionOffsetForm | ( | ) | const |
Returns a suitable DWARF form to represent a section offset, i.e.
Definition at line 3589 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm, assert(), llvm::AsmPrinter::getDwarfVersion(), and llvm::AsmPrinter::isDwarf64().
Referenced by llvm::DwarfCompileUnit::addLocationList(), llvm::DwarfUnit::addSectionDelta(), llvm::DwarfUnit::addSectionLabel(), and llvm::DwarfUnit::addSectionOffset().
uint16_t DwarfDebug::getDwarfVersion | ( | ) | const |
Returns the Dwarf Version.
Definition at line 3585 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm, and llvm::AsmPrinter::OutStreamer.
Referenced by llvm::DwarfCompileUnit::addAddrTableBase(), llvm::DwarfUnit::addAttribute(), llvm::DwarfUnit::addBlock(), addDwarfTypeUnitType(), llvm::DwarfUnit::addFlag(), llvm::DwarfCompileUnit::addLabelAddress(), llvm::DwarfUnit::addLinkageName(), llvm::DwarfCompileUnit::addLocationList(), llvm::DwarfUnit::addOpAddress(), llvm::DwarfUnit::addPoolOpAddress(), llvm::DwarfUnit::addRnglistsBase(), llvm::DwarfCompileUnit::addScopeRangeList(), llvm::DwarfUnit::applySubprogramAttributes(), llvm::DwarfCompileUnit::attachLowHighPC(), beginModule(), llvm::DwarfCompileUnit::constructAbstractSubprogramScopeDIE(), llvm::DwarfCompileUnit::constructInlinedScopeDIE(), llvm::DwarfUnit::constructTypeDIE(), llvm::DwarfUnit::emitCommonHeader(), emitDebugLocEntryLocation(), llvm::DwarfCompileUnit::emitHeader(), emitInitialLocDirective(), emitRangeList(), GetCompileUnitType(), llvm::DwarfUnit::getHeaderSize(), llvm::DwarfCompileUnit::getHeaderSize(), getMD5AsBytes(), llvm::DwarfUnit::getOrCreateTypeDIE(), llvm::DwarfCompileUnit::hasDwarfPubSections(), insertSectionLabel(), and llvm::DwarfCompileUnit::useGNUAnalogForDwarf5Feature().
std::optional< MD5::MD5Result > DwarfDebug::getMD5AsBytes | ( | const DIFile * | File | ) | const |
If the File
has an MD5 checksum, return it as an MD5Result allocated in the MCContext.
Definition at line 3611 of file DwarfDebug.cpp.
References assert(), llvm::DIFile::CSK_MD5, and getDwarfVersion().
Referenced by llvm::DwarfCompileUnit::getOrCreateSourceID().
|
inline |
Returns the previous CU that was being updated.
Definition at line 767 of file DwarfDebug.h.
Referenced by llvm::DwarfCompileUnit::addRange().
Definition at line 3598 of file DwarfDebug.cpp.
References I.
Referenced by llvm::DwarfCompileUnit::addLabelAddress(), llvm::DwarfUnit::addPoolOpAddress(), llvm::DwarfCompileUnit::attachRangesOrLowHighPC(), and emitRangeList().
|
inline |
Definition at line 813 of file DwarfDebug.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup().
Definition at line 3604 of file DwarfDebug.cpp.
References getDwarfVersion(), llvm::AddressPool::getIndex(), llvm::MCSymbol::getSection(), and useSplitDwarf().
Referenced by llvm::DwarfCompileUnit::addRange().
bool DwarfDebug::isLexicalScopeDIENull | ( | LexicalScope * | Scope | ) |
A helper function to check whether the DIE for a given Scope is going to be null.
Check whether we should create a DIE for the given Scope, return true if we don't create a DIE (the corresponding DIE is null).
Definition at line 528 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::getLabelAfterInsn(), and Ranges.
Referenced by llvm::DwarfCompileUnit::constructLexicalScopeDIE(), and llvm::DwarfCompileUnit::constructScopeDIE().
|
inline |
Find the matching DwarfCompileUnit for the given CU DIE.
Definition at line 808 of file DwarfDebug.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup().
Referenced by llvm::DwarfCompileUnit::constructAbstractSubprogramScopeDIE(), and llvm::emitDWARF5AccelTable().
|
inline |
Definition at line 809 of file DwarfDebug.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup().
Perform an MD5 checksum of Identifier
and return the lower 64 bits.
Definition at line 3434 of file DwarfDebug.cpp.
References llvm::MD5::final(), and llvm::MD5::update().
Referenced by addDwarfTypeUnitType().
|
inline |
Definition at line 768 of file DwarfDebug.h.
Referenced by llvm::DwarfCompileUnit::addRange().
For symbols that have a size designated (e.g.
common symbols), this tracks that size.
Implements llvm::AsmPrinterHandler.
Definition at line 675 of file DwarfDebug.h.
bool DwarfDebug::shareAcrossDWOCUs | ( | ) | const |
Definition at line 552 of file DwarfDebug.cpp.
References SplitDwarfCrossCuReferences.
Referenced by llvm::DwarfUnit::addDIEEntry(), and llvm::DwarfUnit::isShareableAcrossCUs().
|
overrideprotectedvirtual |
Reimplemented from llvm::DebugHandlerBase.
Definition at line 2257 of file DwarfDebug.cpp.
References terminateLineTable().
void DwarfDebug::terminateLineTable | ( | const DwarfCompileUnit * | CU | ) |
Terminate the line table by adding the last range label.
Definition at line 2248 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm, getDwarfCompileUnitIDForLineTable(), and llvm::AsmPrinter::OutStreamer.
Referenced by llvm::DwarfCompileUnit::addRange(), endModule(), and skippedNonDebugFunction().
|
inline |
Definition at line 703 of file DwarfDebug.h.
References Expressions.
Referenced by llvm::DwarfCompileUnit::addLabelAddress(), and llvm::DwarfUnit::addPoolOpAddress().
|
inline |
Definition at line 709 of file DwarfDebug.h.
References Form.
Referenced by llvm::DwarfCompileUnit::addLabelAddress(), and llvm::DwarfUnit::addPoolOpAddress().
|
inline |
Returns whether we should emit all DW_AT_[MIPS_]linkage_name.
If not, we still might emit certain cases.
Definition at line 681 of file DwarfDebug.h.
Referenced by llvm::DwarfCompileUnit::addLocationAttribute(), addSubprogramNames(), and llvm::DwarfUnit::applySubprogramDefinitionAttributes().
|
inline |
Definition at line 729 of file DwarfDebug.h.
Referenced by llvm::DwarfUnit::applySubprogramAttributes(), and llvm::DwarfCompileUnit::updateSubprogramScopeDIEImpl().
|
inline |
Returns whether to use the DWARF2 format for bitfields instyead of the DWARF4 format.
Definition at line 689 of file DwarfDebug.h.
|
inline |
Returns whether to use DW_OP_GNU_push_tls_address, instead of the standard DW_OP_form_tls_address opcode.
Definition at line 685 of file DwarfDebug.h.
Referenced by llvm::DwarfCompileUnit::addLocationAttribute().
|
inline |
Returns whether to use inline strings.
Definition at line 692 of file DwarfDebug.h.
Referenced by llvm::DwarfUnit::addString().
|
inline |
Returns whether .debug_loc section should be emitted.
Definition at line 719 of file DwarfDebug.h.
|
inline |
Definition at line 751 of file DwarfDebug.h.
|
inline |
Returns whether ranges section should be emitted.
Definition at line 695 of file DwarfDebug.h.
Referenced by llvm::DwarfCompileUnit::attachRangesOrLowHighPC().
|
inline |
Returns whether to use sections as labels rather than temp symbols.
Definition at line 714 of file DwarfDebug.h.
Referenced by llvm::DwarfUnit::emitCommonHeader(), llvm::DwarfCompileUnit::emitHeader(), and llvm::DwarfCompileUnit::initStmtList().
|
inline |
Returns whether to generate a string offsets table with (possibly shared) contributions from each CU and type unit.
This implies the use of DW_FORM_strx* indirect references with DWARF v5 and beyond. Note that DW_FORM_GNU_str_index is also an indirect reference, but it is used with a pre-DWARF v5 implementation of split DWARF sections, which uses a monolithic string offsets table.
Definition at line 743 of file DwarfDebug.h.
Referenced by addDwarfTypeUnitType(), beginModule(), and llvm::DwarfUnit::useSegmentedStringOffsetsTable().
|
inline |
Returns whether or not to change the current debug info for the split dwarf proposal support.
Definition at line 735 of file DwarfDebug.h.
Referenced by llvm::DwarfUnit::addDIEEntry(), addDwarfTypeUnitType(), llvm::DwarfCompileUnit::addLabelAddress(), llvm::DwarfCompileUnit::addLocationAttribute(), llvm::DwarfUnit::addOpAddress(), alwaysUseRanges(), beginModule(), DwarfDebug(), llvm::emitDWARF5AccelTable(), llvm::DwarfCompileUnit::emitHeader(), llvm::DwarfTypeUnit::emitHeader(), emitMacroHeader(), llvm::DIELocList::emitValue(), endModule(), llvm::DwarfCompileUnit::getHeaderSize(), llvm::DwarfCompileUnit::includeMinimalInlineScopes(), and insertSectionLabel().