Casts are now unnecessary
authorChris Lattner <sabre@nondot.org>
Wed, 14 May 2003 17:50:19 +0000 (17:50 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 14 May 2003 17:50:19 +0000 (17:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6199 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CBackend/CBackend.cpp
lib/Target/CBackend/Writer.cpp

index 195a4f71ec6ee20d752a4dc2b48c6d81d8fe1704..577054e245ce6b48696b963a6d9d076334fdccf2 100644 (file)
@@ -344,28 +344,28 @@ void CWriter::printConstant(Constant *CPV) {
       Out << "((";
       printType(Out, CPV->getType());
       Out << ")";
-      printConstant(cast<Constant>(CPV->getOperand(0)));
+      printConstant(CE->getOperand(0));
       Out << ")";
       return;
 
     case Instruction::GetElementPtr:
       Out << "(&(";
-      printIndexingExpression(CPV->getOperand(0),
+      printIndexingExpression(CE->getOperand(0),
                               CPV->op_begin()+1, CPV->op_end());
       Out << "))";
       return;
     case Instruction::Add:
       Out << "(";
-      printConstant(cast<Constant>(CPV->getOperand(0)));
+      printConstant(CE->getOperand(0));
       Out << " + ";
-      printConstant(cast<Constant>(CPV->getOperand(1)));
+      printConstant(CE->getOperand(1));
       Out << ")";
       return;
     case Instruction::Sub:
       Out << "(";
-      printConstant(cast<Constant>(CPV->getOperand(0)));
+      printConstant(CE->getOperand(0));
       Out << " - ";
-      printConstant(cast<Constant>(CPV->getOperand(1)));
+      printConstant(CE->getOperand(1));
       Out << ")";
       return;
 
index 195a4f71ec6ee20d752a4dc2b48c6d81d8fe1704..577054e245ce6b48696b963a6d9d076334fdccf2 100644 (file)
@@ -344,28 +344,28 @@ void CWriter::printConstant(Constant *CPV) {
       Out << "((";
       printType(Out, CPV->getType());
       Out << ")";
-      printConstant(cast<Constant>(CPV->getOperand(0)));
+      printConstant(CE->getOperand(0));
       Out << ")";
       return;
 
     case Instruction::GetElementPtr:
       Out << "(&(";
-      printIndexingExpression(CPV->getOperand(0),
+      printIndexingExpression(CE->getOperand(0),
                               CPV->op_begin()+1, CPV->op_end());
       Out << "))";
       return;
     case Instruction::Add:
       Out << "(";
-      printConstant(cast<Constant>(CPV->getOperand(0)));
+      printConstant(CE->getOperand(0));
       Out << " + ";
-      printConstant(cast<Constant>(CPV->getOperand(1)));
+      printConstant(CE->getOperand(1));
       Out << ")";
       return;
     case Instruction::Sub:
       Out << "(";
-      printConstant(cast<Constant>(CPV->getOperand(0)));
+      printConstant(CE->getOperand(0));
       Out << " - ";
-      printConstant(cast<Constant>(CPV->getOperand(1)));
+      printConstant(CE->getOperand(1));
       Out << ")";
       return;