Remove unused method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77378 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2009-07-28 22:04:55 +00:00
parent 1711a7c8cf
commit 3755bec950
2 changed files with 0 additions and 18 deletions

View File

@ -95,8 +95,6 @@ class MDNode : public MetadataBase, public FoldingSetNode {
friend class LLVMContextImpl;
void replaceElement(Value *From, Value *To);
SmallVector<WeakVH, 4> Node;
typedef SmallVectorImpl<WeakVH>::iterator elem_iterator;

View File

@ -27,19 +27,3 @@ void MDNode::Profile(FoldingSetNodeID &ID) const {
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);
}