diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-08-11 18:39:28 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-08-11 18:39:28 +0000 |
commit | 0fa5e053a914cbbea7c66f13da190d96f8fe2a2c (patch) | |
tree | d9aef5cd268491d7cc1e0a1756e5523642f3248e /lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | ae0bc5deaa30f1e20a6189e42ca412ba27ec7153 (diff) | |
download | external_llvm-0fa5e053a914cbbea7c66f13da190d96f8fe2a2c.zip external_llvm-0fa5e053a914cbbea7c66f13da190d96f8fe2a2c.tar.gz external_llvm-0fa5e053a914cbbea7c66f13da190d96f8fe2a2c.tar.bz2 |
Plug a memory leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137321 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 2bf77b9..76dc43f 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1046,18 +1046,18 @@ void DwarfDebug::endModule() { LexicalScope *Scope = new LexicalScope(NULL, DIDescriptor(SP), NULL, false); DeadFnScopeMap[SP] = Scope; - SmallVector<DbgVariable *, 8> Variables; + SmallVector<DbgVariable, 8> Variables; for (unsigned I = 0; I != E; ++I) { DIVariable DV(NMD->getOperand(I)); if (!DV.Verify()) continue; - Variables.push_back(new DbgVariable(DV)); + Variables.push_back(DbgVariable(DV)); } // Construct subprogram DIE and add variables DIEs. constructSubprogramDIE(SP); DIE *ScopeDIE = getCompileUnit(SP)->getDIE(SP); for (unsigned i = 0, N = Variables.size(); i < N; ++i) { - if (DIE *VariableDIE = constructVariableDIE(Variables[i], Scope)) + if (DIE *VariableDIE = constructVariableDIE(&Variables[i], Scope)) ScopeDIE->addChild(VariableDIE); } } |