[cfe-commits] r105664 - /cfe/trunk/include/clang/AST/Type.h
Tom Care
tcare at apple.com
Tue Jun 8 17:15:39 PDT 2010
Author: tcare
Date: Tue Jun 8 19:15:39 2010
New Revision: 105664
URL: http://llvm.org/viewvc/llvm-project?rev=105664&view=rev
Log:
Added helper function to Type class to determine if a type is a builtin type. This complements the existing function that determines if a type is a specific builtin type.
Modified:
include/clang/AST/Type.h
Modified:
cfe/trunk/include/clang/AST/Type.h
Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=105664&r1=105663&r2=105664&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Tue Jun 8 19:15:39 2010
@@ -835,6 +835,9 @@
/// 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 @@
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)
More information about the cfe-commits
mailing list