]> granicus.if.org Git - clang/commit
PR19598: Ensure temporary metadata nodes used in debug info are destroyed.
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 6 May 2014 03:42:01 +0000 (03:42 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 6 May 2014 03:42:01 +0000 (03:42 +0000)
commit2115b66f4114258ad27b1abaef7e16676b119c91
tree050faab55d6c702de4bd13d8825149f9bc5d2680
parent30dabc00de4fe230663702ebfbf415084075ba68
PR19598: Ensure temporary metadata nodes used in debug info are destroyed.

CGDebugInfo and DIBuilder were lax in their handling of temporary
MDNodes. All temporary nodes need to be deleted, which means they need
to be RAUW'd with a permanent node. This was not happening.

To ensure this, leverage DIBuilder's new ability to create both
permanent and temporary declarations. Ensure all temporary declarations
are RAUW'd, even with itself. (DIDescriptor::RAUW handles the case where
it is replaced with itself and creates a new, duplicate permanent node
to replace itself with)

This means that all temporary declarations must be added to the
ReplacementMap even if they're never upgraded to definitions - so move
the point of insertion into the map to the point of creation of the
declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208055 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/CGDebugInfo.h