[llvm-commits] [llvm] r77378 - in /llvm/trunk: include/llvm/Metadata.h lib/VMCore/Metadata.cpp

Devang Patel dpatel at apple.com
Tue Jul 28 15:04:55 PDT 2009


Author: dpatel
Date: Tue Jul 28 17:04:55 2009
New Revision: 77378

URL: http://llvm.org/viewvc/llvm-project?rev=77378&view=rev
Log:
Remove unused method.

Modified:
    llvm/trunk/include/llvm/Metadata.h
    llvm/trunk/lib/VMCore/Metadata.cpp

Modified: llvm/trunk/include/llvm/Metadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Metadata.h?rev=77378&r1=77377&r2=77378&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Metadata.h (original)
+++ llvm/trunk/include/llvm/Metadata.h Tue Jul 28 17:04:55 2009
@@ -95,8 +95,6 @@
 
   friend class LLVMContextImpl;
 
-  void replaceElement(Value *From, Value *To);
-
   SmallVector<WeakVH, 4> Node;
   typedef SmallVectorImpl<WeakVH>::iterator elem_iterator;
 

Modified: llvm/trunk/lib/VMCore/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=77378&r1=77377&r2=77378&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Metadata.cpp (original)
+++ llvm/trunk/lib/VMCore/Metadata.cpp Tue Jul 28 17:04:55 2009
@@ -27,19 +27,3 @@
   for (const_elem_iterator I = elem_begin(), E = elem_end(); I != E; ++I)
     ID.AddPointer(*I);
 }
-
-void MDNode::replaceElement(Value *From, Value *To) {
-  SmallVector<Value*, 4> Values;
-  Values.reserve(getNumElements());  // Build replacement array...
-  for (unsigned i = 0, e = getNumElements(); i != e; ++i) {
-    Value *Val = getElement(i);
-    if (Val == From) Val = To;
-    Values.push_back(Val);
-  }
-
-  MDNode *Replacement =
-    getType()->getContext().getMDNode(&Values[0], Values.size());
-  assert(Replacement != this && "I didn't contain From!");
-
-  uncheckedReplaceAllUsesWith(Replacement);
-}





More information about the llvm-commits mailing list