[llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Jan 12 13:14:07 PST 2004


Changes in directory llvm/lib/VMCore:

Constants.cpp updated: 1.65 -> 1.66

---
Log message:

Fix out of date comment, remove use of ConstantExpr::getShift


---
Diffs of the changes:  (+1 -8)

Index: llvm/lib/VMCore/Constants.cpp
diff -u llvm/lib/VMCore/Constants.cpp:1.65 llvm/lib/VMCore/Constants.cpp:1.66
--- llvm/lib/VMCore/Constants.cpp:1.65	Mon Jan 12 13:04:55 2004
+++ llvm/lib/VMCore/Constants.cpp	Mon Jan 12 13:12:58 2004
@@ -501,13 +501,6 @@
   } else if (getOpcode() == Instruction::Cast) {
     assert(getOperand(0) == From && "Cast only has one use!");
     Replacement = ConstantExpr::getCast(To, getType());
-  } else if (getOpcode() == Instruction::Shl ||
-             getOpcode() == Instruction::Shr) {
-    Constant *C1 = getOperand(0);
-    Constant *C2 = getOperand(1);
-    if (C1 == From) C1 = To;
-    if (C2 == From) C2 = To;
-    Replacement = ConstantExpr::getShift(getOpcode(), C1, C2);
   } else if (getNumOperands() == 2) {
     Constant *C1 = getOperand(0);
     Constant *C2 = getOperand(1);
@@ -958,7 +951,7 @@
   return ExprConstants.getOrCreate(ReqTy, Key);
 }
 
-/// getShift - Return a shift left or shift right constant expr
+/// getShiftTy - Return a shift left or shift right constant expr
 Constant *ConstantExpr::getShiftTy(const Type *ReqTy, unsigned Opcode,
                                    Constant *C1, Constant *C2) {
   // Check the operands for consistency first





More information about the llvm-commits mailing list