aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-07-22 18:57:00 +0000
committerDevang Patel <dpatel@apple.com>2009-07-22 18:57:00 +0000
commit0ce73f64ca98469856327480f0f3925d59ac409f (patch)
tree27db99673a2538dd628a7fcd75e7f7bdf9fd1a6b
parent1f2023ab8b35e0f665eb6c0f11dd6d9b9bca12b8 (diff)
Use DICompositeType->replaceAllUsesWith().
This requires llvm rev. 76769 or higher. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76770 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index a2d7b023d4..a8975dd6a2 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -432,7 +432,7 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty,
// 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());
@@ -506,14 +506,13 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty,
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);
// 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;