diff options
Diffstat (limited to 'lib/Analysis/ConstantRange.cpp')
-rw-r--r-- | lib/Analysis/ConstantRange.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Analysis/ConstantRange.cpp b/lib/Analysis/ConstantRange.cpp index 109ed42cfc..beb61754fc 100644 --- a/lib/Analysis/ConstantRange.cpp +++ b/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)); |