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 | 55ed6561a1f1ecdf20435b2ec7d879dee95f7d75 (patch) | |
| tree | d0d52a604d36288a7cf81aa6ab771400bab5b752 /llvm/lib/VMCore/ConstantHandling.cpp | |
| parent | 15285abcbe5c65327b362e3a78f94a92b16d4a8d (diff) | |
| download | bcm5719-llvm-55ed6561a1f1ecdf20435b2ec7d879dee95f7d75.tar.gz bcm5719-llvm-55ed6561a1f1ecdf20435b2ec7d879dee95f7d75.zip | |
Remove unnecessary casts
llvm-svn: 6201
Diffstat (limited to 'llvm/lib/VMCore/ConstantHandling.cpp')
| -rw-r--r-- | llvm/lib/VMCore/ConstantHandling.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/ConstantHandling.cpp b/llvm/lib/VMCore/ConstantHandling.cpp index db8cc4487c1..d5f98bd201e 100644 --- a/llvm/lib/VMCore/ConstantHandling.cpp +++ b/llvm/lib/VMCore/ConstantHandling.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; } |

