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

llvm-svn: 5795
This commit is contained in:
Chris Lattner 2003-04-16 22:50:19 +00:00
parent 459b9e2485
commit dee5f75221
1 changed files with 2 additions and 4 deletions

View File

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