diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-05-12 16:22:53 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-05-12 16:22:53 +0000 |
commit | 769c9cfc6e06bd9d8ffe7a4397b939f19b0e4dc3 (patch) | |
tree | a4d4f576d85d7b29b3c01c3449318af4cf03ce7d | |
parent | d28a80d64616b66c91d28bb4c08ca2d8c594de4e (diff) |
Add Type::getAsTypedefType().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50970 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/Type.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 8781ff309e..6586366625 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -49,6 +49,7 @@ namespace clang { class RecordType; class ComplexType; class TagType; + class TypedefType; class FunctionType; class ExtVectorType; class BuiltinType; @@ -338,7 +339,8 @@ public: const VariableArrayType *getAsVariableArrayType() const; const IncompleteArrayType *getAsIncompleteArrayType() const; const RecordType *getAsRecordType() const; - const RecordType *getAsStructureType() const; + const RecordType *getAsStructureType() const; + const TypedefType *getAsTypedefType() const; const RecordType *getAsUnionType() const; const VectorType *getAsVectorType() const; // GCC vector type. const ComplexType *getAsComplexType() const; @@ -350,7 +352,7 @@ public: /// getDesugaredType - Return the specified type with any "sugar" removed from - /// type type. This takes off typedefs, typeof's etc. If the outer level of + /// the type. This takes off typedefs, typeof's etc. If the outer level of /// the type is already concrete, it returns it unmodified. This is similar /// to getting the canonical type, but it doesn't remove *all* typedefs. For /// example, it returns "T*" as "T*", (not as "int*"), because the pointer is @@ -1215,6 +1217,10 @@ inline unsigned QualType::getAddressSpace() const { return 0; } +inline const TypedefType* Type::getAsTypedefType() const { + return dyn_cast<TypedefType>(this); +} + inline bool Type::isFunctionType() const { return isa<FunctionType>(CanonicalType.getUnqualifiedType()); } |