aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/Expressions.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-10-02 03:41:24 +0000
committerChris Lattner <sabre@nondot.org>2001-10-02 03:41:24 +0000
commitb00c582b6d40e6b9ff2d1ed4f5eaf7930e792ace (patch)
tree44b5f879c16e7ecb2e9334ad120e3454270e1bb3 /lib/Analysis/Expressions.cpp
parent1d87bcf4909b06dcd86320722653341f08b8b396 (diff)
Commit more code over to new cast style
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@697 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/Expressions.cpp')
-rw-r--r--lib/Analysis/Expressions.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Analysis/Expressions.cpp b/lib/Analysis/Expressions.cpp
index cb83d41236..abe2a18b94 100644
--- a/lib/Analysis/Expressions.cpp
+++ b/lib/Analysis/Expressions.cpp
@@ -97,7 +97,7 @@ static const ConstPoolInt *Add(const ConstPoolInt *Arg1,
ConstPoolVal *Result = *Arg1 + *Arg2;
assert(Result && Result->getType() == Arg1->getType() &&
"Couldn't perform addition!");
- ConstPoolInt *ResultI = (ConstPoolInt*)Result;
+ ConstPoolInt *ResultI = cast<ConstPoolInt>(Result);
// Check to see if the result is one of the special cases that we want to
// recognize...
@@ -147,7 +147,7 @@ inline const ConstPoolInt *Mul(const ConstPoolInt *Arg1,
ConstPoolVal *Result = *Arg1 * *Arg2;
assert(Result && Result->getType() == Arg1->getType() &&
"Couldn't perform mult!");
- ConstPoolInt *ResultI = (ConstPoolInt*)Result;
+ ConstPoolInt *ResultI = cast<ConstPoolInt>(Result);
// Check to see if the result is one of the special cases that we want to
// recognize...
@@ -203,7 +203,7 @@ static inline ExprType negate(const ExprType &E, Value *V) {
const Type *ETy = E.getExprType(Ty);
ConstPoolInt *Zero = getUnsignedConstant(0, ETy);
ConstPoolInt *One = getUnsignedConstant(1, ETy);
- ConstPoolInt *NegOne = (ConstPoolInt*)(*Zero - *One);
+ ConstPoolInt *NegOne = cast<ConstPoolInt>(*Zero - *One);
if (NegOne == 0) return V; // Couldn't subtract values...
return ExprType(DefOne (E.Scale , Ty) * NegOne, E.Var,
@@ -230,7 +230,7 @@ ExprType analysis::ClassifyExpression(Value *Expr) {
case Value::ConstantVal: // Constant value, just return constant
ConstPoolVal *CPV = cast<ConstPoolVal>(Expr);
if (CPV->getType()->isIntegral()) { // It's an integral constant!
- ConstPoolInt *CPI = (ConstPoolInt*)Expr;
+ ConstPoolInt *CPI = cast<ConstPoolInt>(Expr);
return ExprType(CPI->equalsInt(0) ? 0 : CPI);
}
return Expr;
@@ -297,7 +297,7 @@ ExprType analysis::ClassifyExpression(Value *Expr) {
const ConstPoolVal *CPV =ConstRules::get(*Offs)->castTo(Offs, DestTy);
if (!CPV) return I;
assert(CPV->getType()->isIntegral() && "Must have an integral type!");
- return (ConstPoolInt*)CPV;
+ return cast<ConstPoolInt>(CPV);
} // end case Instruction::Cast
// TODO: Handle SUB, SHR?