llvm.org GIT mirror llvm / e457dc7
Roll DbgVariable::setMInsn into the constructor. No functional changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209920 91177308-0d34-0410-b5e6-96231b3b80d8 Adrian Prantl 6 years ago
2 changed file(s) with 15 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
11751175 const MachineInstr *MInsn = Ranges.front().first;
11761176 assert(MInsn->isDebugValue() && "History must begin with debug value");
11771177 DbgVariable *AbsVar = findAbstractVariable(DV, MInsn->getDebugLoc());
1178 DbgVariable *RegVar = new DbgVariable(DV, AbsVar, this);
1178 DbgVariable *RegVar = new DbgVariable(MInsn, AbsVar, this);
11791179 if (!addCurrentFnArgument(RegVar, Scope))
11801180 addScopeVariable(Scope, RegVar);
11811181
11821182 // Check if the first DBG_VALUE is valid for the rest of the function.
1183 if (Ranges.size() == 1 && Ranges.front().second == nullptr) {
1184 RegVar->setMInsn(MInsn);
1183 if (Ranges.size() == 1 && Ranges.front().second == nullptr)
11851184 continue;
1186 }
11871185
11881186 // Handle multiple DBG_VALUE instructions describing one variable.
11891187 RegVar->setDotDebugLocOffset(DotDebugLocEntries.size());
2626 #include "llvm/ADT/StringMap.h"
2727 #include "llvm/ADT/FoldingSet.h"
2828 #include "llvm/CodeGen/LexicalScopes.h"
29 #include "llvm/CodeGen/MachineInstr.h"
2930 #include "llvm/IR/DebugInfo.h"
3031 #include "llvm/IR/DebugLoc.h"
3132 #include "llvm/MC/MachineLocation.h"
7677 DwarfDebug *DD;
7778
7879 public:
79 // AbsVar may be NULL.
80 DbgVariable(DIVariable V, DbgVariable *AV, DwarfDebug *DD)
81 : Var(V), TheDIE(nullptr), DotDebugLocOffset(~0U), AbsVar(AV),
80 /// Construct a DbgVariable from a DIVariable.
81 /// AbstractVar may be NULL.
82 DbgVariable(DIVariable V, DbgVariable *AbstractVar, DwarfDebug *DD)
83 : Var(V), TheDIE(nullptr), DotDebugLocOffset(~0U), AbsVar(AbstractVar),
8284 MInsn(nullptr), FrameIndex(~0), DD(DD) {}
85
86 /// Construct a DbgVariable from a DEBUG_VALUE.
87 /// AbstractVar may be NULL.
88 DbgVariable(const MachineInstr *DbgValue, DbgVariable *AbstractVar,
89 DwarfDebug *DD)
90 : Var(DbgValue->getDebugVariable()),
91 TheDIE(nullptr), DotDebugLocOffset(~0U), AbsVar(AbstractVar),
92 MInsn(DbgValue), FrameIndex(~0), DD(DD) {}
8393
8494 // Accessors.
8595 DIVariable getVariable() const { return Var; }
90100 StringRef getName() const { return Var.getName(); }
91101 DbgVariable *getAbstractVariable() const { return AbsVar; }
92102 const MachineInstr *getMInsn() const { return MInsn; }
93 void setMInsn(const MachineInstr *M) { MInsn = M; }
94103 int getFrameIndex() const { return FrameIndex; }
95104 void setFrameIndex(int FI) { FrameIndex = FI; }
96105 // Translate tag to proper Dwarf tag.