diff options
author | Ted Kremenek <kremenek@apple.com> | 2007-09-10 17:20:54 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2007-09-10 17:20:54 +0000 |
commit | 498b0d1aba38f5ec64d566d1dd9e6be237ecc50f (patch) | |
tree | 174f53c03b71d6af20a9238f0035c7933e483314 | |
parent | b00c95eab9919ee1dd7805a0e6f2218129a9733e (diff) |
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
-rw-r--r-- | include/clang/AST/Type.h | 9 |
1 files changed, 8 insertions, 1 deletions
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<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); } |