diff options
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h index 8491d078ed899..4ccd8c96dd0df 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -47,9 +47,9 @@ class DwarfCompileUnit final : public DwarfUnit { unsigned UniqueID; bool HasRangeLists = false; - /// The attribute index of DW_AT_stmt_list in the compile unit DIE, avoiding - /// the need to search for it in applyStmtList. - DIE::value_iterator StmtListValue; + /// The start of the unit line section, this is also + /// reused in appyStmtList. + MCSymbol *LineTableStartSym; /// Skeleton unit associated with this unit. DwarfCompileUnit *Skeleton = nullptr; @@ -123,6 +123,9 @@ public: /// Apply the DW_AT_stmt_list from this compile unit to the specified DIE. void applyStmtList(DIE &D); + /// Get line table start symbol for this unit. + MCSymbol *getLineTableStartSym() const { return LineTableStartSym; } + /// A pair of GlobalVariable and DIExpression. struct GlobalExpr { const GlobalVariable *Var; @@ -230,6 +233,10 @@ public: void constructAbstractSubprogramScopeDIE(LexicalScope *Scope); + /// Whether to use the GNU analog for a DWARF5 tag, attribute, or location + /// atom. Only applicable when emitting otherwise DWARF4-compliant debug info. + bool useGNUAnalogForDwarf5Feature() const; + /// This takes a DWARF 5 tag and returns it or a GNU analog. dwarf::Tag getDwarf5OrGNUTag(dwarf::Tag Tag) const; @@ -240,19 +247,17 @@ public: dwarf::LocationAtom getDwarf5OrGNULocationAtom(dwarf::LocationAtom Loc) const; /// Construct a call site entry DIE describing a call within \p Scope to a - /// callee described by \p CalleeSP. + /// callee described by \p CalleeDIE. + /// \p CalleeDIE is a declaration or definition subprogram DIE for the callee. + /// For indirect calls \p CalleeDIE is set to nullptr. /// \p IsTail specifies whether the call is a tail call. - /// \p PCAddr (used for GDB + DWARF 4 tuning) points to the PC value after - /// the call instruction. - /// \p PCOffset (used for cases other than GDB + DWARF 4 tuning) must be - /// non-zero for non-tail calls (in the case of non-gdb tuning, since for - /// GDB + DWARF 5 tuning we still generate PC info for tail calls) or be the - /// function-local offset to PC value after the call instruction. + /// \p PCAddr points to the PC value after the call instruction. + /// \p CallAddr points to the PC value at the call instruction (or is null). /// \p CallReg is a register location for an indirect call. For direct calls /// the \p CallReg is set to 0. - DIE &constructCallSiteEntryDIE(DIE &ScopeDIE, const DISubprogram *CalleeSP, - bool IsTail, const MCSymbol *PCAddr, - const MCExpr *PCOffset, unsigned CallReg); + DIE &constructCallSiteEntryDIE(DIE &ScopeDIE, DIE *CalleeDIE, bool IsTail, + const MCSymbol *PCAddr, + const MCSymbol *CallAddr, unsigned CallReg); /// Construct call site parameter DIEs for the \p CallSiteDIE. The \p Params /// were collected by the \ref collectCallSiteParameters. /// Note: The order of parameters does not matter, since debuggers recognize @@ -340,9 +345,6 @@ public: /// Add a Dwarf expression attribute data and value. void addExpr(DIELoc &Die, dwarf::Form Form, const MCExpr *Expr); - /// Add an attribute containing an address expression to \p Die. - void addAddressExpr(DIE &Die, dwarf::Attribute Attribute, const MCExpr *Expr); - void applySubprogramAttributesToDefinition(const DISubprogram *SP, DIE &SPDie); |