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

Devang Patel dpatel at apple.com
Mon Jul 27 11:42:08 PDT 2009


Author: dpatel
Date: Mon Jul 27 13:42:03 2009
New Revision: 77228

URL: http://llvm.org/viewvc/llvm-project?rev=77228&view=rev
Log:
Use DICompositeType->replaceAllUsesWith()

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=77228&r1=77227&r2=77228&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Jul 27 13:42:03 2009
@@ -543,7 +543,7 @@
   // its members.  Finally, we create a descriptor for the complete type (which
   // may refer to the forward decl if the struct is recursive) and replace all
   // uses of the forward declaration with the final definition.
-  llvm::DIType FwdDecl =
+  llvm::DICompositeType FwdDecl =
     DebugFactory.CreateCompositeType(Tag, Unit, Name, DefUnit, Line, 0, 0, 0, 0,
                                      llvm::DIType(), llvm::DIArray(),
                                      RuntimeLang);
@@ -631,15 +631,14 @@
   uint64_t Size = M->getContext().getTypeSize(Ty);
   uint64_t Align = M->getContext().getTypeAlign(Ty);
   
-  llvm::DIType RealDecl =
+  llvm::DICompositeType RealDecl =
     DebugFactory.CreateCompositeType(Tag, Unit, Name, DefUnit, Line, Size,
                                      Align, 0, 0, llvm::DIType(), Elements,
                                      RuntimeLang);
 
   // 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.getGV()->replaceAllUsesWith(RealDecl.getGV());
-  FwdDecl.getGV()->eraseFromParent();
+  FwdDecl.replaceAllUsesWith(RealDecl);
 
   // Update TypeCache.
   TypeCache[QualType(Ty, 0).getAsOpaquePtr()] = RealDecl;  





More information about the cfe-commits mailing list