]> granicus.if.org Git - clang/commitdiff
Added "isFunctionPointerType()" so that we can readily see if a DeclRefExpr
authorTed Kremenek <kremenek@apple.com>
Mon, 10 Sep 2007 17:20:54 +0000 (17:20 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 10 Sep 2007 17:20:54 +0000 (17:20 +0000)
refers to a function.

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

include/clang/AST/Type.h

index a047f32eba5a78ac52e31c435fe70417ac1ec365..0a851693c616b9f898eb0d16846b8287546f88ea 100644 (file)
@@ -265,11 +265,12 @@ public:
   // type, ignoring typedefs.
   bool isFunctionType() const;
   bool isPointerType() const;
+  bool isFunctionPointerType() const;
   bool isReferenceType() const;
   bool isArrayType() const;
   bool isRecordType() const;
   bool isStructureType() const;   
-  bool isUnionType() const;
+  bool isUnionType() const;  
   bool isVectorType() const; // GCC vector type.
   bool isOCUVectorType() const; // OCU vector type.
   
@@ -868,6 +869,12 @@ inline bool Type::isFunctionType() const {
 inline bool Type::isPointerType() const {
   return isa<PointerType>(CanonicalType);
 }
+inline bool Type::isFunctionPointerType() const {
+  if (const PointerType* T = dyn_cast<PointerType>(this))
+    return T->getPointeeType()->isFunctionType();
+  else
+    return false;
+}
 inline bool Type::isReferenceType() const {
   return isa<ReferenceType>(CanonicalType);
 }