aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-11-16 21:04:30 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-11-16 21:04:30 +0000
commit14d6365b6d927ec6f42293b05a713e3f2a262677 (patch)
tree4a25390267c22050f7b0a263142187a287c72704 /lib/CodeGen/CGDebugInfo.cpp
parenta439e6f8f57eaeb0a02960d8f2d8ad124ba8b3d5 (diff)
Parallel fix to r88951: use TrackingVH to hold forward decl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88962 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 7aa720144c..41ffddd23a 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -490,6 +490,7 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty,
if (!Decl->getDefinition(M->getContext()))
return FwdDecl;
+ llvm::TrackingVH<llvm::MDNode> FwdDeclNode = FwdDecl.getNode();
// Otherwise, insert it into the TypeCache so that recursive uses will find
// it.
TypeCache[QualType(Ty, 0).getAsOpaquePtr()] = FwdDecl.getNode();
@@ -563,7 +564,7 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty,
// Now that we have a real decl for the struct, replace anything using the
// old decl with the new one. This will recursively update the debug info.
- FwdDecl.replaceAllUsesWith(RealDecl);
+ llvm::DIDerivedType(FwdDeclNode).replaceAllUsesWith(RealDecl);
return RealDecl;
}