[cfe-commits] r88962 - /cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Eli Friedman eli.friedman at gmail.com
Mon Nov 16 13:04:30 PST 2009


Author: efriedma
Date: Mon Nov 16 15:04:30 2009
New Revision: 88962

URL: http://llvm.org/viewvc/llvm-project?rev=88962&view=rev
Log:
Parallel fix to r88951: use TrackingVH to hold forward decl.


Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=88962&r1=88961&r2=88962&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Nov 16 15:04:30 2009
@@ -490,6 +490,7 @@
   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 @@
 
   // 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;
 }





More information about the cfe-commits mailing list