[llvm-commits] CVS: llvm/lib/Analysis/Expressions.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Apr 16 17:51:00 PDT 2003


Changes in directory llvm/lib/Analysis:

Expressions.cpp updated: 1.29 -> 1.30

---
Log message:

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


---
Diffs of the changes:

Index: llvm/lib/Analysis/Expressions.cpp
diff -u llvm/lib/Analysis/Expressions.cpp:1.29 llvm/lib/Analysis/Expressions.cpp:1.30
--- llvm/lib/Analysis/Expressions.cpp:1.29	Mon Sep  2 20:05:48 2002
+++ llvm/lib/Analysis/Expressions.cpp	Wed Apr 16 17:50:19 2003
@@ -244,11 +244,9 @@
   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;
   }
   





More information about the llvm-commits mailing list