aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-08 06:11:10 +0000
committerChris Lattner <sabre@nondot.org>2004-03-08 06:11:10 +0000
commit2296ec0ce95495b490e1000b063ef3afa6857bed (patch)
treef4d233d815accddfe49525142d65e675d52c22f7
parente45a76c85ba199d24432f2dc6453c10a7048c8c2 (diff)
downloadexternal_llvm-2296ec0ce95495b490e1000b063ef3afa6857bed.zip
external_llvm-2296ec0ce95495b490e1000b063ef3afa6857bed.tar.gz
external_llvm-2296ec0ce95495b490e1000b063ef3afa6857bed.tar.bz2
Eliminate nightmarish API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12214 91177308-0d34-0410-b5e6-96231b3b80d8
-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 5a617fa..0762725 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;
- }
-}
-