aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Type.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-29 07:07:36 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-29 07:07:36 +0000
commitf5f7d864f5067d1ea4bff7fcf41b53a43b7b48ba (patch)
tree63fbd0c67662313316f86c364c4c35fb8ef09ee1 /lib/AST/Type.cpp
parentbd64729ac6de8fed320e7a722597cc5444709c63 (diff)
Get rid of FixedWidthIntType, as suggested by Chris and Eli.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92246 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r--lib/AST/Type.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index bed7f9b6c7..e0055f1878 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -387,8 +387,6 @@ bool Type::isIntegerType() const {
// FIXME: In C++, enum types are never integer types.
if (TT->getDecl()->isEnum() && TT->getDecl()->isDefinition())
return true;
- if (isa<FixedWidthIntType>(CanonicalType))
- return true;
if (const VectorType *VT = dyn_cast<VectorType>(CanonicalType))
return VT->getElementType()->isIntegerType();
return false;
@@ -397,13 +395,11 @@ bool Type::isIntegerType() const {
bool Type::isIntegralType() const {
if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
return BT->getKind() >= BuiltinType::Bool &&
- BT->getKind() <= BuiltinType::LongLong;
+ BT->getKind() <= BuiltinType::Int128;
if (const TagType *TT = dyn_cast<TagType>(CanonicalType))
if (TT->getDecl()->isEnum() && TT->getDecl()->isDefinition())
return true; // Complete enum types are integral.
// FIXME: In C++, enum types are never integral.
- if (isa<FixedWidthIntType>(CanonicalType))
- return true;
return false;
}
@@ -453,16 +449,12 @@ bool Type::isAnyCharacterType() const {
bool Type::isSignedIntegerType() const {
if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType)) {
return BT->getKind() >= BuiltinType::Char_S &&
- BT->getKind() <= BuiltinType::LongLong;
+ BT->getKind() <= BuiltinType::Int128;
}
if (const EnumType *ET = dyn_cast<EnumType>(CanonicalType))
return ET->getDecl()->getIntegerType()->isSignedIntegerType();
- if (const FixedWidthIntType *FWIT =
- dyn_cast<FixedWidthIntType>(CanonicalType))
- return FWIT->isSigned();
-
if (const VectorType *VT = dyn_cast<VectorType>(CanonicalType))
return VT->getElementType()->isSignedIntegerType();
return false;
@@ -481,10 +473,6 @@ bool Type::isUnsignedIntegerType() const {
if (const EnumType *ET = dyn_cast<EnumType>(CanonicalType))
return ET->getDecl()->getIntegerType()->isUnsignedIntegerType();
- if (const FixedWidthIntType *FWIT =
- dyn_cast<FixedWidthIntType>(CanonicalType))
- return !FWIT->isSigned();
-
if (const VectorType *VT = dyn_cast<VectorType>(CanonicalType))
return VT->getElementType()->isUnsignedIntegerType();
return false;
@@ -515,8 +503,6 @@ bool Type::isRealType() const {
BT->getKind() <= BuiltinType::LongDouble;
if (const TagType *TT = dyn_cast<TagType>(CanonicalType))
return TT->getDecl()->isEnum() && TT->getDecl()->isDefinition();
- if (isa<FixedWidthIntType>(CanonicalType))
- return true;
if (const VectorType *VT = dyn_cast<VectorType>(CanonicalType))
return VT->getElementType()->isRealType();
return false;
@@ -530,8 +516,6 @@ bool Type::isArithmeticType() const {
// GCC allows forward declaration of enum types (forbid by C99 6.7.2.3p2).
// If a body isn't seen by the time we get here, return false.
return ET->getDecl()->isDefinition();
- if (isa<FixedWidthIntType>(CanonicalType))
- return true;
return isa<ComplexType>(CanonicalType) || isa<VectorType>(CanonicalType);
}
@@ -545,8 +529,6 @@ bool Type::isScalarType() const {
return true;
return false;
}
- if (isa<FixedWidthIntType>(CanonicalType))
- return true;
return isa<PointerType>(CanonicalType) ||
isa<BlockPointerType>(CanonicalType) ||
isa<MemberPointerType>(CanonicalType) ||