From: John McCall Date: Wed, 6 Oct 2010 00:23:35 +0000 (+0000) Subject: Use a more conventional/efficient implementation for isEnumeralType() X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ff83dd534ccc828203670ce3f5125a4eb4199f8;p=clang Use a more conventional/efficient implementation for isEnumeralType() and isBuiltinType(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115724 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 9b32836a16..3cd60d3021 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -3541,9 +3541,15 @@ inline bool Type::isVariableArrayType() const { inline bool Type::isDependentSizedArrayType() const { return isa(CanonicalType); } +inline bool Type::isBuiltinType() const { + return isa(CanonicalType); +} inline bool Type::isRecordType() const { return isa(CanonicalType); } +inline bool Type::isEnumeralType() const { + return isa(CanonicalType); +} inline bool Type::isAnyComplexType() const { return isa(CanonicalType); } @@ -3596,10 +3602,6 @@ inline bool Type::isTemplateTypeParmType() const { return isa(CanonicalType); } -inline bool Type::isBuiltinType() const { - return getAs(); -} - inline bool Type::isSpecificBuiltinType(unsigned K) const { if (const BuiltinType *BT = getAs()) if (BT->getKind() == (BuiltinType::Kind) K) diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 8e6aa23618..61390c8539 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -470,12 +470,6 @@ bool Type::isIntegralOrEnumerationType() const { return false; } -bool Type::isEnumeralType() const { - if (const TagType *TT = dyn_cast(CanonicalType)) - return TT->getDecl()->isEnum(); - return false; -} - bool Type::isBooleanType() const { if (const BuiltinType *BT = dyn_cast(CanonicalType)) return BT->getKind() == BuiltinType::Bool;