From: Ted Kremenek Date: Mon, 10 Sep 2007 17:20:54 +0000 (+0000) Subject: Added "isFunctionPointerType()" so that we can readily see if a DeclRefExpr X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=498b0d1aba38f5ec64d566d1dd9e6be237ecc50f;p=clang Added "isFunctionPointerType()" so that we can readily see if a DeclRefExpr refers to a function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41795 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index a047f32eba..0a851693c6 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -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(CanonicalType); } +inline bool Type::isFunctionPointerType() const { + if (const PointerType* T = dyn_cast(this)) + return T->getPointeeType()->isFunctionType(); + else + return false; +} inline bool Type::isReferenceType() const { return isa(CanonicalType); }