]> granicus.if.org Git - clang/commitdiff
Parallel fix to r88951: use TrackingVH to hold forward decl.
authorEli Friedman <eli.friedman@gmail.com>
Mon, 16 Nov 2009 21:04:30 +0000 (21:04 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Mon, 16 Nov 2009 21:04:30 +0000 (21:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88962 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index 7aa720144c5c98fc06e3f557a708cf1a86d42feb..41ffddd23aa438363067778c1d7d231b72515521 100644 (file)
@@ -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;
 }