From d32eccc97bac8921002424eb764478d7350850d7 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 13 Jun 2014 23:52:55 +0000 Subject: DebugInfo: Remove some extra handling of abstract variables and instead rely solely on the delayed handling introduced in r210946 Now that we handle finding abstract variables at the end of the module, remove the upfront handling and just ensure the abstract variable is built when necessary. In theory we could have a split implementation, where inlined variables are immediately constructed referencing the abstract definition, and concrete variables are delayed - but let's go with one solution for now unless there's a reason not to. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210961 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfDebug.h | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.h') diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.h b/lib/CodeGen/AsmPrinter/DwarfDebug.h index 8445b74798..f2aa80845a 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -72,25 +72,21 @@ class DbgVariable { DIVariable Var; // Variable Descriptor. DIE *TheDIE; // Variable DIE. unsigned DotDebugLocOffset; // Offset in DotDebugLocEntries. - DbgVariable *AbsVar; // Corresponding Abstract variable, if any. const MachineInstr *MInsn; // DBG_VALUE instruction of the variable. int FrameIndex; DwarfDebug *DD; public: /// Construct a DbgVariable from a DIVariable. - /// AbstractVar may be NULL. - DbgVariable(DIVariable V, DbgVariable *AbstractVar, DwarfDebug *DD) - : Var(V), TheDIE(nullptr), DotDebugLocOffset(~0U), AbsVar(AbstractVar), - MInsn(nullptr), FrameIndex(~0), DD(DD) {} + DbgVariable(DIVariable V, DwarfDebug *DD) + : Var(V), TheDIE(nullptr), DotDebugLocOffset(~0U), MInsn(nullptr), + FrameIndex(~0), DD(DD) {} /// Construct a DbgVariable from a DEBUG_VALUE. /// AbstractVar may be NULL. - DbgVariable(const MachineInstr *DbgValue, DbgVariable *AbstractVar, - DwarfDebug *DD) - : Var(DbgValue->getDebugVariable()), - TheDIE(nullptr), DotDebugLocOffset(~0U), AbsVar(AbstractVar), - MInsn(DbgValue), FrameIndex(~0), DD(DD) {} + DbgVariable(const MachineInstr *DbgValue, DwarfDebug *DD) + : Var(DbgValue->getDebugVariable()), TheDIE(nullptr), + DotDebugLocOffset(~0U), MInsn(DbgValue), FrameIndex(~0), DD(DD) {} // Accessors. DIVariable getVariable() const { return Var; } @@ -99,7 +95,6 @@ public: void setDotDebugLocOffset(unsigned O) { DotDebugLocOffset = O; } unsigned getDotDebugLocOffset() const { return DotDebugLocOffset; } StringRef getName() const { return Var.getName(); } - DbgVariable *getAbstractVariable() const { return AbsVar; } const MachineInstr *getMInsn() const { return MInsn; } int getFrameIndex() const { return FrameIndex; } void setFrameIndex(int FI) { FrameIndex = FI; } @@ -347,10 +342,11 @@ class DwarfDebug : public AsmPrinterHandler { DbgVariable *getExistingAbstractVariable(const DIVariable &DV, DIVariable &Cleansed); DbgVariable *getExistingAbstractVariable(const DIVariable &DV); - DbgVariable *createAbstractVariable(DIVariable &DV, LexicalScope *Scope); - DbgVariable *getOrCreateAbstractVariable(DIVariable &Var, - const MDNode *Scope); - DbgVariable *findAbstractVariable(DIVariable &Var, const MDNode *Scope); + void createAbstractVariable(const DIVariable &DV, LexicalScope *Scope); + void ensureAbstractVariableIsCreated(const DIVariable &Var, + const MDNode *Scope); + void ensureAbstractVariableIsCreatedIfScoped(const DIVariable &Var, + const MDNode *Scope); /// \brief Find DIE for the given subprogram and attach appropriate /// DW_AT_low_pc and DW_AT_high_pc attributes. If there are global -- cgit v1.2.3