summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-09-28 23:14:29 +0000
committerChris Lattner <sabre@nondot.org>2006-09-28 23:14:29 +0000
commita7b5664318d289873dfae9cb38d5765c66b5ecf9 (patch)
tree99941a04624d412fc04202abb1f92aafd3a8f3a7 /llvm/lib/Analysis
parent7cb6809c258a02b1322762d3b6a720493b000380 (diff)
downloadbcm5719-llvm-a7b5664318d289873dfae9cb38d5765c66b5ecf9.tar.gz
bcm5719-llvm-a7b5664318d289873dfae9cb38d5765c66b5ecf9.zip
Simplify some code
llvm-svn: 30658
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/ConstantRange.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ConstantRange.cpp b/llvm/lib/Analysis/ConstantRange.cpp
index 109ed42cfc2..beb61754fc7 100644
--- a/llvm/lib/Analysis/ConstantRange.cpp
+++ b/llvm/lib/Analysis/ConstantRange.cpp
@@ -30,8 +30,8 @@
using namespace llvm;
static ConstantIntegral *Next(ConstantIntegral *CI) {
- if (CI->getType() == Type::BoolTy)
- return CI == ConstantBool::True ? ConstantBool::False : ConstantBool::True;
+ if (ConstantBool *CB = dyn_cast<ConstantBool>(CI))
+ return ConstantBool::get(!CB->getValue());
Constant *Result = ConstantExpr::getAdd(CI,
ConstantInt::get(CI->getType(), 1));
OpenPOWER on IntegriCloud