Casts are now unnecessary

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6199 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-05-14 17:50:19 +00:00
parent 17aefb168f
commit 84c0d5e157
2 changed files with 12 additions and 12 deletions

View 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;

View 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;