Fix a memory leak in the debug emission by simply not allocating memory.

There doesn't appear to be any reason to put this variable on the heap.
I'm suspicious of the LexicalScope above that we stuff in a map and then
delete afterward, but I'm just trying to get the valgrind bot clean.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187301 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chandler Carruth 2013-07-27 11:09:58 +00:00
parent 37886438dd
commit 05497cc965

View File

@ -951,9 +951,9 @@ void DwarfDebug::collectDeadVariables() {
for (unsigned vi = 0, ve = Variables.getNumElements(); vi != ve; ++vi) { for (unsigned vi = 0, ve = Variables.getNumElements(); vi != ve; ++vi) {
DIVariable DV(Variables.getElement(vi)); DIVariable DV(Variables.getElement(vi));
if (!DV.isVariable()) continue; if (!DV.isVariable()) continue;
DbgVariable *NewVar = new DbgVariable(DV, NULL); DbgVariable NewVar(DV, NULL);
if (DIE *VariableDIE = if (DIE *VariableDIE =
SPCU->constructVariableDIE(NewVar, Scope->isAbstractScope())) SPCU->constructVariableDIE(&NewVar, Scope->isAbstractScope()))
ScopeDIE->addChild(VariableDIE); ScopeDIE->addChild(VariableDIE);
} }
} }