[cfe-commits] r50970 - /cfe/trunk/include/clang/AST/Type.h
Ted Kremenek
kremenek at apple.com
Mon May 12 09:22:53 PDT 2008
Author: kremenek
Date: Mon May 12 11:22:53 2008
New Revision: 50970
URL: http://llvm.org/viewvc/llvm-project?rev=50970&view=rev
Log:
Add Type::getAsTypedefType().
Modified:
cfe/trunk/include/clang/AST/Type.h
Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=50970&r1=50969&r2=50970&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Mon May 12 11:22:53 2008
@@ -49,6 +49,7 @@
class RecordType;
class ComplexType;
class TagType;
+ class TypedefType;
class FunctionType;
class ExtVectorType;
class BuiltinType;
@@ -338,7 +339,8 @@
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 @@
/// 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 @@
return 0;
}
+inline const TypedefType* Type::getAsTypedefType() const {
+ return dyn_cast<TypedefType>(this);
+}
+
inline bool Type::isFunctionType() const {
return isa<FunctionType>(CanonicalType.getUnqualifiedType());
}
More information about the cfe-commits
mailing list