DIE: Pass ownership of children via std::unique_ptr rather than raw pointer.
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 25 Apr 2014 20:00:34 +0000 (20:00 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 25 Apr 2014 20:00:34 +0000 (20:00 +0000)
commit12d5224df6df05dc1189788591c381f467f5ff25
treebad04f40bd47ad13a98b05e748fc1e4de4dfb23f
parent172515f0be61f91c3a67206c6627c5e2572bdb26
DIE: Pass ownership of children via std::unique_ptr rather than raw pointer.

This should reduce the chance of memory leaks like those fixed in
r207240.

There's still some unclear ownership of DIEs happening in DwarfDebug.
Pushing unique_ptr and references through more APIs should help expose
the cases where ownership is a bit fuzzy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207263 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DIE.h
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
lib/CodeGen/AsmPrinter/DwarfDebug.h
lib/CodeGen/AsmPrinter/DwarfUnit.cpp
lib/CodeGen/AsmPrinter/DwarfUnit.h
unittests/CodeGen/DIEHashTest.cpp