return isa<FunctionType>(CanonicalType);
}
-bool Type::isPointerType() const {
- return isa<PointerType>(CanonicalType);
+PointerType *Type::isPointerType() const {
+ if (PointerType *PTy = dyn_cast<PointerType>(CanonicalType))
+ return PTy;
+ return 0;
}
bool Type::isReferenceType() const {
return isa<ComplexType>(CanonicalType);
}
-bool Type::isVectorType() const {
- return isa<VectorType>(CanonicalType);
+VectorType *Type::isVectorType() const {
+ if (VectorType *VTy = dyn_cast<VectorType>(CanonicalType))
+ return VTy;
+ return 0;
}
bool Type::isArithmeticType() const {
class EnumDecl;
class Expr;
class SourceLocation;
+ class PointerType;
+ class VectorType;
/// QualType - For efficiency, we don't store CVR-qualified types as nodes on
/// their own: instead each reference to a type stores the qualifiers. This
bool isArithmeticType() const; // C99 6.2.5p18 (integer + floating)
/// Vector types
- bool isVectorType() const; // GCC vector type.
+ VectorType *isVectorType() const; // GCC vector type.
/// Derived types (C99 6.2.5p20). isFunctionType() is also a derived type.
bool isDerivedType() const;
- bool isPointerType() const;
+ PointerType *isPointerType() const;
bool isReferenceType() const;
bool isArrayType() const;
bool isStructureType() const;