DebugInfo: Reuse existing LexicalScope to retrieve the scope's MDNode, rather than looking it up through the DebugLoc.

No functional change intended, just streamlines the abstract variable
lookup/construction to use a common entry point.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210234 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2014-06-05 01:30:50 +00:00
parent 75096077d4
commit 7a986ec4de
2 changed files with 2 additions and 7 deletions

View File

@ -1047,11 +1047,6 @@ void DwarfDebug::endModule() {
}
// Find abstract variable, if any, associated with Var.
DbgVariable *DwarfDebug::findAbstractVariable(DIVariable &DV,
DebugLoc ScopeLoc) {
return findAbstractVariable(DV, ScopeLoc.getScope(DV->getContext()));
}
DbgVariable *DwarfDebug::getExistingAbstractVariable(DIVariable &DV,
DIVariable &Cleansed) {
LLVMContext &Ctx = DV->getContext();
@ -1131,7 +1126,8 @@ void DwarfDebug::collectVariableInfoFromMMITable(
if (!Scope)
continue;
DbgVariable *AbsDbgVariable = findAbstractVariable(DV, VI.Loc);
DbgVariable *AbsDbgVariable =
findAbstractVariable(DV, Scope->getScopeNode());
DbgVariable *RegVar = new DbgVariable(DV, AbsDbgVariable, this);
RegVar->setFrameIndex(VI.Slot);
addScopeVariable(Scope, RegVar);

View File

@ -348,7 +348,6 @@ class DwarfDebug : public AsmPrinterHandler {
DbgVariable *createAbstractVariable(DIVariable &DV, LexicalScope *Scope);
DbgVariable *getOrCreateAbstractVariable(DIVariable &Var,
const MDNode *Scope);
DbgVariable *findAbstractVariable(DIVariable &Var, DebugLoc Loc);
DbgVariable *findAbstractVariable(DIVariable &Var, const MDNode *Scope);
/// \brief Find DIE for the given subprogram and attach appropriate