Changes in directory llvm/lib/VMCore:
Constants.cpp updated: 1.208 -> 1.209 --- Log message: A value of 64 or fewer bits is valid if the ConstantInt has more then 64 bits. --- Diffs of the changes: (+2 -4) Constants.cpp | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.208 llvm/lib/VMCore/Constants.cpp:1.209 --- llvm/lib/VMCore/Constants.cpp:1.208 Mon Feb 5 14:47:20 2007 +++ llvm/lib/VMCore/Constants.cpp Mon Feb 5 17:47:56 2007 @@ -554,10 +554,9 @@ bool ConstantInt::isValueValidForType(const Type *Ty, uint64_t Val) { unsigned NumBits = cast<IntegerType>(Ty)->getBitWidth(); // assert okay - assert(NumBits <= 64 && "Not implemented: integers > 64-bits"); if (Ty == Type::Int1Ty) return Val == 0 || Val == 1; - if (NumBits == 64) + if (NumBits >= 64) return true; // always true, has to fit in largest type uint64_t Max = (1ll << NumBits) - 1; return Val <= Max; @@ -565,10 +564,9 @@ bool ConstantInt::isValueValidForType(const Type *Ty, int64_t Val) { unsigned NumBits = cast<IntegerType>(Ty)->getBitWidth(); // assert okay - assert(NumBits <= 64 && "Not implemented: integers > 64-bits"); if (Ty == Type::Int1Ty) return Val == 0 || Val == 1 || Val == -1; - if (NumBits == 64) + if (NumBits >= 64) return true; // always true, has to fit in largest type int64_t Min = -(1ll << (NumBits-1)); int64_t Max = (1ll << (NumBits-1)) - 1; _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits