summaryrefslogtreecommitdiff
path: root/include/llvm/Type.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-15 02:27:26 +0000
committerChris Lattner <sabre@nondot.org>2007-01-15 02:27:26 +0000
commit42a75517250017a52afb03a0ade03cbd49559fe5 (patch)
treece6335dd133d9e2af752f558d4edd8f9d1fedefe /include/llvm/Type.h
parentb25c4ca9d8c838c2f18009221b11cd5170c47702 (diff)
downloadllvm-42a75517250017a52afb03a0ade03cbd49559fe5.tar.gz
llvm-42a75517250017a52afb03a0ade03cbd49559fe5.tar.bz2
llvm-42a75517250017a52afb03a0ade03cbd49559fe5.tar.xz
rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask. This makes naming much more consistent. For example, there are now no longer any instances of IntegerType that are not considered isInteger! :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33225 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Type.h')
-rw-r--r--include/llvm/Type.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/include/llvm/Type.h b/include/llvm/Type.h
index b95f146deb..2f83328a2d 100644
--- a/include/llvm/Type.h
+++ b/include/llvm/Type.h
@@ -160,14 +160,9 @@ public:
/// getDescription - Return the string representation of the type...
const std::string &getDescription() const;
- /// isInteger - Equivalent to isSigned() || isUnsigned()
+ /// isInteger - True if this is an instance of IntegerType.
///
- bool isInteger() const { return ID == IntegerTyID && this != Int1Ty; }
-
- /// isIntegral - Returns true if this is an integral type, which is either
- /// Int1Ty or one of the Integer types.
- ///
- bool isIntegral() const { return ID == IntegerTyID; }
+ bool isInteger() const { return ID == IntegerTyID; }
/// isFloatingPoint - Return true if this is one of the two floating point
/// types
@@ -209,8 +204,7 @@ public:
///
bool isSized() const {
// If it's a primitive, it is always sized.
- if (ID == IntegerTyID || (ID >= FloatTyID && ID <= DoubleTyID) ||
- ID == PointerTyID)
+ if (ID == IntegerTyID || isFloatingPoint() || ID == PointerTyID)
return true;
// If it is not something that can have a size (e.g. a function or label),
// it doesn't have a size.
@@ -228,11 +222,11 @@ public:
///
unsigned getPrimitiveSizeInBits() const;
- /// getIntegralTypeMask - Return a bitmask with ones set for all of the bits
+ /// getIntegerTypeMask - Return a bitmask with ones set for all of the bits
/// that can be set by an unsigned version of this type. This is 0xFF for
/// sbyte/ubyte, 0xFFFF for shorts, etc.
- uint64_t getIntegralTypeMask() const {
- assert(isIntegral() && "This only works for integral types!");
+ uint64_t getIntegerTypeMask() const {
+ assert(isInteger() && "This only works for integer types!");
return ~uint64_t(0UL) >> (64-getPrimitiveSizeInBits());
}