diff options
| author | David Blaikie <dblaikie@gmail.com> | 2014-05-06 03:42:01 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2014-05-06 03:42:01 +0000 |
| commit | f427b00b9ac9dfbcd12655b77409bf4ca5857e7c (patch) | |
| tree | eb7c80b25ae350918a446f7d46387d88bf1982c6 /clang/lib/CodeGen/CGDebugInfo.h | |
| parent | d3f094a33be49952b8506fba5a34278781c9b113 (diff) | |
| download | bcm5719-llvm-f427b00b9ac9dfbcd12655b77409bf4ca5857e7c.tar.gz bcm5719-llvm-f427b00b9ac9dfbcd12655b77409bf4ca5857e7c.zip | |
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.
llvm-svn: 208055
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.h')
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h index d69fabf292d..700e3358dea 100644 --- a/clang/lib/CodeGen/CGDebugInfo.h +++ b/clang/lib/CodeGen/CGDebugInfo.h @@ -65,7 +65,7 @@ class CGDebugInfo { llvm::DIType BlockLiteralGeneric; /// TypeCache - Cache of previously constructed Types. - llvm::DenseMap<void *, llvm::WeakVH> TypeCache; + llvm::DenseMap<const void *, llvm::WeakVH> TypeCache; struct ObjCInterfaceCacheEntry { const ObjCInterfaceType *Type; @@ -85,7 +85,7 @@ class CGDebugInfo { /// ReplaceMap - Cache of forward declared types to RAUW at the end of /// compilation. - std::vector<std::pair<void *, llvm::WeakVH> >ReplaceMap; + std::vector<std::pair<const TagType *, llvm::WeakVH>> ReplaceMap; // LexicalBlockStack - Keep track of our current nested lexical block. std::vector<llvm::TrackingVH<llvm::MDNode> > LexicalBlockStack; |

