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

Chris Lattner lattner at cs.uiuc.edu
Mon Jun 21 07:20:02 PDT 2004


Changes in directory llvm/lib/VMCore:

Constants.cpp updated: 1.91 -> 1.92

---
Log message:

Make ConstantBool act like a 1 bit ConstantInt, in order to simplify client 
code.  Patch contributed by Vladimir Prus.


---
Diffs of the changes:  (+7 -4)

Index: llvm/lib/VMCore/Constants.cpp
diff -u llvm/lib/VMCore/Constants.cpp:1.91 llvm/lib/VMCore/Constants.cpp:1.92
--- llvm/lib/VMCore/Constants.cpp:1.91	Thu Jun 17 13:18:53 2004
+++ llvm/lib/VMCore/Constants.cpp	Mon Jun 21 07:12:12 2004
@@ -212,12 +212,15 @@
 //===----------------------------------------------------------------------===//
 //                             Normal Constructors
 
-ConstantBool::ConstantBool(bool V) : ConstantIntegral(Type::BoolTy) {
-  Val = V;
+ConstantIntegral::ConstantIntegral(const Type *Ty, uint64_t V)
+  : Constant(Ty) {
+    Val.Unsigned = V;
+}
+
+ConstantBool::ConstantBool(bool V) : ConstantIntegral(Type::BoolTy, V) {
 }
 
-ConstantInt::ConstantInt(const Type *Ty, uint64_t V) : ConstantIntegral(Ty) {
-  Val.Unsigned = V;
+ConstantInt::ConstantInt(const Type *Ty, uint64_t V) : ConstantIntegral(Ty, V) {
 }
 
 ConstantSInt::ConstantSInt(const Type *Ty, int64_t V) : ConstantInt(Ty, V) {





More information about the llvm-commits mailing list