mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
- Renamed Type::isIntegral() to Type::isInteger()
- Added new method Type::isIntegral() that is the same as isInteger, but
also accepts bool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3574 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -72,12 +72,12 @@ GetConstantValueAsUnsignedInt(const Value *V,
|
||||
isValidConstant = true;
|
||||
|
||||
if (isa<Constant>(V))
|
||||
if (V->getType() == Type::BoolTy)
|
||||
return (int64_t) cast<ConstantBool>(V)->getValue();
|
||||
else if (V->getType()->isIntegral())
|
||||
return (V->getType()->isUnsigned()
|
||||
? cast<ConstantUInt>(V)->getValue()
|
||||
: (uint64_t) cast<ConstantSInt>(V)->getValue());
|
||||
if (const ConstantBool *CB = dyn_cast<ConstantBool>(V))
|
||||
return (int64_t)CB->getValue();
|
||||
else if (const ConstantSInt *CS = dyn_cast<ConstantSInt>(V))
|
||||
return (uint64_t)CS->getValue();
|
||||
else if (const ConstantUInt *CU = dyn_cast<ConstantUInt>(V))
|
||||
return CU->getValue();
|
||||
|
||||
isValidConstant = false;
|
||||
return 0;
|
||||
@@ -343,7 +343,7 @@ ChooseRegOrImmed(Value* val,
|
||||
}
|
||||
|
||||
// Otherwise it needs to be an integer or a NULL pointer
|
||||
if (! CPV->getType()->isIntegral() &&
|
||||
if (! CPV->getType()->isInteger() &&
|
||||
! (isa<PointerType>(CPV->getType()) &&
|
||||
CPV->isNullValue()))
|
||||
return opType;
|
||||
|
||||
Reference in New Issue
Block a user