aboutsummaryrefslogtreecommitdiff
path: root/AST/Type.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'AST/Type.cpp')
-rw-r--r--AST/Type.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/AST/Type.cpp b/AST/Type.cpp
index f562376de6..02a90047da 100644
--- a/AST/Type.cpp
+++ b/AST/Type.cpp
@@ -315,6 +315,16 @@ bool Type::isIntegerType() const {
return false;
}
+bool Type::isIntegralType() const {
+ if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
+ return BT->getKind() >= BuiltinType::Bool &&
+ BT->getKind() <= BuiltinType::LongLong;
+ if (const TagType *TT = dyn_cast<TagType>(CanonicalType))
+ if (TT->getDecl()->getKind() == Decl::Enum)
+ return true;
+ return false;
+}
+
bool Type::isEnumeralType() const {
if (const TagType *TT = dyn_cast<TagType>(CanonicalType))
return TT->getDecl()->getKind() == Decl::Enum;