aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h')
-rw-r--r--contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h56
1 files changed, 37 insertions, 19 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
index 6ef73ebd4f7f..dc772bb459c9 100644
--- a/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
+++ b/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
@@ -25,7 +25,6 @@
#include "llvm/CodeGen/LexicalScopes.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/Support/Casting.h"
-#include <cassert>
#include <cstdint>
#include <memory>
@@ -44,8 +43,6 @@ class MDNode;
enum class UnitKind { Skeleton, Full };
class DwarfCompileUnit final : public DwarfUnit {
- /// A numeric ID unique among all CUs in the module
- unsigned UniqueID;
bool HasRangeLists = false;
/// The start of the unit line section, this is also
@@ -55,9 +52,6 @@ class DwarfCompileUnit final : public DwarfUnit {
/// Skeleton unit associated with this unit.
DwarfCompileUnit *Skeleton = nullptr;
- /// The start of the unit within its section.
- MCSymbol *LabelBegin = nullptr;
-
/// The start of the unit macro info within macro section.
MCSymbol *MacroLabelBegin;
@@ -96,9 +90,34 @@ class DwarfCompileUnit final : public DwarfUnit {
const DIFile *LastFile = nullptr;
unsigned LastFileID;
- /// Construct a DIE for the given DbgVariable without initializing the
- /// DbgVariable's DIE reference.
- DIE *constructVariableDIEImpl(const DbgVariable &DV, bool Abstract);
+ /// \anchor applyConcreteDbgVariableAttribute
+ /// \name applyConcreteDbgVariableAttribute
+ /// Overload set which applies attributes to \c VariableDie based on
+ /// the active variant of \c DV, which is passed as the first argument.
+ ///@{
+
+ /// See \ref applyConcreteDbgVariableAttribute
+ void applyConcreteDbgVariableAttributes(const Loc::Single &Single,
+ const DbgVariable &DV,
+ DIE &VariableDie);
+ /// See \ref applyConcreteDbgVariableAttribute
+ void applyConcreteDbgVariableAttributes(const Loc::Multi &Multi,
+ const DbgVariable &DV,
+ DIE &VariableDie);
+ /// See \ref applyConcreteDbgVariableAttribute
+ void applyConcreteDbgVariableAttributes(const Loc::MMI &MMI,
+ const DbgVariable &DV,
+ DIE &VariableDie);
+ /// See \ref applyConcreteDbgVariableAttribute
+ void applyConcreteDbgVariableAttributes(const Loc::EntryValue &EntryValue,
+ const DbgVariable &DV,
+ DIE &VariableDie);
+ /// See \ref applyConcreteDbgVariableAttribute
+ void applyConcreteDbgVariableAttributes(const std::monostate &,
+ const DbgVariable &DV,
+ DIE &VariableDie);
+
+ ///@}
bool isDwoUnit() const override;
@@ -126,7 +145,6 @@ public:
UnitKind Kind = UnitKind::Full);
bool hasRangeLists() const { return HasRangeLists; }
- unsigned getUniqueID() const { return UniqueID; }
DwarfCompileUnit *getSkeleton() const {
return Skeleton;
@@ -193,7 +211,6 @@ public:
/// variables in this scope then create and insert DIEs for these
/// variables.
DIE &updateSubprogramScopeDIE(const DISubprogram *SP);
- DIE &updateSubprogramScopeDIEImpl(const DISubprogram *SP, DIE *SPDie);
void constructScopeDIE(LexicalScope *Scope, DIE &ParentScopeDIE);
@@ -219,9 +236,11 @@ public:
/// and it's an error, if it hasn't.
DIE *getLexicalBlockDIE(const DILexicalBlock *LB);
- /// constructVariableDIE - Construct a DIE for the given DbgVariable.
+ /// Construct a DIE for the given DbgVariable.
DIE *constructVariableDIE(DbgVariable &DV, bool Abstract = false);
+ /// Convenience overload which writes the DIE pointer into an out variable
+ /// ObjectPointer in addition to returning it.
DIE *constructVariableDIE(DbgVariable &DV, const LexicalScope &Scope,
DIE *&ObjectPointer);
@@ -304,11 +323,6 @@ public:
/// Add the DW_AT_addr_base attribute to the unit DIE.
void addAddrTableBase();
- MCSymbol *getLabelBegin() const {
- assert(LabelBegin && "LabelBegin is not initialized");
- return LabelBegin;
- }
-
MCSymbol *getMacroLabelBegin() const {
return MacroLabelBegin;
}
@@ -342,13 +356,17 @@ public:
/// DWARF information necessary to find the actual variable (navigating the
/// extra location information encoded in the type) based on the starting
/// location. Add the DWARF information to the die.
- void addComplexAddress(const DbgVariable &DV, DIE &Die,
+ void addComplexAddress(const DIExpression *DIExpr, DIE &Die,
dwarf::Attribute Attribute,
const MachineLocation &Location);
/// Add a Dwarf loclistptr attribute data and value.
void addLocationList(DIE &Die, dwarf::Attribute Attribute, unsigned Index);
- void applyVariableAttributes(const DbgVariable &Var, DIE &VariableDie);
+
+ /// Add attributes to \p Var which reflect the common attributes of \p
+ /// VariableDie, namely those which are not dependant on the active variant.
+ void applyCommonDbgVariableAttributes(const DbgVariable &Var,
+ DIE &VariableDie);
/// Add a Dwarf expression attribute data and value.
void addExpr(DIELoc &Die, dwarf::Form Form, const MCExpr *Expr);