]> granicus.if.org Git - clang/commitdiff
Added helper function to Type class to determine if a type is a builtin type. This...
authorTom Care <tcare@apple.com>
Wed, 9 Jun 2010 00:15:39 +0000 (00:15 +0000)
committerTom Care <tcare@apple.com>
Wed, 9 Jun 2010 00:15:39 +0000 (00:15 +0000)
Modified:
    include/clang/AST/Type.h

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

include/clang/AST/Type.h

index c24bddb300829ea086efa4f473c628b800eafba3..b5f0c47e7f5bfa5fcf1b305117b3e78158a3ee0f 100644 (file)
@@ -835,6 +835,9 @@ public:
   /// Helper methods to distinguish type categories. All type predicates
   /// operate on the canonical type, ignoring typedefs and qualifiers.
 
+  /// isBuiltinType - returns true if the type is a builtin type.
+  bool isBuiltinType() const;
+
   /// isSpecificBuiltinType - Test for a particular builtin type.
   bool isSpecificBuiltinType(unsigned K) const;
 
@@ -3454,6 +3457,10 @@ 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)