r234696 - DebugInfo: Switch from replaceAllUsesWith() to replaceTemporary()
Duncan P. N. Exon Smith
dexonsmith at apple.com
Sat Apr 11 12:05:04 PDT 2015
Author: dexonsmith
Date: Sat Apr 11 14:05:04 2015
New Revision: 234696
URL: http://llvm.org/viewvc/llvm-project?rev=234696&view=rev
Log:
DebugInfo: Switch from replaceAllUsesWith() to replaceTemporary()
Stop using `DIDescriptor`'s wrapper around
`MDNode::replaceAllUsesWith()` (which is going away). The new home for
this logic is `DIBuilder::replaceTemporary()`, added in LLVM r234695.
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=234696&r1=234695&r2=234696&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Sat Apr 11 14:05:04 2015
@@ -3385,10 +3385,10 @@ void CGDebugInfo::finalize() {
// element and the size(), so don't cache/reference them.
for (size_t i = 0; i != ObjCInterfaceCache.size(); ++i) {
ObjCInterfaceCacheEntry E = ObjCInterfaceCache[i];
- E.Decl.replaceAllUsesWith(CGM.getLLVMContext(),
- E.Type->getDecl()->getDefinition()
- ? CreateTypeDefinition(E.Type, E.Unit)
- : E.Decl);
+ llvm::MDType *Ty = E.Type->getDecl()->getDefinition()
+ ? CreateTypeDefinition(E.Type, E.Unit)
+ : E.Decl;
+ DBuilder.replaceTemporary(llvm::TempMDType(E.Decl), Ty);
}
for (auto p : ReplaceMap) {
@@ -3400,8 +3400,8 @@ void CGDebugInfo::finalize() {
assert(it != TypeCache.end());
assert(it->second);
- llvm::DIType RepTy = cast<llvm::MDType>(it->second);
- Ty.replaceAllUsesWith(CGM.getLLVMContext(), RepTy);
+ DBuilder.replaceTemporary(llvm::TempMDType(Ty),
+ cast<llvm::MDType>(it->second));
}
for (const auto &p : FwdDeclReplaceMap) {
@@ -3418,8 +3418,8 @@ void CGDebugInfo::finalize() {
else
Repl = it->second;
- FwdDecl.replaceAllUsesWith(CGM.getLLVMContext(),
- llvm::DIDescriptor(cast<llvm::MDNode>(Repl)));
+ DBuilder.replaceTemporary(llvm::TempMDNode(FwdDecl),
+ cast<llvm::MDNode>(Repl));
}
// We keep our own list of retained types, because we need to look
More information about the cfe-commits
mailing list