[llvm] r248372 - [dsymutil] Plug a memory leak.
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 23 03:38:59 PDT 2015
Author: d0k
Date: Wed Sep 23 05:38:59 2015
New Revision: 248372
URL: http://llvm.org/viewvc/llvm-project?rev=248372&view=rev
Log:
[dsymutil] Plug a memory leak.
Modified:
llvm/trunk/tools/dsymutil/DwarfLinker.cpp
Modified: llvm/trunk/tools/dsymutil/DwarfLinker.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/dsymutil/DwarfLinker.cpp?rev=248372&r1=248371&r2=248372&view=diff
==============================================================================
--- llvm/trunk/tools/dsymutil/DwarfLinker.cpp (original)
+++ llvm/trunk/tools/dsymutil/DwarfLinker.cpp Wed Sep 23 05:38:59 2015
@@ -3157,7 +3157,7 @@ void DwarfLinker::loadClangModule(String
// FIXME: At this point dsymutil should verify the DW_AT_gnu_dwo_id
// against the module hash of the clang module.
- CompileUnit *Unit = nullptr;
+ std::unique_ptr<CompileUnit> Unit;
// Setup access to the debug info.
DWARFContextInMemory DwarfContext(*ErrOrObj);
@@ -3172,7 +3172,7 @@ void DwarfLinker::loadClangModule(String
<< " 1 compile unit.\n";
exitDsymutil(1);
}
- Unit = new CompileUnit(*CU, UnitID++, !Options.NoODR);
+ Unit = llvm::make_unique<CompileUnit>(*CU, UnitID++, !Options.NoODR);
Unit->setHasInterestingContent();
gatherDIEParents(CUDie, 0, *Unit, &ODRContexts.getRoot(), StringPool,
ODRContexts);
More information about the llvm-commits
mailing list