From 9f4918ab93c4e67a46fbe48a22395e4c024f97f2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 8 Mar 2004 06:11:10 +0000 Subject: [PATCH] Eliminate nightmarish API llvm-svn: 12214 --- llvm/lib/VMCore/Constants.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp index 5a617fad9ae5..0762725c288c 100644 --- a/llvm/lib/VMCore/Constants.cpp +++ b/llvm/lib/VMCore/Constants.cpp @@ -1119,26 +1119,3 @@ void ConstantExpr::destroyConstant() { const char *ConstantExpr::getOpcodeName() const { return Instruction::getOpcodeName(getOpcode()); } - -unsigned Constant::mutateReferences(Value *OldV, Value *NewV) { - // Uses of constant pointer refs are global values, not constants! - if (ConstantPointerRef *CPR = dyn_cast(this)) { - GlobalValue *NewGV = cast(NewV); - GlobalValue *OldGV = CPR->getValue(); - - assert(OldGV == OldV && "Cannot mutate old value if I'm not using it!"); - Operands[0] = NewGV; - OldGV->getParent()->mutateConstantPointerRef(OldGV, NewGV); - return 1; - } else { - Constant *NewC = cast(NewV); - unsigned NumReplaced = 0; - for (unsigned i = 0, N = getNumOperands(); i != N; ++i) - if (Operands[i] == OldV) { - ++NumReplaced; - Operands[i] = NewC; - } - return NumReplaced; - } -} -