clang 19.0.0git
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
Type.h File Reference

C Language Family Type Representation. More...

#include "clang/AST/DependenceFlags.h"
#include "clang/AST/NestedNameSpecifier.h"
#include "clang/AST/TemplateName.h"
#include "clang/Basic/AddressSpaces.h"
#include "clang/Basic/AttrKinds.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/ExceptionSpecificationType.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/Linkage.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/Specifiers.h"
#include "clang/Basic/Visibility.h"
#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/ErrorHandling.h"
#include "llvm/Support/PointerLikeTypeTraits.h"
#include "llvm/Support/TrailingObjects.h"
#include "llvm/Support/type_traits.h"
#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/AArch64SVEACLETypes.def"
#include "clang/Basic/PPCTypes.def"
#include "clang/Basic/RISCVVTypes.def"
#include "clang/Basic/WebAssemblyReferenceTypes.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::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::TypeWithKeywordBitfields
 
class  clang::Type::ElaboratedTypeBitfields
 
class  clang::Type::VectorTypeBitfields
 
class  clang::Type::AttributedTypeBitfields
 
class  clang::Type::AutoTypeBitfields
 
class  clang::Type::TypeOfBitfields
 
class  clang::Type::UsingBitfields
 
class  clang::Type::TypedefBitfields
 
class  clang::Type::SubstTemplateTypeParmTypeBitfields
 
class  clang::Type::SubstTemplateTypeParmPackTypeBitfields
 
class  clang::Type::TemplateSpecializationTypeBitfields
 
class  clang::Type::DependentTemplateSpecializationTypeBitfields
 
class  clang::Type::PackExpansionTypeBitfields
 
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::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::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::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::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...
 
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::TypeOfType
 Represents typeof(type), a C23 feature and GCC extension, or `typeof_unqual(type), a C23 feature. More...
 
class  clang::DecltypeType
 Represents the type decltype(expr) (C++11). More...
 
class  clang::DependentDecltypeType
 Internal representation of canonical, dependent decltype(expr) types. More...
 
class  clang::PackIndexingType
 
class  clang::UnaryTransformType
 A unary type transform, which is a type constructed from another. More...
 
class  clang::DependentUnaryTransformType
 Internal representation of canonical, dependent __underlying_type(type) types. More...
 
class  clang::TagType
 
class  clang::RecordType
 A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/classes. More...
 
class  clang::EnumType
 A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums. More...
 
class  clang::AttributedType
 An attributed type is a type to which a type attribute has been applied. More...
 
class  clang::BTFTagAttributedType
 
class  clang::TemplateTypeParmType
 
class  clang::SubstTemplateTypeParmType
 Represents the result of substituting a type for a template type parameter. More...
 
class  clang::SubstTemplateTypeParmPackType
 Represents the result of substituting a set of types for a template type parameter pack. More...
 
class  clang::DeducedType
 Common base class for placeholders for types that get replaced by placeholder type deduction: C++11 auto, C++14 decltype(auto), C++17 deduced class template types, and constrained type names. More...
 
class  clang::AutoType
 Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint. More...
 
class  clang::DeducedTemplateSpecializationType
 Represents a C++17 deduced template specialization type. More...
 
class  clang::TemplateSpecializationType
 Represents a type template specialization; the template must be a class template, a type alias template, or a template template parameter. More...
 
class  clang::InjectedClassNameType
 The injected class name of a C++ class template or class template partial specialization. More...
 
class  clang::TypeWithKeyword
 A helper class for Type nodes having an ElaboratedTypeKeyword. More...
 
class  clang::TypeWithKeyword::CannotCastToThisType
 
class  clang::ElaboratedType
 Represents a type that was referred to using an elaborated type keyword, e.g., struct S, or via a qualified name, e.g., N::M::type, or both. More...
 
class  clang::DependentNameType
 Represents a qualified type name for which the type name is dependent. More...
 
class  clang::DependentTemplateSpecializationType
 Represents a template specialization type whose template cannot be resolved, e.g. More...
 
class  clang::PackExpansionType
 Represents a pack expansion of types. More...
 
class  clang::ObjCProtocolQualifiers< T >
 This class wraps the list of protocol qualifiers. More...
 
class  clang::ObjCTypeParamType
 Represents a type parameter type in Objective C. More...
 
class  clang::ObjCObjectType
 Represents a class type in Objective C. More...
 
class  clang::ObjCObjectTypeImpl
 A class providing a concrete implementation of ObjCObjectType, so as to not increase the footprint of ObjCInterfaceType. More...
 
class  clang::ObjCInterfaceType
 Interfaces are the core concept in Objective-C for object oriented design. 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::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
 YAML serialization mapping.
 

Macros

#define TYPE(Class, Base)   class Class##Type;
 
#define TYPE(Class, Base)   Class,
 
#define LAST_TYPE(Class)   TypeLast = Class
 
#define ABSTRACT_TYPE(Class, Base)
 
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix)    bool is##Id##Type() const;
 
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext)    bool is##Id##Type() const;
 
#define TYPE(Class, Base)
 
#define LEAF_TYPE(Class)
 
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix)   Id,
 
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext)   Id,
 
#define SVE_TYPE(Name, Id, SingletonId)   Id,
 
#define PPC_VECTOR_TYPE(Name, Id, Size)   Id,
 
#define RVV_TYPE(Name, Id, SingletonId)   Id,
 
#define WASM_TYPE(Name, Id, SingletonId)   Id,
 
#define BUILTIN_TYPE(Id, SingletonId)   Id,
 
#define LAST_BUILTIN_TYPE(Id)   LastKind = Id
 
#define TRANSFORM_TYPE_TRAIT_DEF(Enum, _)   Enum,
 
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix)
 
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix)   is##Id##Type() ||
 
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext)
 
#define INTEL_SUBGROUP_AVC_TYPE(ExtType, Id)    isOCLIntelSubgroupAVC##Id##Type() ||
 
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext)   is##Id##Type() ||
 

Typedefs

template<typename T >
using clang::TypeIsArrayType = std::integral_constant< bool, std::is_same< T, ArrayType >::value||std::is_base_of< ArrayType, T >::value >
 

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
}
 
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)
 
void clang::printTemplateArgumentList (raw_ostream &OS, ArrayRef< TemplateArgument > Args, const PrintingPolicy &Policy, const TemplateParameterList *TPL=nullptr)
 Print a template argument list, including the '<' and '>' enclosing the template arguments.
 
void clang::printTemplateArgumentList (raw_ostream &OS, ArrayRef< TemplateArgumentLoc > Args, const PrintingPolicy &Policy, const TemplateParameterList *TPL=nullptr)
 
void clang::printTemplateArgumentList (raw_ostream &OS, const TemplateArgumentListInfo &Args, const PrintingPolicy &Policy, const TemplateParameterList *TPL=nullptr)
 
bool clang::isSubstitutedDefaultArgument (ASTContext &Ctx, TemplateArgument Arg, const NamedDecl *Param, ArrayRef< TemplateArgument > Args, unsigned Depth)
 Make a best-effort determination of whether the type T can be produced by substituting Args into the default argument of Param.
 
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)
 

Detailed Description

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 Type.h.

Macro Definition Documentation

◆ ABSTRACT_TYPE

#define ABSTRACT_TYPE (   Class,
  Base 
)

Definition at line 1611 of file Type.h.

◆ BUILTIN_TYPE

#define BUILTIN_TYPE (   Id,
  SingletonId 
)    Id,

Definition at line 2762 of file Type.h.

◆ EXT_OPAQUE_TYPE [1/4]

#define EXT_OPAQUE_TYPE (   ExtType,
  Id,
  Ext 
)     bool is##Id##Type() const;

Definition at line 7382 of file Type.h.

◆ EXT_OPAQUE_TYPE [2/4]

#define EXT_OPAQUE_TYPE (   ExtType,
  Id,
  Ext 
)    Id,

Definition at line 7382 of file Type.h.

◆ EXT_OPAQUE_TYPE [3/4]

#define EXT_OPAQUE_TYPE (   ExtType,
  Id,
  Ext 
)
Value:
inline bool Type::is##Id##Type() const { \
return isSpecificBuiltinType(BuiltinType::Id); \
}
int Id
Definition: ASTDiff.cpp:190
MatchType Type

Definition at line 7382 of file Type.h.

◆ EXT_OPAQUE_TYPE [4/4]

#define EXT_OPAQUE_TYPE (   ExtType,
  Id,
  Ext 
)    is##Id##Type() ||

Definition at line 7382 of file Type.h.

◆ IMAGE_TYPE [1/4]

#define IMAGE_TYPE (   ImgType,
  Id,
  SingletonId,
  Access,
  Suffix 
)     bool is##Id##Type() const;

Definition at line 7341 of file Type.h.

◆ IMAGE_TYPE [2/4]

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

Definition at line 7341 of file Type.h.

◆ 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 7341 of file Type.h.

◆ IMAGE_TYPE [4/4]

#define IMAGE_TYPE (   ImgType,
  Id,
  SingletonId,
  Access,
  Suffix 
)    is##Id##Type() ||

Definition at line 7341 of file Type.h.

◆ INTEL_SUBGROUP_AVC_TYPE

#define INTEL_SUBGROUP_AVC_TYPE (   ExtType,
  Id 
)     isOCLIntelSubgroupAVC##Id##Type() ||

◆ LAST_BUILTIN_TYPE

#define LAST_BUILTIN_TYPE (   Id)    LastKind = Id

Definition at line 2763 of file Type.h.

◆ LAST_TYPE

#define LAST_TYPE (   Class)    TypeLast = Class

Definition at line 1610 of file Type.h.

◆ LEAF_TYPE

#define LEAF_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 2729 of file Type.h.

◆ PPC_VECTOR_TYPE

#define PPC_VECTOR_TYPE (   Name,
  Id,
  Size 
)    Id,

Definition at line 2753 of file Type.h.

◆ RVV_TYPE

#define RVV_TYPE (   Name,
  Id,
  SingletonId 
)    Id,

Definition at line 2756 of file Type.h.

◆ SVE_TYPE

#define SVE_TYPE (   Name,
  Id,
  SingletonId 
)    Id,

Definition at line 2750 of file Type.h.

◆ TRANSFORM_TYPE_TRAIT_DEF

#define TRANSFORM_TYPE_TRAIT_DEF (   Enum,
 
)    Enum,

Definition at line 5012 of file Type.h.

◆ TYPE [1/3]

#define TYPE (   Class,
  Base 
)    class Class##Type;

Definition at line 2728 of file Type.h.

◆ TYPE [2/3]

#define TYPE (   Class,
  Base 
)    Class,

Definition at line 2728 of file Type.h.

◆ TYPE [3/3]

#define TYPE (   Class,
  Base 
)

Definition at line 2728 of file Type.h.

◆ WASM_TYPE

#define WASM_TYPE (   Name,
  Id,
  SingletonId 
)    Id,

Definition at line 2759 of file Type.h.