forked from OSchip/llvm-project
Fix bug: IndVarSimplify/2003-04-16-ExprAnalysis.ll
llvm-svn: 5795
This commit is contained in:
parent
459b9e2485
commit
dee5f75221
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue