diff options
author | Chris Lattner <sabre@nondot.org> | 2003-05-14 17:51:05 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-05-14 17:51:05 +0000 |
commit | 3b9922f99c96bafd2c3ecb7f7fa4a8a4fc9cc9dc (patch) | |
tree | f12ce72c715e88a5976b6c08b337309b1fa696ad /lib/VMCore/ConstantFold.cpp | |
parent | 9e094c40df10d928a1242f8652dc56ebd41d38fd (diff) |
Remove unnecessary casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6201 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r-- | lib/VMCore/ConstantFold.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index db8cc4487c..d5f98bd201 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -91,7 +91,7 @@ Constant *ConstantFoldCastInstruction(const Constant *V, const Type *DestTy) { if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) if (CE->getOpcode() == Instruction::Cast) { - Constant *Op = (Constant*)cast<Constant>(CE->getOperand(0)); + Constant *Op = const_cast<Constant*>(CE->getOperand(0)); // Try to not produce a cast of a cast, which is almost always redundant. if (!Op->getType()->isFloatingPoint() && !CE->getType()->isFloatingPoint() && @@ -166,7 +166,7 @@ Constant *ConstantFoldGetElementPtr(const Constant *C, dyn_cast<ArrayType>(cast<PointerType>(C->getType())->getElementType())) if (CAT->getElementType() == SAT->getElementType()) return ConstantExpr::getGetElementPtr( - (Constant*)cast<Constant>(CE->getOperand(0)), IdxList); + (Constant*)CE->getOperand(0), IdxList); return 0; } |