Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/include/clang/AST/Type.h
Show First 20 Lines • Show All 2,104 Lines • ▼ Show 20 Lines | public: | ||||
bool isAtomicType() const; // C11 _Atomic() | bool isAtomicType() const; // C11 _Atomic() | ||||
bool isUndeducedAutoType() const; // C++11 auto or | bool isUndeducedAutoType() const; // C++11 auto or | ||||
// C++14 decltype(auto) | // C++14 decltype(auto) | ||||
bool isTypedefNameType() const; // typedef or alias template | bool isTypedefNameType() const; // typedef or alias template | ||||
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ | #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ | ||||
bool is##Id##Type() const; | bool is##Id##Type() const; | ||||
#include "clang/Basic/OpenCLImageTypes.def" | #include "clang/Basic/OpenCLImageTypes.def" | ||||
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ | |||||
bool isSampled##Id##Type() const; | |||||
#define IMAGE_WRITE_TYPE(Type, Id, Ext) | |||||
#define IMAGE_READ_WRITE_TYPE(Type, Id, Ext) | |||||
#include "clang/Basic/OpenCLImageTypes.def" | |||||
bool isImageType() const; // Any OpenCL image type | bool isImageType() const; // Any OpenCL image type | ||||
bool isSampledImageType() const; // Any SPIR-V Sampled image type | |||||
bool isSamplerT() const; // OpenCL sampler_t | bool isSamplerT() const; // OpenCL sampler_t | ||||
bool isEventT() const; // OpenCL event_t | bool isEventT() const; // OpenCL event_t | ||||
bool isClkEventT() const; // OpenCL clk_event_t | bool isClkEventT() const; // OpenCL clk_event_t | ||||
bool isQueueT() const; // OpenCL queue_t | bool isQueueT() const; // OpenCL queue_t | ||||
bool isReserveIDT() const; // OpenCL reserve_id_t | bool isReserveIDT() const; // OpenCL reserve_id_t | ||||
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \ | #define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \ | ||||
▲ Show 20 Lines • Show All 367 Lines • ▼ Show 20 Lines | |||||
/// This class is used for builtin types like 'int'. Builtin | /// This class is used for builtin types like 'int'. Builtin | ||||
/// types are always canonical and have a literal name field. | /// types are always canonical and have a literal name field. | ||||
class BuiltinType : public Type { | class BuiltinType : public Type { | ||||
public: | public: | ||||
enum Kind { | enum Kind { | ||||
// OpenCL image types | // OpenCL image types | ||||
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) Id, | #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) Id, | ||||
#include "clang/Basic/OpenCLImageTypes.def" | #include "clang/Basic/OpenCLImageTypes.def" | ||||
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) Sampled##Id, | |||||
#define IMAGE_WRITE_TYPE(Type, Id, Ext) | |||||
#define IMAGE_READ_WRITE_TYPE(Type, Id, Ext) | |||||
#include "clang/Basic/OpenCLImageTypes.def" | |||||
// OpenCL extension types | // OpenCL extension types | ||||
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) Id, | #define EXT_OPAQUE_TYPE(ExtType, Id, Ext) Id, | ||||
#include "clang/Basic/OpenCLExtensionTypes.def" | #include "clang/Basic/OpenCLExtensionTypes.def" | ||||
// SVE Types | // SVE Types | ||||
#define SVE_TYPE(Name, Id, SingletonId) Id, | #define SVE_TYPE(Name, Id, SingletonId) Id, | ||||
#include "clang/Basic/AArch64SVEACLETypes.def" | #include "clang/Basic/AArch64SVEACLETypes.def" | ||||
// PPC MMA Types | // PPC MMA Types | ||||
#define PPC_VECTOR_TYPE(Name, Id, Size) Id, | #define PPC_VECTOR_TYPE(Name, Id, Size) Id, | ||||
▲ Show 20 Lines • Show All 4,353 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ | #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ | ||||
inline bool Type::is##Id##Type() const { \ | inline bool Type::is##Id##Type() const { \ | ||||
return isSpecificBuiltinType(BuiltinType::Id); \ | return isSpecificBuiltinType(BuiltinType::Id); \ | ||||
} | } | ||||
#include "clang/Basic/OpenCLImageTypes.def" | #include "clang/Basic/OpenCLImageTypes.def" | ||||
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ | |||||
inline bool Type::isSampled##Id##Type() const { \ | |||||
return isSpecificBuiltinType(BuiltinType::Sampled##Id); \ | |||||
} | |||||
#define IMAGE_WRITE_TYPE(Type, Id, Ext) | |||||
#define IMAGE_READ_WRITE_TYPE(Type, Id, Ext) | |||||
#include "clang/Basic/OpenCLImageTypes.def" | |||||
inline bool Type::isSamplerT() const { | inline bool Type::isSamplerT() const { | ||||
return isSpecificBuiltinType(BuiltinType::OCLSampler); | return isSpecificBuiltinType(BuiltinType::OCLSampler); | ||||
} | } | ||||
inline bool Type::isEventT() const { | inline bool Type::isEventT() const { | ||||
return isSpecificBuiltinType(BuiltinType::OCLEvent); | return isSpecificBuiltinType(BuiltinType::OCLEvent); | ||||
} | } | ||||
inline bool Type::isClkEventT() const { | inline bool Type::isClkEventT() const { | ||||
return isSpecificBuiltinType(BuiltinType::OCLClkEvent); | return isSpecificBuiltinType(BuiltinType::OCLClkEvent); | ||||
} | } | ||||
inline bool Type::isQueueT() const { | inline bool Type::isQueueT() const { | ||||
return isSpecificBuiltinType(BuiltinType::OCLQueue); | return isSpecificBuiltinType(BuiltinType::OCLQueue); | ||||
} | } | ||||
inline bool Type::isReserveIDT() const { | inline bool Type::isReserveIDT() const { | ||||
return isSpecificBuiltinType(BuiltinType::OCLReserveID); | return isSpecificBuiltinType(BuiltinType::OCLReserveID); | ||||
} | } | ||||
inline bool Type::isImageType() const { | inline bool Type::isImageType() const { | ||||
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) is##Id##Type() || | #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) is##Id##Type() || | ||||
return isSampledImageType() || | |||||
#include "clang/Basic/OpenCLImageTypes.def" | |||||
false; // end boolean or operation | |||||
} | |||||
inline bool Type::isSampledImageType() const { | |||||
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ | |||||
isSampled##Id##Type() || | |||||
return | return | ||||
#define IMAGE_WRITE_TYPE(Type, Id, Ext) | |||||
#define IMAGE_READ_WRITE_TYPE(Type, Id, Ext) | |||||
#include "clang/Basic/OpenCLImageTypes.def" | #include "clang/Basic/OpenCLImageTypes.def" | ||||
false; // end boolean or operation | false; // end boolean or operation | ||||
} | } | ||||
inline bool Type::isPipeType() const { | inline bool Type::isPipeType() const { | ||||
return isa<PipeType>(CanonicalType); | return isa<PipeType>(CanonicalType); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 373 Lines • Show Last 20 Lines |