- 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:
Chris Lattner
2002-09-03 01:08:28 +00:00
parent 65ad37205e
commit 0c4e886dbf
12 changed files with 61 additions and 84 deletions
@@ -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;