From ac7ad68cc0f7c4bdb4a08aa1a031d1c344313502 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 16 Apr 2003 22:50:19 +0000 Subject: [PATCH] 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 --- lib/Analysis/Expressions.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Analysis/Expressions.cpp b/lib/Analysis/Expressions.cpp index 14ba9c8e9dc..bfab20c42c8 100644 --- a/lib/Analysis/Expressions.cpp +++ b/lib/Analysis/Expressions.cpp @@ -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(Expr); - if (CPV->getType()->isInteger()) { // It's an integral constant! - ConstantInt *CPI = cast(Expr); + if (ConstantInt *CPI = dyn_cast(cast(Expr))) + // It's an integral constant! return ExprType(CPI->isNullValue() ? 0 : CPI); - } return Expr; } -- 2.40.0