const-ify getOpcode.
authorDan Gohman <gohman@apple.com>
Thu, 29 May 2008 19:53:46 +0000 (19:53 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 29 May 2008 19:53:46 +0000 (19:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51698 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index 8c2dc3e92f40db92cd3e7d46514ae0a119b572c7..74e6b6f6b060057627f6c7f8d1328f28ec4ae6d7 100644 (file)
@@ -603,10 +603,10 @@ static User *dyn_castGetElementPtr(Value *V) {
 
 /// getOpcode - If this is an Instruction or a ConstantExpr, return the
 /// opcode value. Otherwise return UserOp1.
-static unsigned getOpcode(Value *V) {
-  if (Instruction *I = dyn_cast<Instruction>(V))
+static unsigned getOpcode(const Value *V) {
+  if (const Instruction *I = dyn_cast<Instruction>(V))
     return I->getOpcode();
-  if (ConstantExpr *CE = dyn_cast<ConstantExpr>(V))
+  if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V))
     return CE->getOpcode();
   // Use UserOp1 to mean there's no opcode.
   return Instruction::UserOp1;