aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/VMCore/Constants.cpp23
1 files changed, 0 insertions, 23 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index 5a617fad9a..0762725c28 100644
--- a/lib/VMCore/Constants.cpp
+++ b/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<ConstantPointerRef>(this)) {
- GlobalValue *NewGV = cast<GlobalValue>(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<Constant>(NewV);
- unsigned NumReplaced = 0;
- for (unsigned i = 0, N = getNumOperands(); i != N; ++i)
- if (Operands[i] == OldV) {
- ++NumReplaced;
- Operands[i] = NewC;
- }
- return NumReplaced;
- }
-}
-