clang: include/clang/AST/TypeBase.h File Reference (original) (raw)

C Language Family Type Representation. More...

#include "[clang/AST/DependenceFlags.h](DependenceFlags%5F8h%5Fsource.html)"
#include "[clang/AST/NestedNameSpecifierBase.h](NestedNameSpecifierBase%5F8h%5Fsource.html)"
#include "[clang/AST/TemplateName.h](TemplateName%5F8h%5Fsource.html)"
#include "[clang/Basic/AddressSpaces.h](AddressSpaces%5F8h%5Fsource.html)"
#include "[clang/Basic/AttrKinds.h](AttrKinds%5F8h%5Fsource.html)"
#include "[clang/Basic/Diagnostic.h](Basic%5F2Diagnostic%5F8h%5Fsource.html)"
#include "[clang/Basic/ExceptionSpecificationType.h](ExceptionSpecificationType%5F8h%5Fsource.html)"
#include "[clang/Basic/LLVM.h](LLVM%5F8h%5Fsource.html)"
#include "[clang/Basic/LangOptions.h](LangOptions%5F8h%5Fsource.html)"
#include "[clang/Basic/Linkage.h](include%5F2clang%5F2Basic%5F2Linkage%5F8h%5Fsource.html)"
#include "[clang/Basic/PartialDiagnostic.h](PartialDiagnostic%5F8h%5Fsource.html)"
#include "[clang/Basic/PointerAuthOptions.h](PointerAuthOptions%5F8h%5Fsource.html)"
#include "[clang/Basic/SourceLocation.h](SourceLocation%5F8h%5Fsource.html)"
#include "[clang/Basic/Specifiers.h](Specifiers%5F8h%5Fsource.html)"
#include "[clang/Basic/Visibility.h](Visibility%5F8h%5Fsource.html)"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/PointerUnion.h"
#include "llvm/ADT/STLForwardCompat.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/DXILABI.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/PointerLikeTypeTraits.h"
#include "llvm/Support/TrailingObjects.h"
#include "llvm/Support/type_traits.h"
#include <bitset>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <optional>
#include <string>
#include <type_traits>
#include <utility>
#include "clang/AST/TypeNodes.inc"
#include "clang/Basic/OpenCLImageTypes.def"
#include "clang/Basic/OpenCLExtensionTypes.def"
#include "clang/Basic/HLSLIntangibleTypes.def"
#include "clang/Basic/AArch64ACLETypes.def"
#include "clang/Basic/PPCTypes.def"
#include "clang/Basic/RISCVVTypes.def"
#include "clang/Basic/WebAssemblyReferenceTypes.def"
#include "clang/Basic/AMDGPUTypes.def"
#include "clang/AST/BuiltinTypes.def"
#include "clang/Basic/TransformTypeTraits.def"

Go to the source code of this file.

Classes
struct llvm::PointerLikeTypeTraits< ::clang::Type * >
struct llvm::PointerLikeTypeTraits< ::clang::ExtQuals * >
class clang::PointerAuthQualifier
Pointer-authentication qualifiers. More...
class clang::Qualifiers
The collection of all-type qualifiers we support. More...
class clang::QualifiersAndAtomic
struct clang::SplitQualType
A std::pair-like structure for storing a qualified type split into its local qualifiers and its locally-unqualified type. More...
class clang::QualType
A (possibly-)qualified type. More...
class clang::QualType::StreamedQualTypeHelper
struct llvm::simplify_type< ::clang::QualType >
Implement simplify_type for QualType, so that we can dyn_cast from QualType to a specific Type class. More...
struct llvm::PointerLikeTypeTraits< clang::QualType >
class clang::ExtQualsTypeCommonBase
Base class that is common to both the ExtQuals and Type classes, which allows QualType to access the common fields between the two. More...
class clang::ExtQuals
We can encode up to four bits in the low bits of a type pointer, but there are many more type qualifiers that we want to be able to apply to an arbitrary type. More...
class clang::Type
The base class of the type hierarchy. More...
class clang::Type::ArrayTypeBitfields
class clang::Type::ConstantArrayTypeBitfields
class clang::Type::BuiltinTypeBitfields
class clang::Type::FunctionTypeBitfields
FunctionTypeBitfields store various bits belonging to FunctionProtoType. More...
class clang::Type::ObjCObjectTypeBitfields
class clang::Type::ReferenceTypeBitfields
class clang::Type::KeywordWrapperBitfields
class clang::Type::TagTypeBitfields
class clang::Type::VectorTypeBitfields
class clang::Type::AttributedTypeBitfields
class clang::Type::AutoTypeBitfields
class clang::Type::TypeOfBitfields
class clang::Type::UnresolvedUsingBitfields
class clang::Type::UsingBitfields
class clang::Type::TypedefBitfields
class clang::Type::TemplateTypeParmTypeBitfields
class clang::Type::SubstTemplateTypeParmTypeBitfields
class clang::Type::SubstPackTypeBitfields
class clang::Type::TemplateSpecializationTypeBitfields
class clang::Type::PackExpansionTypeBitfields
class clang::Type::PresefinedSugarTypeBitfields
class clang::Type::CountAttributedTypeBitfields
class clang::BuiltinType
This class is used for builtin types like 'int'. More...
class clang::ComplexType
Complex values, per C99 6.2.5p11. More...
class clang::ParenType
Sugar for parentheses used when specifying types. More...
class clang::PointerType
PointerType - C99 6.7.5.1 - Pointer Declarators. More...
class clang::TypeCoupledDeclRefInfo
[BoundsSafety] Represents information of declarations referenced by the arguments of the counted_by attribute and the likes. More...
class clang::BoundsAttributedType
[BoundsSafety] Represents a parent type class for CountAttributedType and similar sugar types that will be introduced to represent a type with a bounds attribute. More...
class clang::CountAttributedType
Represents a sugar type with __counted_by or __sized_by annotations, including their _or_null variants. More...
class clang::AdjustedType
Represents a type which was implicitly adjusted by the semantic engine for arbitrary reasons. More...
class clang::DecayedType
Represents a pointer type decayed from an array or function type. More...
class clang::BlockPointerType
Pointer to a block type. More...
class clang::ReferenceType
Base for LValueReferenceType and RValueReferenceType. More...
class clang::LValueReferenceType
An lvalue reference type, per C++11 [dcl.ref]. More...
class clang::RValueReferenceType
An rvalue reference type, per C++11 [dcl.ref]. More...
class clang::MemberPointerType
A pointer to member type per C++ 8.3.3 - Pointers to members. More...
class clang::ArrayType
Represents an array type, per C99 6.7.5.2 - Array Declarators. More...
class clang::ConstantArrayType
Represents the canonical version of C arrays with a specified constant size. More...
class clang::ArrayParameterType
Represents a constant array type that does not decay to a pointer when used as a function parameter. More...
class clang::IncompleteArrayType
Represents a C array with an unspecified size. More...
class clang::VariableArrayType
Represents a C array with a specified size that is not an integer-constant-expression. More...
class clang::DependentSizedArrayType
Represents an array type in C++ whose size is a value-dependent expression. More...
class clang::DependentAddressSpaceType
Represents an extended address space qualifier where the input address space value is dependent. More...
class clang::DependentSizedExtVectorType
Represents an extended vector type where either the type or size is dependent. More...
class clang::VectorType
Represents a GCC generic vector type. More...
class clang::DependentVectorType
Represents a vector type where either the type or size is dependent. More...
class clang::ExtVectorType
ExtVectorType - Extended vector type. More...
class clang::MatrixType
Represents a matrix type, as defined in the Matrix Types clang extensions. More...
class clang::ConstantMatrixType
Represents a concrete matrix type with constant number of rows and columns. More...
class clang::DependentSizedMatrixType
Represents a matrix type where the type and the number of rows and columns is dependent on a template. More...
class clang::FunctionType
FunctionType - C99 6.7.5.3 - Function Declarators. More...
class clang::FunctionType::ExtParameterInfo
Interesting information about a specific parameter that can't simply be reflected in parameter's type. More...
class clang::FunctionType::ExtInfo
A class which abstracts out some details necessary for making a call. More...
struct clang::FunctionType::ExceptionType
A simple holder for a QualType representing a type in an exception specification. More...
struct clang::FunctionType::FunctionTypeExtraBitfields
A simple holder for various uncommon bits which do not fit in FunctionTypeBitfields. More...
struct clang::FunctionType::FunctionTypeExtraAttributeInfo
A holder for extra information from attributes which aren't part of an AttributedType. More...
struct clang::FunctionType::FunctionTypeArmAttributes
A holder for Arm type attributes as described in the Arm C/C++ Language extensions which are not particularly common to all types and therefore accounted separately from FunctionTypeBitfields. More...
class clang::FunctionNoProtoType
Represents a K&R-style 'int foo()' function, which has no information available about its arguments. More...
class clang::FunctionEffect
Represents an abstract function effect, using just an enumeration describing its kind. More...
class clang::EffectConditionExpr
Wrap a function effect's condition expression in another struct so that FunctionProtoType's TrailingObjects can treat it separately. More...
struct clang::FunctionEffectWithCondition
A FunctionEffect plus a potential boolean expression determining whether the effect is declared (e.g. More...
class clang::FunctionEffectIterator< Container >
Support iteration in parallel through a pair of FunctionEffect and EffectConditionExpr containers. More...
class clang::FunctionEffectsRef
An immutable set of FunctionEffects and possibly conditions attached to them. More...
class clang::FunctionEffectKindSet
A mutable set of FunctionEffect::Kind. More...
class clang::FunctionEffectSet
A mutable set of FunctionEffects and possibly conditions attached to them. More...
struct clang::FunctionEffectSet::Conflict
class clang::FunctionProtoType
Represents a prototype with parameter type info, e.g. More...
struct clang::FunctionProtoType::ExceptionSpecInfo
Holds information about the various types of exception specification. More...
struct clang::FunctionProtoType::ExtProtoInfo
Extra information about a function prototype. More...
struct clang::KeywordHelpers
Provides a few static helpers for converting and printing elaborated type keyword and tag type kind enumerations. More...
class clang::KeywordWrapper< T >
class clang::KeywordWrapper< T >::CannotCastToThisType
class clang::TypeWithKeyword
A helper class for Type nodes having an ElaboratedTypeKeyword. More...
struct clang::FoldingSetPlaceholder< T >
class clang::UnresolvedUsingType
Represents the dependent type named by a dependently-scoped typename using declaration, e.g. More...
class clang::UsingType
class clang::TypedefType
class clang::MacroQualifiedType
Sugar type that represents a type that was qualified by a qualifier written as a macro invocation. More...
class clang::TypeOfExprType
Represents a typeof (or typeof) expression (a C23 feature and GCC extension) or a typeof_unqual expression (a C23 feature). More...
class clang::DependentTypeOfExprType
Internal representation of canonical, dependent typeof(expr) types. More...
class clang::ObjCInterfaceType
Represents typeof(type), a C23 feature and GCC extension, or `typeof_unqual(type), a C23 feature. More...
class clang::ObjCObjectPointerType
Represents a pointer to an Objective C object. More...
class clang::AtomicType
class clang::PipeType
PipeType - OpenCL20. More...
class clang::BitIntType
A fixed int type of a specified bitwidth. More...
class clang::DependentBitIntType
class clang::PredefinedSugarType
class clang::QualifierCollector
A qualifier set is used to build a set of qualifiers. More...
class clang::TypeSourceInfo
A container of type source information. More...
Namespaces
namespace clang
The JSON file list parser is used to communicate input to InstallAPI.
namespace clang::serialization
namespace llvm
Diagnostic wrappers for TextAPI types for error reporting.
Macros
#define TYPE(Class, Base)
#define TYPE(Class, Base)
#define LAST_TYPE(Class)
#define ABSTRACT_TYPE(Class, Base)
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix)
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext)
#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId)
#define TYPE(Class, Base)
#define NEVER_CANONICAL_TYPE(Class)
#define TYPE(Class, Base)
#define ALWAYS_CANONICAL_TYPE(Class)
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix)
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext)
#define SVE_TYPE(Name, Id, SingletonId)
#define PPC_VECTOR_TYPE(Name, Id, Size)
#define RVV_TYPE(Name, Id, SingletonId)
#define WASM_TYPE(Name, Id, SingletonId)
#define AMDGPU_TYPE(Name, Id, SingletonId, Width, Align)
#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId)
#define BUILTIN_TYPE(Id, SingletonId)
#define LAST_BUILTIN_TYPE(Id)
#define TRANSFORM_TYPE_TRAIT_DEF(Enum, _)
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix)
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix)
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext)
#define INTEL_SUBGROUP_AVC_TYPE(ExtType, Id)
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext)
#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId)
#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId)
Enumerations
enum { clang::TypeAlignmentInBits = 4 , clang::TypeAlignment = 1 << TypeAlignmentInBits }
enum class clang::ObjCSubstitutionContext { clang::Ordinary, clang::Result, clang::Parameter, clang::Property, clang::Superclass }
The kind of type we are substituting Objective-C type arguments into. More...
enum class clang::TypeOfKind : uint8_t { clang::Qualified, clang::Unqualified }
The kind of 'typeof' expression we're after. More...
enum clang::RefQualifierKind { clang::RQ_None = 0 , clang::RQ_LValue, clang::RQ_RValue }
The kind of C++11 ref-qualifier associated with a function type. More...
enum class clang::AutoTypeKeyword { clang::Auto, clang::DecltypeAuto, clang::GNUAutoType }
Which keyword(s) were used to create an AutoType. More...
enum class clang::ArraySizeModifier { clang::Normal, clang::Static, clang::Star }
Capture whether this is a normal array (e.g. More...
enum class clang::VectorKind { clang::Generic, clang::AltiVecVector, clang::AltiVecPixel, clang::AltiVecBool, clang::Neon, clang::NeonPoly, clang::SveFixedLengthData, clang::SveFixedLengthPredicate, clang::RVVFixedLengthData, clang::RVVFixedLengthMask, clang::RVVFixedLengthMask_1, clang::RVVFixedLengthMask_2, clang::RVVFixedLengthMask_4 }
enum class clang::ElaboratedTypeKeyword { clang::Struct, clang::Interface, clang::Union, clang::Class, clang::Enum, clang::Typename, clang::None }
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifier. More...
enum class clang::TagTypeKind { clang::Struct, clang::Interface, clang::Union, clang::Class, clang::Enum }
The kind of a tag type. More...
Functions
raw_ostream & clang::operator<< (raw_ostream &OS, QualType QT)
FunctionType::ExtInfo clang::getFunctionExtInfo (const Type &t)
FunctionType::ExtInfo clang::getFunctionExtInfo (QualType t)
bool clang::IsEnumDeclComplete (EnumDecl *ED)
Check if the given decl is complete.
bool clang::IsEnumDeclScoped (EnumDecl *ED)
Check if the given decl is scoped.
const StreamingDiagnostic & clang::operator<< (const StreamingDiagnostic &PD, LangAS AS)
Insertion operator for partial diagnostics.
const StreamingDiagnostic & clang::operator<< (const StreamingDiagnostic &PD, Qualifiers Q)
Insertion operator for partial diagnostics.
const StreamingDiagnostic & clang::operator<< (const StreamingDiagnostic &PD, QualType T)
Insertion operator for partial diagnostics.
void clang::FixedPointValueToString (SmallVectorImpl< char > &Str, llvm::APSInt Val, unsigned Scale)

C Language Family Type Representation.

This file defines the clang::Type interface and subclasses, used to represent types for languages in the C family.

Definition in file TypeBase.h.

ABSTRACT_TYPE

#define ABSTRACT_TYPE ( Class,
Base )

ALWAYS_CANONICAL_TYPE

#define ALWAYS_CANONICAL_TYPE ( Class )

Value:

template <> inline const Class##Type *Type::getAs() const { \

return dyn_cast<Class##Type>(CanonicalType); \

} \

template <> inline const Class##Type *Type::castAs() const { \

return cast<Class##Type>(CanonicalType); \

}

Definition at line 3154 of file TypeBase.h.

AMDGPU_TYPE

#define AMDGPU_TYPE ( Name,
Id,
SingletonId,
Width,
Align )

BUILTIN_TYPE

#define BUILTIN_TYPE ( Id,
SingletonId )

EXT_OPAQUE_TYPE [1/4]

#define EXT_OPAQUE_TYPE ( ExtType,
Id,
Ext )

Value:

bool is##Id##Type() const;

bool is(tok::TokenKind Kind) const

Definition at line 2721 of file TypeBase.h.

EXT_OPAQUE_TYPE [2/4]

#define EXT_OPAQUE_TYPE ( ExtType,
Id,
Ext )

EXT_OPAQUE_TYPE [3/4]

#define EXT_OPAQUE_TYPE ( ExtType,
Id,
Ext )

Value:

inline bool Type::is##Id##Type() const { \

return isSpecificBuiltinType(BuiltinType::Id); \

}

Definition at line 2721 of file TypeBase.h.

EXT_OPAQUE_TYPE [4/4]

#define EXT_OPAQUE_TYPE ( ExtType,
Id,
Ext )

HLSL_INTANGIBLE_TYPE [1/4]

#define HLSL_INTANGIBLE_TYPE ( Name,
Id,
SingletonId )

HLSL_INTANGIBLE_TYPE [2/4]

#define HLSL_INTANGIBLE_TYPE ( Name,
Id,
SingletonId )

HLSL_INTANGIBLE_TYPE [3/4]

#define HLSL_INTANGIBLE_TYPE ( Name,
Id,
SingletonId )

Value:

inline bool Type::is##Id##Type() const { \

return isSpecificBuiltinType(BuiltinType::Id); \

}

Definition at line 2732 of file TypeBase.h.

HLSL_INTANGIBLE_TYPE [4/4]

#define HLSL_INTANGIBLE_TYPE ( Name,
Id,
SingletonId )

IMAGE_TYPE [1/4]

#define IMAGE_TYPE ( ImgType,
Id,
SingletonId,
Access,
Suffix )

IMAGE_TYPE [2/4]

#define IMAGE_TYPE ( ImgType,
Id,
SingletonId,
Access,
Suffix )

IMAGE_TYPE [3/4]

#define IMAGE_TYPE ( ImgType,
Id,
SingletonId,
Access,
Suffix )

Value:

inline bool Type::is##Id##Type() const { \

return isSpecificBuiltinType(BuiltinType::Id); \

}

Definition at line 2709 of file TypeBase.h.

IMAGE_TYPE [4/4]

#define IMAGE_TYPE ( ImgType,
Id,
SingletonId,
Access,
Suffix )

INTEL_SUBGROUP_AVC_TYPE

#define INTEL_SUBGROUP_AVC_TYPE ( ExtType,
Id )

Value:

isOCLIntelSubgroupAVC##Id##Type() ||

LAST_BUILTIN_TYPE

#define LAST_BUILTIN_TYPE ( Id )

LAST_TYPE

#define LAST_TYPE ( Class )

NEVER_CANONICAL_TYPE

#define NEVER_CANONICAL_TYPE ( Class )

Value:

template <> inline const Class##Type *Type::getAsCanonical() const = delete; \

template <> inline const Class##Type *Type::castAsCanonical() const = delete;

Definition at line 2935 of file TypeBase.h.

PPC_VECTOR_TYPE

#define PPC_VECTOR_TYPE ( Name,
Id,
Size )

RVV_TYPE

#define RVV_TYPE ( Name,
Id,
SingletonId )

SVE_TYPE

#define SVE_TYPE ( Name,
Id,
SingletonId )

TRANSFORM_TYPE_TRAIT_DEF

#define TRANSFORM_TYPE_TRAIT_DEF ( Enum,
_ )

TYPE [1/4]

#define TYPE ( Class,
Base )

TYPE [2/4]

#define TYPE ( Class,
Base )

TYPE [3/4]

#define TYPE ( Class,
Base )

TYPE [4/4]

#define TYPE ( Class,
Base )

WASM_TYPE

#define WASM_TYPE ( Name,
Id,
SingletonId )