DebugInfo: Remove dead DIDescriptor::replaceAllUsesWith()
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sat, 11 Apr 2015 19:29:09 +0000 (19:29 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sat, 11 Apr 2015 19:29:09 +0000 (19:29 +0000)
r234696 replaced the only use of `DIDescriptor::replaceAllUsesWith()`
with `DIBuilder::replaceTemporary()` (added in r234695).  Delete the
dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234697 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/DebugInfo.h
lib/IR/DebugInfo.cpp

index e575e83484ba8389f3d768db27daa5cb0f619f75..33bb225db19fef3812d07282027486a44697689a 100644 (file)
@@ -106,10 +106,6 @@ public:
 
   void print(raw_ostream &OS) const;
   void dump() const;
-
-  /// \brief Replace all uses of debug info referenced by this descriptor.
-  void replaceAllUsesWith(LLVMContext &VMContext, DIDescriptor D);
-  void replaceAllUsesWith(MDNode *D);
 };
 
 #define DECLARE_SIMPLIFY_DESCRIPTOR(DESC)                                      \
index c8ae26391619b0e2895ed1abef8801824ab2abd7..1fbc53c195b1def1c3055f2a4dd8a0e859323e3a 100644 (file)
@@ -50,33 +50,6 @@ unsigned DIVariable::getSizeInBits(const DITypeIdentifierMap &Map) {
 // Simple Descriptor Constructors and other Methods
 //===----------------------------------------------------------------------===//
 
-void DIDescriptor::replaceAllUsesWith(LLVMContext &, DIDescriptor D) {
-  assert(DbgNode && "Trying to replace an unverified type!");
-  assert(DbgNode->isTemporary() && "Expected temporary node");
-  TempMDNode Temp(get());
-
-  // Since we use a TrackingVH for the node, its easy for clients to manufacture
-  // legitimate situations where they want to replaceAllUsesWith() on something
-  // which, due to uniquing, has merged with the source. We shield clients from
-  // this detail by allowing a value to be replaced with replaceAllUsesWith()
-  // itself.
-  if (Temp.get() == D.get()) {
-    DbgNode = MDNode::replaceWithUniqued(std::move(Temp));
-    return;
-  }
-
-  Temp->replaceAllUsesWith(D.get());
-  DbgNode = D.get();
-}
-
-void DIDescriptor::replaceAllUsesWith(MDNode *D) {
-  assert(DbgNode && "Trying to replace an unverified type!");
-  assert(DbgNode != D && "This replacement should always happen");
-  assert(DbgNode->isTemporary() && "Expected temporary node");
-  TempMDNode Node(get());
-  Node->replaceAllUsesWith(D);
-}
-
 DIScopeRef DIScope::getRef() const { return MDScopeRef::get(get()); }
 
 bool DIVariable::isInlinedFnArgument(const Function *CurFn) {