summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commit2a1c0d2c0317d3dc2419d0f39a3f9e672c1f6558 (patch)
tree54a2d58abf2d0d5498fe7f16b2dd34ff09c70c26 /llvm/lib
parent0329bb4fce563d9eda50d66d8932728efc2fbe3f (diff)
downloadbcm5719-llvm-2a1c0d2c0317d3dc2419d0f39a3f9e672c1f6558.tar.gz
bcm5719-llvm-2a1c0d2c0317d3dc2419d0f39a3f9e672c1f6558.zip
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. llvm-svn: 187301
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 27d243e4c30..0d2d02eba4d 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/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);
}
}
OpenPOWER on IntegriCloud