diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-06-05 01:04:20 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-06-05 01:04:20 +0000 |
commit | 75096077d49c50478e8f252e41432387030a5fe5 (patch) | |
tree | 350abdfd56ca3247f3247485abf34ee3eec2e8d0 /lib/CodeGen | |
parent | ad03fa6d3f00b3f2f1def3768775c39fe12fc4a7 (diff) | |
download | llvm-75096077d49c50478e8f252e41432387030a5fe5.tar.gz llvm-75096077d49c50478e8f252e41432387030a5fe5.tar.bz2 llvm-75096077d49c50478e8f252e41432387030a5fe5.tar.xz |
DebugInfo: Roll argument insertion into variable insertion to ensure arguments are correctly handled in all cases.
No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210233 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 70f0238d51..1bb8f26ae0 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1134,8 +1134,7 @@ void DwarfDebug::collectVariableInfoFromMMITable( DbgVariable *AbsDbgVariable = findAbstractVariable(DV, VI.Loc); DbgVariable *RegVar = new DbgVariable(DV, AbsDbgVariable, this); RegVar->setFrameIndex(VI.Slot); - if (!addCurrentFnArgument(RegVar, Scope)) - addScopeVariable(Scope, RegVar); + addScopeVariable(Scope, RegVar); } } @@ -1202,8 +1201,7 @@ DwarfDebug::collectVariableInfo(SmallPtrSet<const MDNode *, 16> &Processed) { assert(MInsn->isDebugValue() && "History must begin with debug value"); DbgVariable *AbsVar = findAbstractVariable(DV, Scope->getScopeNode()); DbgVariable *RegVar = new DbgVariable(MInsn, AbsVar, this); - if (!addCurrentFnArgument(RegVar, Scope)) - addScopeVariable(Scope, RegVar); + addScopeVariable(Scope, RegVar); // Check if the first DBG_VALUE is valid for the rest of the function. if (Ranges.size() == 1 && Ranges.front().second == nullptr) @@ -1257,8 +1255,7 @@ DwarfDebug::collectVariableInfo(SmallPtrSet<const MDNode *, 16> &Processed) { if (LexicalScope *Scope = LScopes.findLexicalScope(DV.getContext())) { auto *RegVar = new DbgVariable( DV, findAbstractVariable(DV, Scope->getScopeNode()), this); - if (!addCurrentFnArgument(RegVar, Scope)) - addScopeVariable(Scope, RegVar); + addScopeVariable(Scope, RegVar); } } } @@ -1462,6 +1459,8 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) { } void DwarfDebug::addScopeVariable(LexicalScope *LS, DbgVariable *Var) { + if (addCurrentFnArgument(Var, LS)) + return; SmallVectorImpl<DbgVariable *> &Vars = ScopeVariables[LS]; DIVariable DV = Var->getVariable(); // Variables with positive arg numbers are parameters. |