From: Chris Lattner Date: Wed, 14 May 2003 17:50:19 +0000 (+0000) Subject: Casts are now unnecessary X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=84c0d5e157bafe1af1d702068e645e287b7bfc29;p=oota-llvm.git Casts are now unnecessary git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6199 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 195a4f71ec6..577054e245c 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -344,28 +344,28 @@ void CWriter::printConstant(Constant *CPV) { Out << "(("; printType(Out, CPV->getType()); Out << ")"; - printConstant(cast(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(CPV->getOperand(0))); + printConstant(CE->getOperand(0)); Out << " + "; - printConstant(cast(CPV->getOperand(1))); + printConstant(CE->getOperand(1)); Out << ")"; return; case Instruction::Sub: Out << "("; - printConstant(cast(CPV->getOperand(0))); + printConstant(CE->getOperand(0)); Out << " - "; - printConstant(cast(CPV->getOperand(1))); + printConstant(CE->getOperand(1)); Out << ")"; return; diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp index 195a4f71ec6..577054e245c 100644 --- a/lib/Target/CBackend/Writer.cpp +++ b/lib/Target/CBackend/Writer.cpp @@ -344,28 +344,28 @@ void CWriter::printConstant(Constant *CPV) { Out << "(("; printType(Out, CPV->getType()); Out << ")"; - printConstant(cast(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(CPV->getOperand(0))); + printConstant(CE->getOperand(0)); Out << " + "; - printConstant(cast(CPV->getOperand(1))); + printConstant(CE->getOperand(1)); Out << ")"; return; case Instruction::Sub: Out << "("; - printConstant(cast(CPV->getOperand(0))); + printConstant(CE->getOperand(0)); Out << " - "; - printConstant(cast(CPV->getOperand(1))); + printConstant(CE->getOperand(1)); Out << ")"; return;