summaryrefslogtreecommitdiff
path: root/lib/VMCore
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-11-20 18:43:35 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-11-20 18:43:35 +0000
commitf601d6df6f43bb833461cbcee475c36998e6c259 (patch)
treec881a9c60ea2baef7a63c96d20bbe6d08727357b /lib/VMCore
parent1c3f050309592e034972dc77a2eb4025680ff293 (diff)
downloadllvm-f601d6df6f43bb833461cbcee475c36998e6c259.tar.gz
llvm-f601d6df6f43bb833461cbcee475c36998e6c259.tar.bz2
llvm-f601d6df6f43bb833461cbcee475c36998e6c259.tar.xz
Simplify code. No change in functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119908 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Constants.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index 16eaca8104..5bbf087e48 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/VMCore/Constants.cpp
@@ -265,20 +265,16 @@ ConstantInt::ConstantInt(const IntegerType *Ty, const APInt& V)
ConstantInt* ConstantInt::getTrue(LLVMContext &Context) {
LLVMContextImpl *pImpl = Context.pImpl;
- if (pImpl->TheTrueVal)
- return pImpl->TheTrueVal;
- else
- return (pImpl->TheTrueVal =
- ConstantInt::get(IntegerType::get(Context, 1), 1));
+ if (!pImpl->TheTrueVal)
+ pImpl->TheTrueVal = ConstantInt::get(Type::getInt1Ty(Context), 1);
+ return pImpl->TheTrueVal;
}
ConstantInt* ConstantInt::getFalse(LLVMContext &Context) {
LLVMContextImpl *pImpl = Context.pImpl;
- if (pImpl->TheFalseVal)
- return pImpl->TheFalseVal;
- else
- return (pImpl->TheFalseVal =
- ConstantInt::get(IntegerType::get(Context, 1), 0));
+ if (!pImpl->TheFalseVal)
+ pImpl->TheFalseVal = ConstantInt::get(Type::getInt1Ty(Context), 0);
+ return pImpl->TheFalseVal;
}