[llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Mar 8 00:12:01 PST 2004
Changes in directory llvm/lib/VMCore:
Constants.cpp updated: 1.80 -> 1.81
---
Log message:
Eliminate nightmarish API
---
Diffs of the changes: (+0 -23)
Index: llvm/lib/VMCore/Constants.cpp
diff -u llvm/lib/VMCore/Constants.cpp:1.80 llvm/lib/VMCore/Constants.cpp:1.81
--- llvm/lib/VMCore/Constants.cpp:1.80 Mon Feb 16 14:46:13 2004
+++ llvm/lib/VMCore/Constants.cpp Mon Mar 8 00:11:10 2004
@@ -1119,26 +1119,3 @@
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;
- }
-}
-
More information about the llvm-commits
mailing list