aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-09-11 01:21:04 +0000
committerChris Lattner <sabre@nondot.org>2002-09-11 01:21:04 +0000
commit562219de55f007b0dbd3aeffad888e530a8faad4 (patch)
tree43254875654d1411d36e49b95737bd0a604d6948 /lib
parent0235fe2b72af319a54c893887732b81df4c59906 (diff)
downloadexternal_llvm-562219de55f007b0dbd3aeffad888e530a8faad4.zip
external_llvm-562219de55f007b0dbd3aeffad888e530a8faad4.tar.gz
external_llvm-562219de55f007b0dbd3aeffad888e530a8faad4.tar.bz2
Give better assertion message for error conditions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3680 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Constants.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index 146f307..fe6af75 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/VMCore/Constants.cpp
@@ -174,10 +174,14 @@ ConstantInt::ConstantInt(const Type *Ty, uint64_t V) : ConstantIntegral(Ty) {
}
ConstantSInt::ConstantSInt(const Type *Ty, int64_t V) : ConstantInt(Ty, V) {
+ assert(Ty->isInteger() && Ty->isSigned() &&
+ "Illegal type for unsigned integer constant!");
assert(isValueValidForType(Ty, V) && "Value too large for type!");
}
ConstantUInt::ConstantUInt(const Type *Ty, uint64_t V) : ConstantInt(Ty, V) {
+ assert(Ty->isInteger() && Ty->isUnsigned() &&
+ "Illegal type for unsigned integer constant!");
assert(isValueValidForType(Ty, V) && "Value too large for type!");
}