diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-09-23 10:38:59 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-09-23 10:38:59 +0000 |
commit | 008f4be499c1396bb6f5d3bccc7433244e54ec1e (patch) | |
tree | 2a9374f02c0da62cb16a82ecbe0b82f56448b47f | |
parent | 84f6f277ac79c103c20f1c9496e37f2f97247a39 (diff) | |
download | bcm5719-llvm-008f4be499c1396bb6f5d3bccc7433244e54ec1e.tar.gz bcm5719-llvm-008f4be499c1396bb6f5d3bccc7433244e54ec1e.zip |
[dsymutil] Plug a memory leak.
llvm-svn: 248372
-rw-r--r-- | llvm/tools/dsymutil/DwarfLinker.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/dsymutil/DwarfLinker.cpp b/llvm/tools/dsymutil/DwarfLinker.cpp index c45ff6a113d..fb7ffceec8f 100644 --- a/llvm/tools/dsymutil/DwarfLinker.cpp +++ b/llvm/tools/dsymutil/DwarfLinker.cpp @@ -3157,7 +3157,7 @@ void DwarfLinker::loadClangModule(StringRef Filename, StringRef ModulePath, // 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(StringRef Filename, StringRef ModulePath, << " 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); |