[llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Sep 10 20:22:05 PDT 2002


Changes in directory llvm/lib/VMCore:

Constants.cpp updated: 1.26 -> 1.27

---
Log message:

Give better assertion message for error conditions


---
Diffs of the changes:

Index: llvm/lib/VMCore/Constants.cpp
diff -u llvm/lib/VMCore/Constants.cpp:1.26 llvm/lib/VMCore/Constants.cpp:1.27
--- llvm/lib/VMCore/Constants.cpp:1.26	Mon Sep  2 20:08:13 2002
+++ llvm/lib/VMCore/Constants.cpp	Tue Sep 10 20:21:04 2002
@@ -174,10 +174,14 @@
 }
 
 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!");
 }
 





More information about the llvm-commits mailing list