diff options
author | Chris Lattner <sabre@nondot.org> | 2002-09-03 01:08:28 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-09-03 01:08:28 +0000 |
commit | b0b412e66ecbb0b374e3d034049b9d18b198473c (patch) | |
tree | 507b70221ac79e11ffb2be35db9e7b0113b3762e /llvm/lib/CodeGen | |
parent | bc6bdc2992c404b5dc268718368d9298f67b2948 (diff) | |
download | bcm5719-llvm-b0b412e66ecbb0b374e3d034049b9d18b198473c.tar.gz bcm5719-llvm-b0b412e66ecbb0b374e3d034049b9d18b198473c.zip |
- Renamed Type::isIntegral() to Type::isInteger()
- Added new method Type::isIntegral() that is the same as isInteger, but
also accepts bool.
llvm-svn: 3574
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
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<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; |