From: David Blaikie Date: Thu, 5 Jun 2014 01:04:20 +0000 (+0000) Subject: DebugInfo: Roll argument insertion into variable insertion to ensure arguments are... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=087e7203a971c905f0fd74b4e17f27f04def2b18;p=platform%2Fupstream%2Fllvm.git DebugInfo: Roll argument insertion into variable insertion to ensure arguments are correctly handled in all cases. No functional change intended. llvm-svn: 210233 --- diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 70f0238..1bb8f26 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/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 &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 &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 &Vars = ScopeVariables[LS]; DIVariable DV = Var->getVariable(); // Variables with positive arg numbers are parameters.