From 0c4e886dbf1cf7736819a49d5143ae1c2a0cfb79 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3574 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/CodeGen') diff --git a/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp b/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp index 5004d9027b..870bbbd787 100644 --- a/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp +++ b/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-70-g09d2