diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2007-01-19 21:13:56 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2007-01-19 21:13:56 +0000 |
| commit | a94d394ad2ae63071ae1fd203ea28f50066a5879 (patch) | |
| tree | ac27c27212b5f7fefcab4a0e19f9053c8ce7a6c8 /llvm/lib/ExecutionEngine/ExecutionEngine.cpp | |
| parent | eaedf70eea55bda4689f5ceaa73fed2e95143173 (diff) | |
| download | bcm5719-llvm-a94d394ad2ae63071ae1fd203ea28f50066a5879.tar.gz bcm5719-llvm-a94d394ad2ae63071ae1fd203ea28f50066a5879.zip | |
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.
llvm-svn: 33370
Diffstat (limited to 'llvm/lib/ExecutionEngine/ExecutionEngine.cpp')
| -rw-r--r-- | llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp index 771ce0b1aa3..93207cc8bd9 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp @@ -456,9 +456,7 @@ void ExecutionEngine::StoreValueToMemory(GenericValue Val, GenericValue *Ptr, 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 @@ Store4BytesLittleEndian: 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; |

