For PR1043:
This is the final patch for this PR. It implements some minor cleanup
in the use of IntegerType, to wit:
1. Type::getIntegerTypeMask -> IntegerType::getBitMask
2. Type::Int*Ty changed to IntegerType* from Type*
3. ConstantInt::getType() returns IntegerType* now, not Type*
This also fixes PR1120.
Patch by Sheng Zhou.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33370 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp
index 771ce0b..93207cc 100644
--- a/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -456,9 +456,7 @@
switch (Ty->getTypeID()) {
case Type::IntegerTyID: {
unsigned BitWidth = cast<IntegerType>(Ty)->getBitWidth();
- uint64_t BitMask = (1ull << BitWidth) - 1;
- if (BitWidth >= 64)
- BitMask = (uint64_t)-1;
+ uint64_t BitMask = cast<IntegerType>(Ty)->getBitMask();
GenericValue TmpVal = Val;
if (BitWidth <= 8)
Ptr->Untyped[0] = Val.Int8Val & BitMask;
@@ -514,9 +512,7 @@
switch (Ty->getTypeID()) {
case Type::IntegerTyID: {
unsigned BitWidth = cast<IntegerType>(Ty)->getBitWidth();
- uint64_t BitMask = (1ull << BitWidth) - 1;
- if (BitWidth >= 64)
- BitMask = (uint64_t)-1;
+ uint64_t BitMask = cast<IntegerType>(Ty)->getBitMask();
GenericValue TmpVal = Val;
if (BitWidth <= 8)
Ptr->Untyped[0] = Val.Int8Val & BitMask;