diff options
author | Chris Lattner <sabre@nondot.org> | 2006-09-28 23:14:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-09-28 23:14:29 +0000 |
commit | a7b5664318d289873dfae9cb38d5765c66b5ecf9 (patch) | |
tree | 99941a04624d412fc04202abb1f92aafd3a8f3a7 /llvm/lib/Analysis | |
parent | 7cb6809c258a02b1322762d3b6a720493b000380 (diff) | |
download | bcm5719-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.cpp | 4 |
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)); |