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
This commit is contained in:
Reid Spencer
2007-01-19 21:13:56 +00:00
parent eaedf70eea
commit a94d394ad2
18 changed files with 84 additions and 76 deletions

View File

@@ -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;