aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-09-03 01:08:28 +0000
committerChris Lattner <sabre@nondot.org>2002-09-03 01:08:28 +0000
commit0c4e886dbf1cf7736819a49d5143ae1c2a0cfb79 (patch)
treef48443d191cddb7b196d7b0fa211607e58c77689 /lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
parent65ad37205ef6958e07f57f85d1b5070ed1d93d1d (diff)
- 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
Diffstat (limited to 'lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp')
-rw-r--r--lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp14
1 files changed, 7 insertions, 7 deletions
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<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;