Simplify some code

llvm-svn: 30658
This commit is contained in:
Chris Lattner 2006-09-28 23:14:29 +00:00
parent 18284b15a8
commit 7851529456

View File

@ -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));