|
LLVM 24.0.0git
|
Collects and handles dwarf debug information. More...
#include "CodeGen/AsmPrinter/DwarfDebug.h"
Public Types | |
| enum class | MinimizeAddrInV5 { Default , Disabled , Ranges , Expressions , Form } |
| enum class | DWARF5AccelTableKind { CU = 0 , TU = 1 } |
| enum class | VariableLocationKind { Global , Register , FrameIndex } |
| Describes the storage kind of a debug variable for target hooks. More... | |
Public Member Functions | |
| virtual bool | shouldResetBaseAddress (const MCSection &Section) const |
| Whether the target requires resetting the base address in range/loc lists. | |
| virtual const DIExpression * | adjustExpressionForTarget (const DIExpression *Expr, std::optional< unsigned > &TargetAddrSpace) const |
| Extract target-specific address space information from a DIExpression. | |
| virtual void | addTargetVariableAttributes (DwarfCompileUnit &CU, DIE &Die, std::optional< unsigned > TargetAddrSpace, VariableLocationKind VarLocKind, const GlobalVariable *GV=nullptr) const |
| Add target-specific attributes to a variable DIE (e.g. | |
| 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. | |
| const MachineInstr * | emitInitialLocDirective (const MachineFunction &MF, unsigned CUID) |
| Emits inital debug location directive. | |
| void | beginInstruction (const MachineInstr *MI) override |
| Process beginning of an instruction. | |
| void | beginCodeAlignment (const MachineBasicBlock &MBB) override |
| Process beginning of code alignment. | |
| 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. | |
| virtual bool | shouldEmitDwarfPubSections () const |
| Whether to emit .debug_pubnames / .debug_pubtypes. Default true;. | |
| 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 | generateTypeUnits () const |
| Returns whether to generate DWARF v4 type units. | |
| AccelTableKind | getAccelTableKind () const |
| Returns what kind (if any) of accelerator tables to emit. | |
| void | setTheAccelTableKind (AccelTableKind K) |
| Seet TheAccelTableKind. | |
| bool | useAppleExtensionAttributes () const |
| bool | useSplitDwarf () const |
| Returns whether or not to change the current debug info for split DWARF. | |
| 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 DwarfUnit &Unit, const DICompileUnit::DebugNameTableKind NameTableKind, const DISubprogram *SP, DIE &Die) |
| AddressPool & | getAddressPool () |
| void | addAccelName (const DwarfUnit &Unit, const DICompileUnit::DebugNameTableKind NameTableKind, StringRef Name, const DIE &Die) |
| void | addAccelObjC (const DwarfUnit &Unit, const DICompileUnit::DebugNameTableKind NameTableKind, StringRef Name, const DIE &Die) |
| void | addAccelNamespace (const DwarfUnit &Unit, const DICompileUnit::DebugNameTableKind NameTableKind, StringRef Name, const DIE &Die) |
| void | addAccelType (const DwarfUnit &Unit, const DICompileUnit::DebugNameTableKind NameTableKind, 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 |
| DwarfCompileUnit & | getOrCreateAbstractSubprogramCU (const DISubprogram *SP, DwarfCompileUnit &SrcCU) |
| Find the matching DwarfCompileUnit for the given SP referenced from SrcCU. | |
| bool | allFunctionsProcessed () const |
| Returns whether all functions of the module have been processed, so that abstract subprogram DIEs are not created for inlined subprograms anymore. | |
| bool | isProcessedSubprogram (const DISubprogram *SP) const |
Returns whether a DIE for the function of SP has been constructed. | |
| 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. | |
| MDNodeSet & | getLocalDeclsForScope (const DILocalScope *S) |
| void | setCurrentDWARF5AccelTable (const DWARF5AccelTableKind Kind) |
| Sets the current DWARF5AccelTable to use. | |
| DWARF5AccelTable & | getCurrentDWARF5AccelTable () |
| Returns either CU or TU DWARF5AccelTable. | |
| Public Member Functions inherited from llvm::DebugHandlerBase | |
| ~DebugHandlerBase () override | |
| 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 |
| Public Member Functions inherited from llvm::AsmPrinterHandler | |
| virtual | ~AsmPrinterHandler () |
| Pin vtables to this file. | |
| virtual void | markFunctionEnd () |
| virtual void | beginFunclet (const MachineBasicBlock &MBB, MCSymbol *Sym=nullptr) |
| Emit target-specific EH funclet machinery. | |
| virtual void | endFunclet () |
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 Public Member Functions inherited from llvm::DebugHandlerBase | |
| 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 |
| virtual void | initializeTargetDebugInfo (const MachineFunction &MF) |
| Target-specific debug info initialization at function start. | |
| void | setUseInlineStrings (bool V) |
| Setters for target-specific DWARF configuration overrides. | |
| void | setUseRangesSection (bool V) |
| void | setUseSectionsAsReferences (bool V) |
| void | applyDwarfVersion (unsigned DwarfVersion) |
Select DwarfVersion and (re)compute all state derived from it. | |
| virtual bool | shouldAttachCompileUnitRanges () const |
| Whether to attach ranges/low_pc to the compile unit DIE in endModule. | |
| virtual void | recordTargetSourceLine (const DebugLoc &DL, unsigned Flags) |
| Target-specific source line recording. | |
| virtual void | finishTargetUnitAttributes (const DICompileUnit &DIUnit, DwarfCompileUnit &NewCU) |
| Target-specific compile unit attribute finalization. | |
| const SmallVectorImpl< std::unique_ptr< DwarfCompileUnit > > & | getUnits () |
| Protected Member Functions inherited from llvm::DebugHandlerBase | |
| 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. | |
Protected Attributes | |
| DwarfFile | InfoHolder |
| Holder for the file specific debug information. | |
| Protected Attributes inherited from llvm::DebugHandlerBase | |
| 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 |
| const MachineInstr * | 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 352 of file DwarfDebug.h.
|
strong |
| Enumerator | |
|---|---|
| CU | |
| TU | |
Definition at line 463 of file DwarfDebug.h.
|
strong |
| Enumerator | |
|---|---|
| Default | |
| Disabled | |
| Ranges | |
| Expressions | |
| Form | |
Definition at line 455 of file DwarfDebug.h.
|
strong |
Describes the storage kind of a debug variable for target hooks.
| Enumerator | |
|---|---|
| Global | |
| Register | |
| FrameIndex | |
Definition at line 762 of file DwarfDebug.h.
| DwarfDebug::DwarfDebug | ( | AsmPrinter * | A | ) |
Definition at line 338 of file DwarfDebug.cpp.
References A(), AllLinkageNames, applyDwarfVersion(), llvm::DebugHandlerBase::Asm, llvm::DebugHandlerBase::DebugHandlerBase(), Default, DefaultLinkageNames, llvm::dwarf::DWARF_VERSION, DwarfInlinedStrings, DwarfLinkageNames, DwarfOpConvert, DwarfSectionsAsReferences, llvm::Enable, GenerateARangeSection, GenerateDwarfTypeUnits, InfoHolder, llvm::DebugHandlerBase::MMI, NoDwarfRangesSection, tuneForDBX(), tuneForGDB(), tuneForLLDB(), tuneForSCE(), and useSplitDwarf().
Referenced by llvm::NVPTXDwarfDebug::NVPTXDwarfDebug().
| void DwarfDebug::addAccelName | ( | const DwarfUnit & | Unit, |
| const DICompileUnit::DebugNameTableKind | NameTableKind, | ||
| StringRef | Name, | ||
| const DIE & | Die ) |
Definition at line 4309 of file DwarfDebug.cpp.
Referenced by addSubprogramNames(), and llvm::DwarfCompileUnit::finishEntityDefinition().
| void DwarfDebug::addAccelNamespace | ( | const DwarfUnit & | Unit, |
| const DICompileUnit::DebugNameTableKind | NameTableKind, | ||
| StringRef | Name, | ||
| const DIE & | Die ) |
Definition at line 4325 of file DwarfDebug.cpp.
| void DwarfDebug::addAccelObjC | ( | const DwarfUnit & | Unit, |
| const DICompileUnit::DebugNameTableKind | NameTableKind, | ||
| StringRef | Name, | ||
| const DIE & | Die ) |
Definition at line 4316 of file DwarfDebug.cpp.
References llvm::Apple, and getAccelTableKind().
Referenced by addSubprogramNames().
| void DwarfDebug::addAccelType | ( | const DwarfUnit & | Unit, |
| const DICompileUnit::DebugNameTableKind | NameTableKind, | ||
| StringRef | Name, | ||
| const DIE & | Die, | ||
| char | Flags ) |
Definition at line 4332 of file DwarfDebug.cpp.
|
inline |
Add a label so that arange data can be generated for it.
Definition at line 815 of file DwarfDebug.h.
Referenced by 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 4151 of file DwarfDebug.cpp.
References llvm::DwarfUnit::addString(), llvm::DwarfUnit::addStringOffsetsStart(), llvm::DwarfUnit::addUInt(), llvm::DebugHandlerBase::Asm, llvm::cast(), llvm::DwarfUnit::createTypeDIE(), CU, llvm::Dwarf, getAccelTableKind(), getDwarfVersion(), llvm::DIType::getScope(), llvm::DIEUnit::getUnitDie(), InfoHolder, makeTypeSignature(), setCurrentDWARF5AccelTable(), llvm::DIEUnit::setSection(), llvm::DwarfTypeUnit::setType(), llvm::DwarfTypeUnit::setTypeSignature(), TU, useSegmentedStringOffsetsTable(), and useSplitDwarf().
| void DwarfDebug::addSubprogramNames | ( | const DwarfUnit & | Unit, |
| const DICompileUnit::DebugNameTableKind | NameTableKind, | ||
| const DISubprogram * | SP, | ||
| DIE & | Die ) |
Definition at line 481 of file DwarfDebug.cpp.
References addAccelName(), addAccelObjC(), llvm::Apple, llvm::DICompileUnit::Apple, llvm::GlobalValue::dropLLVMManglingEscape(), getAccelTableKind(), getObjCClassCategory(), getObjCMethodName(), InfoHolder, isObjCClass(), llvm::LinkageName, llvm::DICompileUnit::None, and useAllLinkageNames().
|
inlinevirtual |
Add target-specific attributes to a variable DIE (e.g.
DW_AT_address_class).
Reimplemented in llvm::NVPTXDwarfDebug.
Definition at line 776 of file DwarfDebug.h.
|
inlinevirtual |
Extract target-specific address space information from a DIExpression.
Targets may strip address-space-encoding ops from the expression and return the address space via TargetAddrSpace.
Reimplemented in llvm::NVPTXDwarfDebug.
Definition at line 768 of file DwarfDebug.h.
|
inline |
Returns whether all functions of the module have been processed, so that abstract subprogram DIEs are not created for inlined subprograms anymore.
Definition at line 972 of file DwarfDebug.h.
| bool DwarfDebug::alwaysUseRanges | ( | const DwarfCompileUnit & | CU | ) | const |
Returns whether range encodings should be used for single entry range lists.
Definition at line 4380 of file DwarfDebug.cpp.
References Default, Ranges, and useSplitDwarf().
|
protected |
Select DwarfVersion and (re)compute all state derived from it.
Called by the constructor; a target subclass may call it again to change the version, which keeps the derived state consistent with the emitted one.
Definition at line 398 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm, computeAccelTableKind(), Disabled, llvm::dwarf::DWARF32, llvm::dwarf::DWARF64, MinimizeAddrInV5Option, llvm::DebugHandlerBase::MMI, llvm::report_fatal_error(), tuneForGDB(), UseGNUDebugMacro, and useSplitDwarf().
Referenced by DwarfDebug(), and llvm::NVPTXDwarfDebug::NVPTXDwarfDebug().
|
overridevirtual |
Process beginning of code alignment.
Reimplemented from llvm::AsmPrinterHandler.
Definition at line 4390 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm, llvm::MCDwarfLineEntry::make(), MBB, and llvm::DICompileUnit::NoDebug.
|
overrideprotectedvirtual |
Gather pre-function debug information.
Implements llvm::DebugHandlerBase.
Definition at line 2839 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm, assert(), emitInitialLocDirective(), getDwarfCompileUnitIDForLineTable(), llvm::MachineFunction::getFunction(), llvm::Function::getSubprogram(), initializeTargetDebugInfo(), KeyInstructionsAreStmts, llvm::DebugHandlerBase::LScopes, llvm::DICompileUnit::NoDebug, and llvm::DebugHandlerBase::PrologEndLoc.
|
overridevirtual |
Process beginning of an instruction.
Reimplemented from llvm::DebugHandlerBase.
Definition at line 2156 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, llvm::MachineInstr::FrameDestroy, llvm::MachineInstr::FrameSetup, llvm::MachineFunction::getFunction(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::Function::getSubprogram(), llvm::MachineFunction::getSubtarget(), KeyInstructionsAreStmts, MBB, MI, llvm::DICompileUnit::NoDebug, llvm::DebugHandlerBase::PrevInstBB, llvm::DebugHandlerBase::PrevInstLoc, llvm::DebugHandlerBase::PrevLabel, llvm::DebugHandlerBase::PrologEndLoc, recordTargetSourceLine(), 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 1285 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm, assert(), llvm::DebugHandlerBase::beginModule(), getDwarfVersion(), InfoHolder, llvm::DwarfFile::setRnglistsTableBaseSym(), useSegmentedStringOffsetsTable(), and useSplitDwarf().
|
inline |
Definition at line 893 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 3232 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm, assert(), llvm::Data, llvm::End, I, llvm::Length, llvm::Offset, and Streamer.
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 3458 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm, emitDebugLocEntry(), getDwarfVersion(), and Streamer.
|
static |
Definition at line 3276 of file DwarfDebug.cpp.
References llvm::DwarfExpression::addBooleanConstant(), llvm::DwarfExpression::addConstantFP(), llvm::DwarfExpression::addExpression(), llvm::DwarfExpression::addFragmentOffset(), llvm::DwarfExpression::addGlobalAddress(), llvm::DwarfExpression::addImplicitValue(), llvm::DwarfExpression::addMachineRegExpression(), llvm::DwarfExpression::addSignedConstant(), llvm::DwarfExpression::addUnsignedConstant(), llvm::DwarfExpression::addWasmLocation(), llvm::any_of(), assert(), llvm::DwarfExpression::beginEntryValueExpression(), llvm::DwarfExpression::canAddGlobalAddress(), llvm::dbgs(), llvm::MCAsmInfo::getCodePointerSize(), llvm::AsmPrinter::getDwarfDebug(), llvm::AsmPrinter::getDwarfVersion(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::TargetMachine::getTargetTriple(), llvm::isIntN(), llvm::isUIntN(), llvm::Triple::isWasm(), LLVM_DEBUG, llvm::AsmPrinter::MAI, llvm::AsmPrinter::MF, llvm::DwarfExpression::setLocation(), llvm::DwarfExpression::setMemoryLocationKind(), llvm::AsmPrinter::TM, TRI, and tuneForSCE().
Referenced by llvm::DwarfCompileUnit::constructCallSiteParmEntryDIEs(), and llvm::DebugLocEntry::finalize().
| const MachineInstr * DwarfDebug::emitInitialLocDirective | ( | const MachineFunction & | MF, |
| unsigned | CUID ) |
Emits inital debug location directive.
Returns instruction at which the function prologue ends.
Definition at line 2534 of file DwarfDebug.cpp.
References llvm::all_of(), llvm::DebugHandlerBase::Asm, DL, DWARF2_FLAG_IS_STMT, findPrologueEndLoc(), getDwarfVersion(), llvm::MachineFunction::getFunction(), llvm::Function::getSubprogram(), getUnits(), MBB, and llvm::DebugHandlerBase::PrologEndLoc.
Referenced by beginFunctionImpl(), and emitInitialRawDwarfLocDirective().
|
overrideprotectedvirtual |
Gather and emit post-function debug information.
Implements llvm::DebugHandlerBase.
Definition at line 2903 of file DwarfDebug.cpp.
References addArangeLabel(), llvm::DwarfCompileUnit::addRange(), llvm::DebugHandlerBase::Asm, assert(), llvm::cast(), llvm::DwarfCompileUnit::constructSubprogramScopeDIE(), llvm::DwarfCompileUnit::createAbstractEntity(), F, llvm::DwarfUnit::getCUNode(), llvm::DICompileUnit::getDebugInfoForProfiling(), llvm::DICompileUnit::getEmissionKind(), llvm::DwarfCompileUnit::getExistingAbstractEntity(), llvm::MachineFunction::getFunction(), getRetainedNodeScope(), llvm::LexicalScope::getScopeNode(), llvm::DwarfCompileUnit::getSkeleton(), llvm::DICompileUnit::getSplitDebugInlining(), InfoHolder, llvm::detail::DenseSetImpl< ValueT, MapTy >::insert(), llvm::isa(), llvm::DICompileUnit::isDebugDirectivesOnly(), llvm::DICompileUnit::LineTablesOnly, llvm::DebugHandlerBase::LScopes, N, and llvm::DebugHandlerBase::PrevLabel.
|
overridevirtual |
Emit all Dwarf sections that should come after the content.
Implements llvm::AsmPrinterHandler.
Definition at line 1501 of file DwarfDebug.cpp.
References llvm::Apple, llvm::DebugHandlerBase::Asm, assert(), llvm::cast(), llvm::DebugHandlerBase::CurMI, D(), llvm::Default, llvm::Dwarf, llvm::dyn_cast(), getAccelTableKind(), llvm::DIVariable::getScope(), Global, InfoHolder, llvm::detail::DenseSetImpl< ValueT, MapTy >::insert(), llvm::isa_and_nonnull(), llvm_unreachable, llvm::DebugHandlerBase::MMI, N, llvm::None, sortGlobalExprs(), terminateLineTable(), and useSplitDwarf().
|
inlineprotectedvirtual |
Target-specific compile unit attribute finalization.
Reimplemented in llvm::NVPTXDwarfDebug.
Definition at line 744 of file DwarfDebug.h.
|
inline |
Returns whether to generate DWARF v4 type units.
Definition at line 866 of file DwarfDebug.h.
|
inline |
Returns what kind (if any) of accelerator tables to emit.
Definition at line 871 of file DwarfDebug.h.
Referenced by addAccelObjC(), addDwarfTypeUnitType(), addSubprogramNames(), and endModule().
|
inline |
Definition at line 936 of file DwarfDebug.h.
Referenced by llvm::DwarfExpression::addGlobalAddress(), and emitRangeList().
|
inline |
Returns either CU or TU DWARF5AccelTable.
Definition at line 1015 of file DwarfDebug.h.
|
inline |
Definition at line 954 of file DwarfDebug.h.
|
inline |
Returns the entries for the .debug_loc section.
Definition at line 920 of file DwarfDebug.h.
Referenced by emitLocList(), emitLoclistsTableHeader(), and llvm::DIELocList::emitValue().
|
protected |
Get Dwarf compile unit ID for line table.
Definition at line 2871 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm.
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 4343 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm, and assert().
| uint16_t DwarfDebug::getDwarfVersion | ( | ) | const |
Returns the Dwarf Version.
Definition at line 4339 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm.
Referenced by addDwarfTypeUnitType(), beginModule(), emitDebugLocEntryLocation(), emitInitialLocDirective(), emitRangeList(), emitRangeList(), GetCompileUnitType(), getMD5AsBytes(), insertSectionLabel(), and llvm::NVPTXDwarfDebug::recordTargetSourceLine().
|
inline |
Definition at line 1000 of file DwarfDebug.h.
| 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 4363 of file DwarfDebug.cpp.
References assert(), llvm::copy(), llvm::DIFile::CSK_MD5, llvm::fromHex(), and getDwarfVersion().
| DwarfCompileUnit & DwarfDebug::getOrCreateAbstractSubprogramCU | ( | const DISubprogram * | SP, |
| DwarfCompileUnit & | SrcCU ) |
Find the matching DwarfCompileUnit for the given SP referenced from SrcCU.
Definition at line 552 of file DwarfDebug.cpp.
References shareAcrossDWOCUs().
|
inline |
Returns the previous CU that was being updated.
Definition at line 913 of file DwarfDebug.h.
Definition at line 4352 of file DwarfDebug.cpp.
Referenced by emitRangeList().
|
inlineprotected |
Definition at line 747 of file DwarfDebug.h.
References InfoHolder.
Referenced by emitInitialLocDirective(), and llvm::NVPTXDwarfDebug::recordTargetSourceLine().
|
inlineprotectedvirtual |
Target-specific debug info initialization at function start.
Reimplemented in llvm::NVPTXDwarfDebug.
Definition at line 724 of file DwarfDebug.h.
Referenced by beginFunctionImpl().
Definition at line 4356 of file DwarfDebug.cpp.
References getDwarfVersion(), llvm::MCSymbol::getIndex(), llvm::MCSymbol::getSection(), and useSplitDwarf().
| 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 523 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::getLabelAfterInsn(), and Ranges.
|
inline |
Returns whether a DIE for the function of SP has been constructed.
Definition at line 975 of file DwarfDebug.h.
|
inline |
Find the matching DwarfCompileUnit for the given CU DIE.
Definition at line 961 of file DwarfDebug.h.
|
inline |
Definition at line 962 of file DwarfDebug.h.
Perform an MD5 checksum of Identifier and return the lower 64 bits.
Definition at line 4140 of file DwarfDebug.cpp.
References llvm::MD5::final(), and llvm::MD5::update().
Referenced by addDwarfTypeUnitType().
Target-specific source line recording.
Default implementation of target-specific source line recording.
Reimplemented in llvm::NVPTXDwarfDebug.
Definition at line 2351 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm, and DL.
Referenced by beginInstruction().
|
inline |
Sets the current DWARF5AccelTable to use.
Definition at line 1005 of file DwarfDebug.h.
Referenced by addDwarfTypeUnitType().
|
inline |
Definition at line 914 of file DwarfDebug.h.
For symbols that have a size designated (e.g.
common symbols), this tracks that size.
Reimplemented from llvm::AsmPrinterHandler.
Definition at line 819 of file DwarfDebug.h.
References llvm::Size, and uint64_t.
|
inline |
Seet TheAccelTableKind.
Definition at line 874 of file DwarfDebug.h.
Referenced by llvm::NVPTXDwarfDebug::NVPTXDwarfDebug().
|
inlineprotected |
Setters for target-specific DWARF configuration overrides.
Called from target DwarfDebug subclass constructors.
Definition at line 728 of file DwarfDebug.h.
References V.
Referenced by llvm::NVPTXDwarfDebug::NVPTXDwarfDebug().
|
inlineprotected |
Definition at line 729 of file DwarfDebug.h.
References V.
Referenced by llvm::NVPTXDwarfDebug::NVPTXDwarfDebug().
|
inlineprotected |
Definition at line 730 of file DwarfDebug.h.
References V.
Referenced by llvm::NVPTXDwarfDebug::NVPTXDwarfDebug().
| bool DwarfDebug::shareAcrossDWOCUs | ( | ) | const |
Definition at line 547 of file DwarfDebug.cpp.
References SplitDwarfCrossCuReferences.
Referenced by getOrCreateAbstractSubprogramCU().
|
inlineprotectedvirtual |
Whether to attach ranges/low_pc to the compile unit DIE in endModule.
Reimplemented in llvm::NVPTXDwarfDebug.
Definition at line 738 of file DwarfDebug.h.
|
inlinevirtual |
Whether to emit .debug_pubnames / .debug_pubtypes. Default true;.
Reimplemented in llvm::NVPTXDwarfDebug.
Definition at line 824 of file DwarfDebug.h.
|
inlinevirtual |
Whether the target requires resetting the base address in range/loc lists.
Reimplemented in llvm::NVPTXDwarfDebug.
Definition at line 757 of file DwarfDebug.h.
Referenced by emitRangeList().
|
overrideprotectedvirtual |
Reimplemented from llvm::DebugHandlerBase.
Definition at line 2891 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 2882 of file DwarfDebug.cpp.
References llvm::DebugHandlerBase::Asm, and getDwarfCompileUnitIDForLineTable().
Referenced by endModule(), and skippedNonDebugFunction().
|
inline |
Definition at line 850 of file DwarfDebug.h.
References Expressions.
|
inline |
Definition at line 856 of file DwarfDebug.h.
References Form.
|
inline |
Returns whether we should emit all DW_AT_[MIPS_]linkage_name.
If not, we still might emit certain cases.
Definition at line 828 of file DwarfDebug.h.
Referenced by addSubprogramNames().
|
inline |
Definition at line 876 of file DwarfDebug.h.
|
inline |
Returns whether to use the DWARF2 format for bitfields instyead of the DWARF4 format.
Definition at line 836 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 832 of file DwarfDebug.h.
|
inline |
Returns whether to use inline strings.
Definition at line 839 of file DwarfDebug.h.
|
inline |
Definition at line 897 of file DwarfDebug.h.
|
inline |
Returns whether ranges section should be emitted.
Definition at line 842 of file DwarfDebug.h.
|
inline |
Returns whether to use sections as labels rather than temp symbols.
Definition at line 861 of file DwarfDebug.h.
|
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 889 of file DwarfDebug.h.
Referenced by addDwarfTypeUnitType(), and beginModule().
|
inline |
Returns whether or not to change the current debug info for split DWARF.
Definition at line 881 of file DwarfDebug.h.
Referenced by addDwarfTypeUnitType(), alwaysUseRanges(), applyDwarfVersion(), beginModule(), DwarfDebug(), llvm::emitDWARF5AccelTable(), emitMacroHeader(), emitRangeList(), llvm::DIELocList::emitValue(), endModule(), and insertSectionLabel().
|
protected |
Holder for the file specific debug information.
Definition at line 711 of file DwarfDebug.h.
Referenced by addDwarfTypeUnitType(), addSubprogramNames(), beginModule(), DwarfDebug(), endFunctionImpl(), endModule(), llvm::NVPTXDwarfDebug::getOrCreateFuncNameSymbol(), getUnits(), and llvm::NVPTXDwarfDebug::recordTargetSourceLine().