diff options
author | Chris Lattner <sabre@nondot.org> | 2002-08-14 17:12:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-08-14 17:12:13 +0000 |
commit | 227b86c5fbf8b6d92b2ccc457264c978f67a61ce (patch) | |
tree | ca46e3f6617a375974cc069c225a90953f718ed1 | |
parent | a7710518dacb30dabf0c2f057b546dc7bcf37071 (diff) |
Return null on failure, instead of aborting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3308 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/VMCore/Constants.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index eb68ef6809..2aef498b36 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -106,9 +106,7 @@ ConstantIntegral *ConstantIntegral::getMaxValue(const Type *Ty) { case Type::UIntTyID: case Type::ULongTyID: return getAllOnesValue(Ty); - default: - assert(0 && "Non-integral type specified!"); - return 0; + default: return 0; } } @@ -132,9 +130,7 @@ ConstantIntegral *ConstantIntegral::getMinValue(const Type *Ty) { case Type::UIntTyID: case Type::ULongTyID: return ConstantUInt::get(Ty, 0); - default: - assert(0 && "Non-integral type specified!"); - return 0; + default: return 0; } } @@ -157,9 +153,7 @@ ConstantIntegral *ConstantIntegral::getAllOnesValue(const Type *Ty) { Val >>= 64-TypeBits; // Shift out unwanted 1 bits... return ConstantUInt::get(Ty, Val); } - default: - assert(0 && "Non-integral type specified!"); - return 0; + default: return 0; } } |