summaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-07-27 11:09:58 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-07-27 11:09:58 +0000
commit05497cc965b59dff8a8170c5cbbcef3dff251262 (patch)
tree791d949975d9727c80bebb4a0c9613ea23aed717 /lib/CodeGen
parent37886438dd9e8b734f1a090eb2ede48a4d184f0e (diff)
downloadllvm-05497cc965b59dff8a8170c5cbbcef3dff251262.tar.gz
llvm-05497cc965b59dff8a8170c5cbbcef3dff251262.tar.bz2
llvm-05497cc965b59dff8a8170c5cbbcef3dff251262.tar.xz
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
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 27d243e4c3..0d2d02eba4 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -951,9 +951,9 @@ void DwarfDebug::collectDeadVariables() {
for (unsigned vi = 0, ve = Variables.getNumElements(); vi != ve; ++vi) {
DIVariable DV(Variables.getElement(vi));
if (!DV.isVariable()) continue;
- DbgVariable *NewVar = new DbgVariable(DV, NULL);
+ DbgVariable NewVar(DV, NULL);
if (DIE *VariableDIE =
- SPCU->constructVariableDIE(NewVar, Scope->isAbstractScope()))
+ SPCU->constructVariableDIE(&NewVar, Scope->isAbstractScope()))
ScopeDIE->addChild(VariableDIE);
}
}