Fix bug: IndVarSimplify/2003-04-16-ExprAnalysis.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5795 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-04-16 22:50:19 +00:00
parent 843c80f7a3
commit ac7ad68cc0

View File

@ -244,11 +244,9 @@ ExprType ClassifyExpression(Value *Expr) {
case Value::ArgumentVal: // nothing known, return variable itself
return Expr;
case Value::ConstantVal: // Constant value, just return constant
Constant *CPV = cast<Constant>(Expr);
if (CPV->getType()->isInteger()) { // It's an integral constant!
ConstantInt *CPI = cast<ConstantInt>(Expr);
if (ConstantInt *CPI = dyn_cast<ConstantInt>(cast<Constant>(Expr)))
// It's an integral constant!
return ExprType(CPI->isNullValue() ? 0 : CPI);
}
return Expr;
}