diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-11-20 18:43:35 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-11-20 18:43:35 +0000 |
commit | f601d6df6f43bb833461cbcee475c36998e6c259 (patch) | |
tree | c881a9c60ea2baef7a63c96d20bbe6d08727357b /lib/VMCore | |
parent | 1c3f050309592e034972dc77a2eb4025680ff293 (diff) | |
download | llvm-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.cpp | 16 |
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; } |