]> granicus.if.org Git - clang/commitdiff
Use a more conventional/efficient implementation for isEnumeralType()
authorJohn McCall <rjmccall@apple.com>
Wed, 6 Oct 2010 00:23:35 +0000 (00:23 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 6 Oct 2010 00:23:35 +0000 (00:23 +0000)
and isBuiltinType().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115724 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Type.h
lib/AST/Type.cpp

index 9b32836a1602fc0c94357d9122016861a1e15f5c..3cd60d30218db10bc6bb60ac68b735c28a967ed0 100644 (file)
@@ -3541,9 +3541,15 @@ inline bool Type::isVariableArrayType() const {
 inline bool Type::isDependentSizedArrayType() const {
   return isa<DependentSizedArrayType>(CanonicalType);
 }
+inline bool Type::isBuiltinType() const {
+  return isa<BuiltinType>(CanonicalType);
+}
 inline bool Type::isRecordType() const {
   return isa<RecordType>(CanonicalType);
 }
+inline bool Type::isEnumeralType() const {
+  return isa<EnumType>(CanonicalType);
+}
 inline bool Type::isAnyComplexType() const {
   return isa<ComplexType>(CanonicalType);
 }
@@ -3596,10 +3602,6 @@ inline bool Type::isTemplateTypeParmType() const {
   return isa<TemplateTypeParmType>(CanonicalType);
 }
 
-inline bool Type::isBuiltinType() const {
-  return getAs<BuiltinType>();
-}
-
 inline bool Type::isSpecificBuiltinType(unsigned K) const {
   if (const BuiltinType *BT = getAs<BuiltinType>())
     if (BT->getKind() == (BuiltinType::Kind) K)
index 8e6aa23618c5ee9fbdaf9da553096ac72984d3c6..61390c8539df02184d0a842beb2af09e0e00d36a 100644 (file)
@@ -470,12 +470,6 @@ bool Type::isIntegralOrEnumerationType() const {
   return false;  
 }
 
-bool Type::isEnumeralType() const {
-  if (const TagType *TT = dyn_cast<TagType>(CanonicalType))
-    return TT->getDecl()->isEnum();
-  return false;
-}
-
 bool Type::isBooleanType() const {
   if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType))
     return BT->getKind() == BuiltinType::Bool;