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 | 0319fc07fc0c746ea6a8a13c845da02475816045 (patch) | |
| tree | c4d01f06da2279c98cb541692d87e44a6214343e | |
| parent | cfe207c11213063c80075612c624d1222a77e030 (diff) | |
| download | bcm5719-llvm-0319fc07fc0c746ea6a8a13c845da02475816045.tar.gz bcm5719-llvm-0319fc07fc0c746ea6a8a13c845da02475816045.zip | |
Added "isFunctionPointerType()" so that we can readily see if a DeclRefExpr
refers to a function.
llvm-svn: 41795
| -rw-r--r-- | clang/include/clang/AST/Type.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index a047f32eba5..0a851693c61 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/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); } |

