From b0b412e66ecbb0b374e3d034049b9d18b198473c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 3 Sep 2002 01:08:28 +0000 Subject: - Renamed Type::isIntegral() to Type::isInteger() - Added new method Type::isIntegral() that is the same as isInteger, but also accepts bool. llvm-svn: 3574 --- llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp') diff --git a/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp b/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp index 5004d9027ba..870bbbd7879 100644 --- a/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp +++ b/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp @@ -72,12 +72,12 @@ GetConstantValueAsUnsignedInt(const Value *V, isValidConstant = true; if (isa(V)) - if (V->getType() == Type::BoolTy) - return (int64_t) cast(V)->getValue(); - else if (V->getType()->isIntegral()) - return (V->getType()->isUnsigned() - ? cast(V)->getValue() - : (uint64_t) cast(V)->getValue()); + if (const ConstantBool *CB = dyn_cast(V)) + return (int64_t)CB->getValue(); + else if (const ConstantSInt *CS = dyn_cast(V)) + return (uint64_t)CS->getValue(); + else if (const ConstantUInt *CU = dyn_cast(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(CPV->getType()) && CPV->isNullValue())) return opType; -- cgit v1.2.3