clang 19.0.0git
Macros | Enumerations | Functions
SemaType.cpp File Reference
#include "TypeLocBuilder.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTMutationListener.h"
#include "clang/AST/ASTStructuralEquivalence.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/AST/Type.h"
#include "clang/AST/TypeLoc.h"
#include "clang/AST/TypeLocVisitor.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/Specifiers.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/DeclSpec.h"
#include "clang/Sema/DelayedDiagnostic.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/ParsedTemplate.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/SemaCUDA.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/SemaObjC.h"
#include "clang/Sema/SemaOpenMP.h"
#include "clang/Sema/Template.h"
#include "clang/Sema/TemplateInstCallback.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLForwardCompat.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include <bitset>
#include <optional>
#include "clang/Basic/TransformTypeTraits.def"
#include "clang/Basic/OpenCLImageTypes.def"

Go to the source code of this file.

Macros

#define OBJC_POINTER_TYPE_ATTRS_CASELIST
 
#define CALLING_CONV_ATTRS_CASELIST
 
#define FUNCTION_TYPE_ATTRS_CASELIST
 
#define MS_TYPE_ATTRS_CASELIST
 
#define NULLABILITY_TYPE_ATTRS_CASELIST
 
#define TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait)
 
#define TRANSFORM_TYPE_TRAIT_DEF(_, Trait)   case DeclSpec::TST_##Trait:
 
#define GENERIC_IMAGE_TYPE(ImgType, Id)
 
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix)
 

Enumerations

enum  TypeDiagSelector { TDS_Function , TDS_Pointer , TDS_ObjCObjOrBlock }
 
enum  TypeAttrLocation { TAL_DeclSpec , TAL_DeclChunk , TAL_DeclName }
 The location of a type attribute. More...
 

Functions

static bool isOmittedBlockReturnType (const Declarator &D)
 isOmittedBlockReturnType - Return true if this declarator is missing a return type because this is a omitted return type on a block literal.
 
static void diagnoseBadTypeAttribute (Sema &S, const ParsedAttr &attr, QualType type)
 diagnoseBadTypeAttribute - Diagnoses a type attribute which doesn't apply to the given type.
 
static void moveAttrFromListToList (ParsedAttr &attr, ParsedAttributesView &fromList, ParsedAttributesView &toList)
 
static void processTypeAttrs (TypeProcessingState &state, QualType &type, TypeAttrLocation TAL, const ParsedAttributesView &attrs, CUDAFunctionTarget CFT=CUDAFunctionTarget::HostDevice)
 
static bool handleFunctionTypeAttr (TypeProcessingState &state, ParsedAttr &attr, QualType &type, CUDAFunctionTarget CFT)
 Process an individual function attribute.
 
static bool handleMSPointerTypeQualifierAttr (TypeProcessingState &state, ParsedAttr &attr, QualType &type)
 
static bool handleObjCGCTypeAttr (TypeProcessingState &state, ParsedAttr &attr, QualType &type)
 handleObjCGCTypeAttr - Process the attribute((objc_gc)) type attribute on the specified type.
 
static bool handleObjCOwnershipTypeAttr (TypeProcessingState &state, ParsedAttr &attr, QualType &type)
 handleObjCOwnershipTypeAttr - Process an objc_ownership attribute on the specified type.
 
static bool handleObjCPointerTypeAttr (TypeProcessingState &state, ParsedAttr &attr, QualType &type)
 
static DeclaratorChunkmaybeMovePastReturnType (Declarator &declarator, unsigned i, bool onlyBlockPointers)
 Given the index of a declarator chunk, check whether that chunk directly specifies the return type of a function and, if so, find an appropriate place for it.
 
static void distributeObjCPointerTypeAttr (TypeProcessingState &state, ParsedAttr &attr, QualType type)
 Given that an objc_gc attribute was written somewhere on a declaration other than on the declarator itself (for which, use distributeObjCPointerTypeAttrFromDeclarator), and given that it didn't apply in whatever position it was written in, try to move it to a more appropriate position.
 
static void distributeObjCPointerTypeAttrFromDeclarator (TypeProcessingState &state, ParsedAttr &attr, QualType &declSpecType)
 Distribute an objc_gc type attribute that was written on the declarator.
 
static void distributeFunctionTypeAttr (TypeProcessingState &state, ParsedAttr &attr, QualType type)
 A function type attribute was written somewhere in a declaration other than on the declarator itself or in the decl spec.
 
static bool distributeFunctionTypeAttrToInnermost (TypeProcessingState &state, ParsedAttr &attr, ParsedAttributesView &attrList, QualType &declSpecType, CUDAFunctionTarget CFT)
 Try to distribute a function type attribute to the innermost function chunk or type.
 
static void distributeFunctionTypeAttrFromDeclSpec (TypeProcessingState &state, ParsedAttr &attr, QualType &declSpecType, CUDAFunctionTarget CFT)
 A function type attribute was written in the decl spec.
 
static void distributeFunctionTypeAttrFromDeclarator (TypeProcessingState &state, ParsedAttr &attr, QualType &declSpecType, CUDAFunctionTarget CFT)
 A function type attribute was written on the declarator or declaration.
 
static void distributeTypeAttrsFromDeclarator (TypeProcessingState &state, QualType &declSpecType, CUDAFunctionTarget CFT)
 Given that there are attributes written on the declarator or declaration itself, try to distribute any type attributes to the appropriate declarator chunk.
 
static void maybeSynthesizeBlockSignature (TypeProcessingState &state, QualType declSpecType)
 Add a synthetic '()' to a block-literal declarator if it is required, given the return type.
 
static void diagnoseAndRemoveTypeQualifiers (Sema &S, const DeclSpec &DS, unsigned &TypeQuals, QualType TypeSoFar, unsigned RemoveTQs, unsigned DiagID)
 
static bool checkOmittedBlockReturnType (Sema &S, Declarator &declarator, QualType Result)
 Return true if this is omitted block return type.
 
static OpenCLAccessAttr::Spelling getImageAccess (const ParsedAttributesView &Attrs)
 
static UnaryTransformType::UTTKind TSTToUnaryTransformType (DeclSpec::TST SwitchTST)
 
static QualType ConvertDeclSpecToType (TypeProcessingState &state)
 Convert the specified declspec to the appropriate type object.
 
static std::string getPrintableNameForEntity (DeclarationName Entity)
 
static bool isDependentOrGNUAutoType (QualType T)
 
static QualType inferARCLifetimeForPointee (Sema &S, QualType type, SourceLocation loc, bool isReference)
 Given that we're building a pointer or reference to the given.
 
static std::string getFunctionQualifiersAsString (const FunctionProtoType *FnTy)
 
static bool checkQualifiedFunction (Sema &S, QualType T, SourceLocation Loc, QualifiedFunctionKind QFK)
 Check whether the type T is a qualified function type, and if it is, diagnose that it cannot be contained within the given kind of declarator.
 
static QualType deduceOpenCLPointeeAddrSpace (Sema &S, QualType PointeeType)
 
static ExprResult checkArraySize (Sema &S, Expr *&ArraySize, llvm::APSInt &SizeVal, unsigned VLADiag, bool VLAIsError)
 Check whether the specified array bound can be evaluated using the relevant language rules.
 
static void checkExtParameterInfos (Sema &S, ArrayRef< QualType > paramTypes, const FunctionProtoType::ExtProtoInfo &EPI, llvm::function_ref< SourceLocation(unsigned)> getParamLoc)
 Check the extended parameter information.
 
static void transferARCOwnershipToDeclaratorChunk (TypeProcessingState &state, Qualifiers::ObjCLifetime ownership, unsigned chunkIndex)
 
static void inferARCWriteback (TypeProcessingState &state, QualType &declSpecType)
 Given that this is the declaration of a parameter under ARC, attempt to infer attributes and such for pointer-to-whatever types.
 
static void diagnoseRedundantReturnTypeQualifiers (Sema &S, QualType RetTy, Declarator &D, unsigned FunctionChunkIndex)
 
static std::pair< QualType, TypeSourceInfo * > InventTemplateParameter (TypeProcessingState &state, QualType T, TypeSourceInfo *TrailingTSI, AutoType *Auto, InventedTemplateParameterInfo &Info)
 
static TypeSourceInfoGetTypeSourceInfoForDeclarator (TypeProcessingState &State, QualType T, TypeSourceInfo *ReturnTypeInfo)
 Create and instantiate a TypeSourceInfo with type source information.
 
static QualType GetDeclSpecTypeForDeclarator (TypeProcessingState &state, TypeSourceInfo *&ReturnTypeInfo)
 
static void warnAboutAmbiguousFunction (Sema &S, Declarator &D, DeclaratorChunk &DeclType, QualType RT)
 Produce an appropriate diagnostic for an ambiguity between a function declarator and a C++ direct-initializer.
 
static void warnAboutRedundantParens (Sema &S, Declarator &D, QualType T)
 Produce an appropriate diagnostic for a declarator with top-level parentheses.
 
static CallingConv getCCForDeclaratorChunk (Sema &S, Declarator &D, const ParsedAttributesView &AttrList, const DeclaratorChunk::FunctionTypeInfo &FTI, unsigned ChunkIndex)
 Helper for figuring out the default CC for a function declarator type.
 
static bool hasNullabilityAttr (const ParsedAttributesView &attrs)
 Check whether there is a nullability attribute of any kind in the given attribute list.
 
static PointerDeclaratorKind classifyPointerDeclarator (Sema &S, QualType type, Declarator &declarator, PointerWrappingDeclaratorKind &wrappingKind)
 Classify the given declarator, whose type-specified is type, based on what kind of pointer it refers to.
 
static FileID getNullabilityCompletenessCheckFileID (Sema &S, SourceLocation loc)
 
template<typename DiagBuilderT >
static void fixItNullability (Sema &S, DiagBuilderT &Diag, SourceLocation PointerLoc, NullabilityKind Nullability)
 Creates a fix-it to insert a C-style nullability keyword at pointerLoc, taking into account whitespace before and after.
 
static void emitNullabilityConsistencyWarning (Sema &S, SimplePointerKind PointerKind, SourceLocation PointerLoc, SourceLocation PointerEndLoc)
 
static void checkNullabilityConsistency (Sema &S, SimplePointerKind pointerKind, SourceLocation pointerLoc, SourceLocation pointerEndLoc=SourceLocation())
 Complains about missing nullability if the file containing pointerLoc has other uses of nullability (either the keywords or the assume_nonnull pragma).
 
static void recordNullabilitySeen (Sema &S, SourceLocation loc)
 Marks that a nullability feature has been used in the file containing loc.
 
static bool hasOuterPointerLikeChunk (const Declarator &D, unsigned endIndex)
 Returns true if any of the declarator chunks before endIndex include a level of indirection: array, pointer, reference, or pointer-to-member.
 
static bool IsNoDerefableChunk (const DeclaratorChunk &Chunk)
 
template<typename AttrT >
static AttrT * createSimpleAttr (ASTContext &Ctx, ParsedAttr &AL)
 
static AttrcreateNullabilityAttr (ASTContext &Ctx, ParsedAttr &Attr, NullabilityKind NK)
 
static bool DiagnoseMultipleAddrSpaceAttributes (Sema &S, LangAS ASOld, LangAS ASNew, SourceLocation AttrLoc)
 
static bool shouldHaveNullability (QualType T)
 
static TypeSourceInfoGetFullTypeForDeclarator (TypeProcessingState &state, QualType declSpecType, TypeSourceInfo *TInfo)
 
static void transferARCOwnershipToDeclSpec (Sema &S, QualType &declSpecTy, Qualifiers::ObjCLifetime ownership)
 
static void transferARCOwnership (TypeProcessingState &state, QualType &declSpecTy, Qualifiers::ObjCLifetime ownership)
 Used for transferring ownership in casts resulting in l-values.
 
static void fillAttributedTypeLoc (AttributedTypeLoc TL, TypeProcessingState &State)
 
static void fillMatrixTypeLoc (MatrixTypeLoc MTL, const ParsedAttributesView &Attrs)
 
static void fillAtomicQualLoc (AtomicTypeLoc ATL, const DeclaratorChunk &Chunk)
 
static void fillDependentAddressSpaceTypeLoc (DependentAddressSpaceTypeLoc DASTL, const ParsedAttributesView &Attrs)
 
static bool BuildAddressSpaceIndex (Sema &S, LangAS &ASIdx, const Expr *AddrSpace, SourceLocation AttrLoc)
 Build an AddressSpace index from a constant expression and diagnose any errors related to invalid address_spaces.
 
static void HandleBTFTypeTagAttribute (QualType &Type, const ParsedAttr &Attr, TypeProcessingState &State)
 
static void HandleAddressSpaceTypeAttribute (QualType &Type, const ParsedAttr &Attr, TypeProcessingState &State)
 HandleAddressSpaceTypeAttribute - Process an address_space attribute on the specified type.
 
static bool HandleWebAssemblyFuncrefAttr (TypeProcessingState &State, QualType &QT, ParsedAttr &PAttr)
 
static QualType rebuildAttributedTypeWithoutNullability (ASTContext &Ctx, QualType Type)
 Rebuild an attributed type without the nullability attribute on it.
 
static NullabilityKind mapNullabilityAttrKind (ParsedAttr::Kind kind)
 Map a nullability attribute kind to a nullability kind.
 
static bool CheckNullabilityTypeSpecifier (Sema &S, TypeProcessingState *State, ParsedAttr *PAttr, QualType &QT, NullabilityKind Nullability, SourceLocation NullabilityLoc, bool IsContextSensitive, bool AllowOnArrayType, bool OverrideExisting)
 
static bool CheckNullabilityTypeSpecifier (TypeProcessingState &State, QualType &Type, ParsedAttr &Attr, bool AllowOnArrayType)
 
static bool checkObjCKindOfType (TypeProcessingState &state, QualType &type, ParsedAttr &attr)
 Check the application of the Objective-C '__kindof' qualifier to the given type.
 
static bool distributeNullabilityTypeAttr (TypeProcessingState &state, QualType type, ParsedAttr &attr)
 Distribute a nullability type attribute that cannot be applied to the type specifier to a pointer, block pointer, or member pointer declarator, complaining if necessary.
 
static AttrgetCCTypeAttr (ASTContext &Ctx, ParsedAttr &Attr)
 
static bool checkMutualExclusion (TypeProcessingState &state, const FunctionProtoType::ExtProtoInfo &EPI, ParsedAttr &Attr, AttributeCommonInfo::Kind OtherKind)
 
static bool handleArmStateAttribute (Sema &S, FunctionProtoType::ExtProtoInfo &EPI, ParsedAttr &Attr, FunctionType::ArmStateValue State)
 
static void HandleVectorSizeAttr (QualType &CurType, const ParsedAttr &Attr, Sema &S)
 HandleVectorSizeAttribute - this attribute is only applicable to integral and float scalars, although arrays, pointers, and function return values are allowed in conjunction with this construct.
 
static void HandleExtVectorTypeAttr (QualType &CurType, const ParsedAttr &Attr, Sema &S)
 Process the OpenCL-like ext_vector_type attribute when it occurs on a type.
 
static bool isPermittedNeonBaseType (QualType &Ty, VectorKind VecKind, Sema &S)
 
static bool verifyValidIntegerConstantExpr (Sema &S, const ParsedAttr &Attr, llvm::APSInt &Result)
 
static void HandleNeonVectorTypeAttr (QualType &CurType, const ParsedAttr &Attr, Sema &S, VectorKind VecKind)
 HandleNeonVectorTypeAttr - The "neon_vector_type" and "neon_polyvector_type" attributes are used to create vector types that are mangled according to ARM's ABI.
 
static void HandleArmSveVectorBitsTypeAttr (QualType &CurType, ParsedAttr &Attr, Sema &S)
 HandleArmSveVectorBitsTypeAttr - The "arm_sve_vector_bits" attribute is used to create fixed-length versions of sizeless SVE types defined by the ACLE, such as svint32_t and svbool_t.
 
static void HandleArmMveStrictPolymorphismAttr (TypeProcessingState &State, QualType &CurType, ParsedAttr &Attr)
 
static void HandleRISCVRVVVectorBitsTypeAttr (QualType &CurType, ParsedAttr &Attr, Sema &S)
 HandleRISCVRVVVectorBitsTypeAttr - The "riscv_rvv_vector_bits" attribute is used to create fixed-length versions of sizeless RVV types such as vint8m1_t_t.
 
static void HandleOpenCLAccessAttr (QualType &CurType, const ParsedAttr &Attr, Sema &S)
 Handle OpenCL Access Qualifier Attribute.
 
static void HandleMatrixTypeAttr (QualType &CurType, const ParsedAttr &Attr, Sema &S)
 HandleMatrixTypeAttr - "matrix_type" attribute, like ext_vector_type.
 
static void HandleAnnotateTypeAttr (TypeProcessingState &State, QualType &CurType, const ParsedAttr &PA)
 
static void HandleLifetimeBoundAttr (TypeProcessingState &State, QualType &CurType, ParsedAttr &Attr)
 
static void HandleHLSLParamModifierAttr (QualType &CurType, const ParsedAttr &Attr, Sema &S)
 
static void assignInheritanceModel (Sema &S, CXXRecordDecl *RD)
 Locks in the inheritance model for the given class and all of its bases.
 
static unsigned getLiteralDiagFromTagKind (TagTypeKind Tag)
 Get diagnostic select index for tag kind for literal type diagnostic message.
 
static void BuildTypeCoupledDecls (Expr *E, llvm::SmallVectorImpl< TypeCoupledDeclRefInfo > &Decls)
 
static QualType GetEnumUnderlyingType (Sema &S, QualType BaseType, SourceLocation Loc)
 
static QualType ChangeIntegralSignedness (Sema &S, QualType BaseType, bool IsMakeSigned, SourceLocation Loc)
 

Macro Definition Documentation

◆ CALLING_CONV_ATTRS_CASELIST

#define CALLING_CONV_ATTRS_CASELIST
Value:
case ParsedAttr::AT_CDecl: \
case ParsedAttr::AT_FastCall: \
case ParsedAttr::AT_StdCall: \
case ParsedAttr::AT_ThisCall: \
case ParsedAttr::AT_RegCall: \
case ParsedAttr::AT_Pascal: \
case ParsedAttr::AT_SwiftCall: \
case ParsedAttr::AT_SwiftAsyncCall: \
case ParsedAttr::AT_VectorCall: \
case ParsedAttr::AT_AArch64VectorPcs: \
case ParsedAttr::AT_AArch64SVEPcs: \
case ParsedAttr::AT_AMDGPUKernelCall: \
case ParsedAttr::AT_MSABI: \
case ParsedAttr::AT_SysVABI: \
case ParsedAttr::AT_Pcs: \
case ParsedAttr::AT_IntelOclBicc: \
case ParsedAttr::AT_PreserveMost: \
case ParsedAttr::AT_PreserveAll: \
case ParsedAttr::AT_M68kRTD: \
case ParsedAttr::AT_PreserveNone: \
case ParsedAttr::AT_RISCVVectorCC

Definition at line 125 of file SemaType.cpp.

◆ FUNCTION_TYPE_ATTRS_CASELIST

#define FUNCTION_TYPE_ATTRS_CASELIST
Value:
case ParsedAttr::AT_NSReturnsRetained: \
case ParsedAttr::AT_NoReturn: \
case ParsedAttr::AT_Regparm: \
case ParsedAttr::AT_CmseNSCall: \
case ParsedAttr::AT_ArmStreaming: \
case ParsedAttr::AT_ArmStreamingCompatible: \
case ParsedAttr::AT_ArmPreserves: \
case ParsedAttr::AT_ArmIn: \
case ParsedAttr::AT_ArmOut: \
case ParsedAttr::AT_ArmInOut: \
case ParsedAttr::AT_AnyX86NoCallerSavedRegisters: \
case ParsedAttr::AT_AnyX86NoCfCheck: \
#define CALLING_CONV_ATTRS_CASELIST
Definition: SemaType.cpp:125

Definition at line 149 of file SemaType.cpp.

◆ GENERIC_IMAGE_TYPE

#define GENERIC_IMAGE_TYPE (   ImgType,
  Id 
)
Value:
case DeclSpec::TST_##ImgType##_t: \
switch (getImageAccess(DS.getAttributes())) { \
case OpenCLAccessAttr::Keyword_write_only: \
Result = Context.Id##WOTy; \
break; \
case OpenCLAccessAttr::Keyword_read_write: \
Result = Context.Id##RWTy; \
break; \
case OpenCLAccessAttr::Keyword_read_only: \
Result = Context.Id##ROTy; \
break; \
case OpenCLAccessAttr::SpellingNotCalculated: \
llvm_unreachable("Spelling not yet calculated"); \
} \
break;
static OpenCLAccessAttr::Spelling getImageAccess(const ParsedAttributesView &Attrs)
Definition: SemaType.cpp:854

◆ IMAGE_TYPE

#define IMAGE_TYPE (   ImgType,
  Id,
  SingletonId,
  Access,
  Suffix 
)
Value:
case BuiltinType::Id: \
PrevAccessQual = #Access; \
break;

◆ MS_TYPE_ATTRS_CASELIST

#define MS_TYPE_ATTRS_CASELIST
Value:
case ParsedAttr::AT_Ptr32: \
case ParsedAttr::AT_Ptr64: \
case ParsedAttr::AT_SPtr: \
case ParsedAttr::AT_UPtr

Definition at line 165 of file SemaType.cpp.

◆ NULLABILITY_TYPE_ATTRS_CASELIST

#define NULLABILITY_TYPE_ATTRS_CASELIST
Value:
case ParsedAttr::AT_TypeNonNull: \
case ParsedAttr::AT_TypeNullable: \
case ParsedAttr::AT_TypeNullableResult: \
case ParsedAttr::AT_TypeNullUnspecified

Definition at line 172 of file SemaType.cpp.

◆ OBJC_POINTER_TYPE_ATTRS_CASELIST

#define OBJC_POINTER_TYPE_ATTRS_CASELIST
Value:
case ParsedAttr::AT_ObjCGC: \
case ParsedAttr::AT_ObjCOwnership

Definition at line 120 of file SemaType.cpp.

◆ TRANSFORM_TYPE_TRAIT_DEF [1/2]

#define TRANSFORM_TYPE_TRAIT_DEF (   _,
  Trait 
)    case DeclSpec::TST_##Trait:

◆ TRANSFORM_TYPE_TRAIT_DEF [2/2]

#define TRANSFORM_TYPE_TRAIT_DEF (   Enum,
  Trait 
)
Value:
case TST_##Trait: \
return UnaryTransformType::Enum;

Enumeration Type Documentation

◆ TypeAttrLocation

The location of a type attribute.

Enumerator
TAL_DeclSpec 

The attribute is in the decl-specifier-seq.

TAL_DeclChunk 

The attribute is part of a DeclaratorChunk.

TAL_DeclName 

The attribute is immediately after the declaration's name.

Definition at line 371 of file SemaType.cpp.

◆ TypeDiagSelector

Enumerator
TDS_Function 
TDS_Pointer 
TDS_ObjCObjOrBlock 

Definition at line 55 of file SemaType.cpp.

Function Documentation

◆ assignInheritanceModel()

static void assignInheritanceModel ( Sema S,
CXXRecordDecl RD 
)
static

◆ BuildAddressSpaceIndex()

static bool BuildAddressSpaceIndex ( Sema S,
LangAS ASIdx,
const Expr AddrSpace,
SourceLocation  AttrLoc 
)
static

Build an AddressSpace index from a constant expression and diagnose any errors related to invalid address_spaces.

Returns true on successfully building an AddressSpace index.

Definition at line 6410 of file SemaType.cpp.

References clang::AANT_ArgumentIntegerConstant, clang::Sema::Context, clang::Default, clang::SemaBase::Diag(), clang::FirstTargetAddressSpace, clang::Expr::getIntegerConstantExpr(), clang::getLangASFromTargetAS(), clang::Stmt::getSourceRange(), clang::Expr::isValueDependent(), max(), and clang::Qualifiers::MaxAddressSpace.

Referenced by clang::Sema::BuildAddressSpaceAttr(), and HandleAddressSpaceTypeAttribute().

◆ BuildTypeCoupledDecls()

static void BuildTypeCoupledDecls ( Expr E,
llvm::SmallVectorImpl< TypeCoupledDeclRefInfo > &  Decls 
)
static

Definition at line 9341 of file SemaType.cpp.

Referenced by clang::Sema::BuildCountAttributedArrayType().

◆ ChangeIntegralSignedness()

static QualType ChangeIntegralSignedness ( Sema S,
QualType  BaseType,
bool  IsMakeSigned,
SourceLocation  Loc 
)
static

◆ checkArraySize()

static ExprResult checkArraySize ( Sema S,
Expr *&  ArraySize,
llvm::APSInt SizeVal,
unsigned  VLADiag,
bool  VLAIsError 
)
static

Check whether the specified array bound can be evaluated using the relevant language rules.

If so, returns the possibly-converted expression and sets SizeVal to the size. If not, but the expression might be a VLA bound, returns ExprResult(). Otherwise, produces a diagnostic and returns ExprError().

Definition at line 2001 of file SemaType.cpp.

References clang::Sema::CCEK_ArrayBound, clang::Sema::CheckConvertedConstantExpression(), clang::Sema::Context, clang::SemaBase::Diag(), clang::Sema::getLangOpts(), clang::ASTContext::getSizeType(), clang::Expr::getType(), clang::Type::isIntegralOrUnscopedEnumerationType(), Loc, clang::T, and clang::Sema::VerifyIntegerConstantExpression().

Referenced by clang::Sema::BuildArrayType().

◆ checkExtParameterInfos()

static void checkExtParameterInfos ( Sema S,
ArrayRef< QualType paramTypes,
const FunctionProtoType::ExtProtoInfo EPI,
llvm::function_ref< SourceLocation(unsigned)>  getParamLoc 
)
static

◆ checkMutualExclusion()

static bool checkMutualExclusion ( TypeProcessingState &  state,
const FunctionProtoType::ExtProtoInfo EPI,
ParsedAttr Attr,
AttributeCommonInfo::Kind  OtherKind 
)
static

◆ checkNullabilityConsistency()

static void checkNullabilityConsistency ( Sema S,
SimplePointerKind  pointerKind,
SourceLocation  pointerLoc,
SourceLocation  pointerEndLoc = SourceLocation() 
)
static

Complains about missing nullability if the file containing pointerLoc has other uses of nullability (either the keywords or the assume_nonnull pragma).

If the file has not seen other uses of nullability, this particular pointer is saved for possible later diagnosis. See recordNullabilitySeen().

Definition at line 4137 of file SemaType.cpp.

References clang::Sema::Context, emitNullabilityConsistencyWarning(), clang::ASTContext::getDiagnostics(), getNullabilityCompletenessCheckFileID(), clang::DiagnosticsEngine::isIgnored(), clang::FileID::isInvalid(), clang::SourceLocation::isInvalid(), clang::Sema::NullabilityMap, clang::FileNullability::PointerEndLoc, clang::FileNullability::PointerKind, clang::FileNullability::PointerLoc, and clang::FileNullability::SawTypeNullability.

Referenced by GetFullTypeForDeclarator().

◆ CheckNullabilityTypeSpecifier() [1/2]

static bool CheckNullabilityTypeSpecifier ( Sema S,
TypeProcessingState *  State,
ParsedAttr PAttr,
QualType QT,
NullabilityKind  Nullability,
SourceLocation  NullabilityLoc,
bool  IsContextSensitive,
bool  AllowOnArrayType,
bool  OverrideExisting 
)
static

◆ CheckNullabilityTypeSpecifier() [2/2]

static bool CheckNullabilityTypeSpecifier ( TypeProcessingState &  State,
QualType Type,
ParsedAttr Attr,
bool  AllowOnArrayType 
)
static

◆ checkObjCKindOfType()

static bool checkObjCKindOfType ( TypeProcessingState &  state,
QualType type,
ParsedAttr attr 
)
static

◆ checkOmittedBlockReturnType()

static bool checkOmittedBlockReturnType ( Sema S,
Declarator declarator,
QualType  Result 
)
static

◆ checkQualifiedFunction()

static bool checkQualifiedFunction ( Sema S,
QualType  T,
SourceLocation  Loc,
QualifiedFunctionKind  QFK 
)
static

Check whether the type T is a qualified function type, and if it is, diagnose that it cannot be contained within the given kind of declarator.

Definition at line 1743 of file SemaType.cpp.

References clang::SemaBase::Diag(), clang::Qualifiers::empty(), clang::Type::getAs(), getFunctionQualifiersAsString(), clang::FunctionProtoType::getMethodQuals(), clang::FunctionProtoType::getRefQualifier(), Loc, clang::RQ_None, and clang::T.

Referenced by clang::Sema::BuildBlockPointerType(), clang::Sema::BuildPointerType(), and clang::Sema::BuildReferenceType().

◆ classifyPointerDeclarator()

static PointerDeclaratorKind classifyPointerDeclarator ( Sema S,
QualType  type,
Declarator declarator,
PointerWrappingDeclaratorKind &  wrappingKind 
)
static

◆ ConvertDeclSpecToType()

static QualType ConvertDeclSpecToType ( TypeProcessingState &  state)
static

Convert the specified declspec to the appropriate type object.

Parameters
stateSpecifies the declarator containing the declaration specifier to be converted, along with other associated processing state.
Returns
The type described by the declaration specifiers. This function never returns null.

Definition at line 879 of file SemaType.cpp.

References clang::ASTContext::AccumTy, clang::ParsedAttributesView::addAtEnd(), clang::TemplateArgumentListInfo::arguments(), clang::ASTContext::BFloat16Ty, clang::ASTContext::BoolTy, clang::Sema::BuildAtomicType(), clang::Sema::BuildBitIntType(), clang::Sema::BuildDecltypeType(), clang::Sema::BuildPackIndexingType(), clang::Sema::BuildQualifiedType(), clang::Sema::BuildTypeofExprType(), clang::Sema::BuildUnaryTransformType(), clang::ASTContext::Char16Ty, clang::ASTContext::Char32Ty, clang::ASTContext::Char8Ty, clang::ASTContext::CharTy, checkOmittedBlockReturnType(), clang::Sema::Context, clang::FixItHint::CreateInsertion(), clang::ASTContext::DependentTy, clang::SemaBase::Diag(), diagnoseAndRemoveTypeQualifiers(), clang::Sema::DiagnoseUseOfDecl(), clang::ASTContext::DoubleTy, clang::ASTContext::Float128Ty, clang::ASTContext::Float16Ty, clang::ASTContext::FloatTy, clang::ASTContext::FractTy, clang::DeclSpec::getAttributes(), clang::ASTContext::getAutoDeductType(), clang::ASTContext::getAutoType(), clang::DeclSpec::getBeginLoc(), clang::ASTContext::getComplexType(), clang::DeclSpec::getConstSpecLoc(), clang::Declarator::getContext(), clang::ASTContext::getCorrespondingSaturatedType(), clang::ASTContext::getCorrespondingUnsignedType(), clang::Declarator::getDeclarationAttributes(), clang::Sema::getElaboratedType(), clang::DeclSpec::getEllipsisLoc(), clang::Declarator::getIdentifierLoc(), clang::Sema::getLangOpts(), clang::Declarator::getMutableDeclSpec(), clang::LangOptions::getOpenCLCompatibleVersion(), clang::Sema::getOpenCLOptions(), clang::DeclSpec::getPackIndexingExpr(), clang::ASTContext::getPrintingPolicy(), clang::DeclSpec::getRepAsDecl(), clang::DeclSpec::getRepAsExpr(), clang::DeclSpec::getRepAsTemplateId(), clang::DeclSpec::getRepAsType(), clang::ASTContext::getSignedWCharType(), clang::DeclSpec::getSourceRange(), clang::DeclSpec::getSpecifierName(), clang::DeclSpec::getStorageClassSpec(), clang::ASTContext::getTargetInfo(), clang::ASTContext::getTypeDeclType(), clang::Sema::GetTypeFromParser(), clang::ASTContext::getTypeOfType(), clang::DeclSpec::getTypeQualifiers(), clang::ASTContext::getTypeSize(), clang::DeclSpec::getTypeSpecComplex(), clang::DeclSpec::getTypeSpecComplexLoc(), clang::DeclSpec::getTypeSpecSatLoc(), clang::DeclSpec::getTypeSpecScope(), clang::DeclSpec::getTypeSpecSign(), clang::DeclSpec::getTypeSpecSignLoc(), clang::DeclSpec::getTypeSpecType(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::DeclSpec::getTypeSpecTypeNameLoc(), clang::DeclSpec::getTypeSpecWidth(), clang::DeclSpec::getTypeSpecWidthLoc(), clang::ASTContext::getUnsignedWCharType(), clang::ASTContext::getVectorType(), clang::DeclSpec::getVolatileSpecLoc(), clang::ASTContext::HalfTy, clang::TargetInfo::hasBFloat16Type(), clang::TargetInfo::hasBitIntType(), clang::TargetInfo::hasFloat128Type(), clang::TargetInfo::hasFloat16Type(), clang::TargetInfo::hasIbm128Type(), clang::TargetInfo::hasInt128Type(), clang::DeclSpec::hasTypeSpecifier(), clang::ASTContext::Ibm128Ty, clang::ASTContext::Int128Ty, clang::ASTContext::IntTy, clang::OpenCLOptions::isAvailableOption(), clang::DeclSpec::isConstrainedAuto(), clang::LangOptions::isImplicitIntAllowed(), clang::LangOptions::isImplicitIntRequired(), clang::SourceLocation::isInvalid(), clang::OpenCLOptions::isSupported(), clang::DeclSpec::isTypeAltiVecBool(), clang::DeclSpec::isTypeAltiVecPixel(), clang::DeclSpec::isTypeAltiVecVector(), clang::DeclSpec::isTypeSpecOwned(), clang::DeclSpec::isTypeSpecPipe(), clang::DeclSpec::isTypeSpecSat(), clang::ASTContext::LongAccumTy, clang::ASTContext::LongDoubleTy, clang::ASTContext::LongFractTy, clang::ASTContext::LongLongTy, clang::ASTContext::LongTy, maybeSynthesizeBlockSignature(), processTypeAttrs(), clang::Qualified, clang::DeclSpec::SCS_typedef, clang::Declarator::setInvalidType(), clang::TemplateArgumentListInfo::setLAngleLoc(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::ASTContext::ShortAccumTy, clang::ASTContext::ShortFractTy, clang::ASTContext::ShortTy, clang::ASTContext::SignedCharTy, TAL_DeclSpec, clang::DeclSpec::TQ_atomic, clang::DeclSpec::TQ_const, clang::DeclSpec::TQ_volatile, clang::Sema::translateTemplateArguments(), clang::DeclSpec::TSC_complex, clang::DeclSpec::TSC_imaginary, clang::DeclSpec::TST_accum, clang::DeclSpec::TST_atomic, clang::DeclSpec::TST_auto, clang::DeclSpec::TST_auto_type, clang::DeclSpec::TST_BFloat16, clang::DeclSpec::TST_bitint, clang::DeclSpec::TST_bool, clang::DeclSpec::TST_char, clang::DeclSpec::TST_char16, clang::DeclSpec::TST_char32, clang::DeclSpec::TST_char8, clang::DeclSpec::TST_class, clang::DeclSpec::TST_decimal128, clang::DeclSpec::TST_decimal32, clang::DeclSpec::TST_decimal64, clang::DeclSpec::TST_decltype, clang::DeclSpec::TST_decltype_auto, clang::DeclSpec::TST_double, clang::DeclSpec::TST_enum, clang::DeclSpec::TST_error, clang::DeclSpec::TST_float, clang::DeclSpec::TST_float128, clang::DeclSpec::TST_float16, clang::DeclSpec::TST_fract, clang::DeclSpec::TST_half, clang::DeclSpec::TST_ibm128, clang::DeclSpec::TST_int, clang::DeclSpec::TST_int128, clang::DeclSpec::TST_interface, clang::DeclSpec::TST_struct, clang::DeclSpec::TST_typename, clang::DeclSpec::TST_typename_pack_indexing, clang::DeclSpec::TST_typeof_unqualExpr, clang::DeclSpec::TST_typeof_unqualType, clang::DeclSpec::TST_typeofExpr, clang::DeclSpec::TST_typeofType, clang::DeclSpec::TST_union, clang::DeclSpec::TST_unknown_anytype, clang::DeclSpec::TST_unspecified, clang::DeclSpec::TST_void, clang::DeclSpec::TST_wchar, TSTToUnaryTransformType(), clang::ASTContext::UnknownAnyTy, clang::ASTContext::UnsignedCharTy, clang::ASTContext::UnsignedInt128Ty, clang::ASTContext::UnsignedIntTy, clang::ASTContext::UnsignedLongLongTy, clang::ASTContext::UnsignedLongTy, clang::ASTContext::UnsignedShortTy, clang::ASTContext::VoidTy, and clang::ASTContext::WCharTy.

Referenced by GetDeclSpecTypeForDeclarator().

◆ createNullabilityAttr()

static Attr * createNullabilityAttr ( ASTContext Ctx,
ParsedAttr Attr,
NullabilityKind  NK 
)
static

◆ createSimpleAttr()

template<typename AttrT >
static AttrT * createSimpleAttr ( ASTContext Ctx,
ParsedAttr AL 
)
static

Definition at line 4237 of file SemaType.cpp.

References clang::ParsedAttr::setUsedAsTypeAttr().

◆ deduceOpenCLPointeeAddrSpace()

static QualType deduceOpenCLPointeeAddrSpace ( Sema S,
QualType  PointeeType 
)
static

◆ diagnoseAndRemoveTypeQualifiers()

static void diagnoseAndRemoveTypeQualifiers ( Sema S,
const DeclSpec DS,
unsigned TypeQuals,
QualType  TypeSoFar,
unsigned  RemoveTQs,
unsigned  DiagID 
)
static

◆ diagnoseBadTypeAttribute()

static void diagnoseBadTypeAttribute ( Sema S,
const ParsedAttr attr,
QualType  type 
)
static

◆ DiagnoseMultipleAddrSpaceAttributes()

static bool DiagnoseMultipleAddrSpaceAttributes ( Sema S,
LangAS  ASOld,
LangAS  ASNew,
SourceLocation  AttrLoc 
)
static

◆ diagnoseRedundantReturnTypeQualifiers()

static void diagnoseRedundantReturnTypeQualifiers ( Sema S,
QualType  RetTy,
Declarator D,
unsigned  FunctionChunkIndex 
)
static

Definition at line 2976 of file SemaType.cpp.

References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::PointerTypeInfo::AtomicQualLoc, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::PointerTypeInfo::ConstQualLoc, clang::Sema::diagnoseIgnoredQualifiers(), clang::DeclaratorChunk::Fun, clang::DeclaratorChunk::Function, clang::DeclSpec::getAtomicSpecLoc(), clang::DeclSpec::getConstSpecLoc(), clang::QualType::getCVRQualifiers(), clang::Declarator::getDeclSpec(), clang::Declarator::getIdentifierLoc(), clang::UnqualifiedId::getKind(), clang::QualType::getLocalCVRQualifiers(), clang::Declarator::getName(), clang::Declarator::getNumTypeObjects(), clang::DeclSpec::getRestrictSpecLoc(), clang::DeclaratorChunk::FunctionTypeInfo::getTrailingReturnTypeLoc(), clang::Declarator::getTypeObject(), clang::DeclSpec::getTypeQualifiers(), clang::DeclSpec::getUnalignedSpecLoc(), clang::DeclSpec::getVolatileSpecLoc(), clang::DeclaratorChunk::FunctionTypeInfo::hasTrailingReturnType(), clang::IK_ConversionFunctionId, clang::Type::isAtomicType(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Ptr, clang::DeclaratorChunk::Reference, clang::DeclaratorChunk::PointerTypeInfo::RestrictQualLoc, clang::DeclSpec::TQ_atomic, clang::DeclaratorChunk::PointerTypeInfo::TypeQuals, clang::DeclaratorChunk::PointerTypeInfo::UnalignedQualLoc, and clang::DeclaratorChunk::PointerTypeInfo::VolatileQualLoc.

Referenced by GetFullTypeForDeclarator().

◆ distributeFunctionTypeAttr()

static void distributeFunctionTypeAttr ( TypeProcessingState &  state,
ParsedAttr attr,
QualType  type 
)
static

A function type attribute was written somewhere in a declaration other than on the declarator itself or in the decl spec.

Given that it didn't apply in whatever position it was written in, try to move it to a more appropriate position.

Definition at line 599 of file SemaType.cpp.

References clang::DeclaratorChunk::Array, clang::ast_matchers::attr, clang::DeclaratorChunk::BlockPointer, diagnoseBadTypeAttribute(), clang::DeclaratorChunk::Function, clang::DeclaratorChunk::getAttrs(), clang::Declarator::getTypeObject(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, moveAttrFromListToList(), clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, and clang::ast_matchers::type.

Referenced by processTypeAttrs().

◆ distributeFunctionTypeAttrFromDeclarator()

static void distributeFunctionTypeAttrFromDeclarator ( TypeProcessingState &  state,
ParsedAttr attr,
QualType declSpecType,
CUDAFunctionTarget  CFT 
)
static

A function type attribute was written on the declarator or declaration.

Try to apply it somewhere. Attrs is the attribute list containing the declaration (either of the declarator or the declaration).

Definition at line 670 of file SemaType.cpp.

References clang::ast_matchers::attr, distributeFunctionTypeAttrToInnermost(), clang::Declarator::getAttributes(), and clang::ParsedAttributesView::remove().

Referenced by distributeTypeAttrsFromDeclarator().

◆ distributeFunctionTypeAttrFromDeclSpec()

static void distributeFunctionTypeAttrFromDeclSpec ( TypeProcessingState &  state,
ParsedAttr attr,
QualType declSpecType,
CUDAFunctionTarget  CFT 
)
static

A function type attribute was written in the decl spec.

Try to apply it somewhere.

Definition at line 650 of file SemaType.cpp.

References clang::ast_matchers::attr, and distributeFunctionTypeAttrToInnermost().

Referenced by processTypeAttrs().

◆ distributeFunctionTypeAttrToInnermost()

static bool distributeFunctionTypeAttrToInnermost ( TypeProcessingState &  state,
ParsedAttr attr,
ParsedAttributesView attrList,
QualType declSpecType,
CUDAFunctionTarget  CFT 
)
static

Try to distribute a function type attribute to the innermost function chunk or type.

Returns true if the attribute was distributed, false if no location was found.

Definition at line 630 of file SemaType.cpp.

References clang::ast_matchers::attr, clang::DeclaratorChunk::Function, clang::DeclaratorChunk::getAttrs(), clang::Declarator::getNumTypeObjects(), clang::Declarator::getTypeObject(), handleFunctionTypeAttr(), clang::DeclaratorChunk::Kind, and moveAttrFromListToList().

Referenced by distributeFunctionTypeAttrFromDeclarator(), and distributeFunctionTypeAttrFromDeclSpec().

◆ distributeNullabilityTypeAttr()

static bool distributeNullabilityTypeAttr ( TypeProcessingState &  state,
QualType  type,
ParsedAttr attr 
)
static

◆ distributeObjCPointerTypeAttr()

static void distributeObjCPointerTypeAttr ( TypeProcessingState &  state,
ParsedAttr attr,
QualType  type 
)
static

Given that an objc_gc attribute was written somewhere on a declaration other than on the declarator itself (for which, use distributeObjCPointerTypeAttrFromDeclarator), and given that it didn't apply in whatever position it was written in, try to move it to a more appropriate position.

Definition at line 482 of file SemaType.cpp.

References clang::DeclaratorChunk::Array, clang::ast_matchers::attr, clang::DeclaratorChunk::BlockPointer, diagnoseBadTypeAttribute(), clang::DeclaratorChunk::Function, clang::DeclaratorChunk::getAttrs(), clang::Declarator::getTypeObject(), clang::DeclaratorChunk::Kind, maybeMovePastReturnType(), clang::DeclaratorChunk::MemberPointer, moveAttrFromListToList(), clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, and clang::ast_matchers::type.

Referenced by processTypeAttrs().

◆ distributeObjCPointerTypeAttrFromDeclarator()

static void distributeObjCPointerTypeAttrFromDeclarator ( TypeProcessingState &  state,
ParsedAttr attr,
QualType declSpecType 
)
static

◆ distributeTypeAttrsFromDeclarator()

static void distributeTypeAttrsFromDeclarator ( TypeProcessingState &  state,
QualType declSpecType,
CUDAFunctionTarget  CFT 
)
static

Given that there are attributes written on the declarator or declaration itself, try to distribute any type attributes to the appropriate declarator chunk.

These are attributes like the following: int f ATTR; int (f ATTR)(); but not necessarily this: int f() ATTR;

Attrs is the attribute list containing the declaration (either of the declarator or the declaration).

Definition at line 699 of file SemaType.cpp.

References clang::ast_matchers::attr, distributeFunctionTypeAttrFromDeclarator(), distributeObjCPointerTypeAttrFromDeclarator(), FUNCTION_TYPE_ATTRS_CASELIST, MS_TYPE_ATTRS_CASELIST, NULLABILITY_TYPE_ATTRS_CASELIST, and OBJC_POINTER_TYPE_ATTRS_CASELIST.

Referenced by GetDeclSpecTypeForDeclarator().

◆ emitNullabilityConsistencyWarning()

static void emitNullabilityConsistencyWarning ( Sema S,
SimplePointerKind  PointerKind,
SourceLocation  PointerLoc,
SourceLocation  PointerEndLoc 
)
static

◆ fillAtomicQualLoc()

static void fillAtomicQualLoc ( AtomicTypeLoc  ATL,
const DeclaratorChunk Chunk 
)
static

◆ fillAttributedTypeLoc()

static void fillAttributedTypeLoc ( AttributedTypeLoc  TL,
TypeProcessingState &  State 
)
static

◆ fillDependentAddressSpaceTypeLoc()

static void fillDependentAddressSpaceTypeLoc ( DependentAddressSpaceTypeLoc  DASTL,
const ParsedAttributesView Attrs 
)
static

◆ fillMatrixTypeLoc()

static void fillMatrixTypeLoc ( MatrixTypeLoc  MTL,
const ParsedAttributesView Attrs 
)
static

◆ fixItNullability()

template<typename DiagBuilderT >
static void fixItNullability ( Sema S,
DiagBuilderT &  Diag,
SourceLocation  PointerLoc,
NullabilityKind  Nullability 
)
static

◆ getCCForDeclaratorChunk()

static CallingConv getCCForDeclaratorChunk ( Sema S,
Declarator D,
const ParsedAttributesView AttrList,
const DeclaratorChunk::FunctionTypeInfo FTI,
unsigned  ChunkIndex 
)
static

◆ getCCTypeAttr()

static Attr * getCCTypeAttr ( ASTContext Ctx,
ParsedAttr Attr 
)
static

Definition at line 7456 of file SemaType.cpp.

References clang::Attr::getKind().

Referenced by handleFunctionTypeAttr().

◆ GetDeclSpecTypeForDeclarator()

static QualType GetDeclSpecTypeForDeclarator ( TypeProcessingState &  state,
TypeSourceInfo *&  ReturnTypeInfo 
)
static

Definition at line 3154 of file SemaType.cpp.

References clang::AliasDecl, clang::AliasTemplate, clang::Association, clang::Auto, clang::Block, clang::BlockLiteral, clang::Class, clang::Condition, clang::Sema::Context, clang::UnqualifiedId::ConversionFunctionId, clang::ConversionId, ConvertDeclSpecToType(), clang::Sema::CUDA(), clang::Sema::CurContext, clang::CXXCatch, clang::CXXNew, clang::DecltypeAuto, clang::ASTContext::DependentTy, clang::SemaBase::Diag(), distributeTypeAttrsFromDeclarator(), clang::Enum, clang::File, clang::ForInit, clang::FunctionalCast, clang::TemplateName::getAsTemplateDecl(), clang::DeclSpec::getAttributes(), clang::Declarator::getAttributes(), clang::SourceRange::getBegin(), clang::Type::getContainedDeducedType(), clang::Declarator::getContext(), clang::Sema::getCurLambda(), clang::Sema::getCurScope(), clang::Declarator::getDeclSpec(), clang::UnqualifiedId::getKind(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::Declarator::getMutableDeclSpec(), clang::Declarator::getName(), clang::Declarator::getNumTypeObjects(), clang::DeclSpec::getParsedSpecifiers(), clang::DeclSpec::getRepAsDecl(), clang::UnqualifiedId::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::Sema::getTemplateNameKindForDiagnostics(), clang::Declarator::getTrailingReturnType(), clang::ASTContext::getTypeDeclType(), clang::Sema::GetTypeFromParser(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::GNUAutoType, clang::Declarator::hasTrailingReturnType(), clang::SemaCUDA::IdentifyTarget(), clang::IK_ConstructorName, clang::IK_ConstructorTemplateId, clang::IK_ConversionFunctionId, clang::IK_DeductionGuideName, clang::IK_DestructorName, clang::IK_Identifier, clang::IK_ImplicitSelfParam, clang::IK_LiteralOperatorId, clang::IK_OperatorFunctionId, clang::IK_TemplateId, int, clang::Interface, clang::ASTContext::IntTy, clang::Sema::InventedParameterInfos, InventTemplateParameter(), clang::TagDecl::isCompleteDefinition(), clang::DeclSpec::isFriendSpecified(), clang::Scope::isFunctionDeclarationScope(), clang::Declarator::isFunctionDeclarator(), clang::Declarator::isInvalidType(), clang::DeclSpec::isTypeSpecOwned(), clang::KNRTypeList, clang::LambdaExpr, clang::LambdaExprParameter, clang::Member, clang::Sema::NoteTemplateLocation(), clang::ObjCCatch, clang::ObjCParameter, clang::ObjCResult, clang::DeclSpec::PQ_TypeSpecifier, processTypeAttrs(), clang::Prototype, clang::RequiresExpr, clang::DeclSpec::SCS_static, clang::DeclSpec::SCS_typedef, clang::SelectionInit, clang::TagDecl::setEmbeddedInDeclarator(), clang::Declarator::setInvalidType(), clang::Struct, clang::T, TAL_DeclSpec, clang::TemplateArg, clang::TemplateParam, clang::TemplateTypeArg, clang::TrailingReturn, clang::TrailingReturnVar, clang::TypeName, clang::Union, and clang::ASTContext::VoidTy.

Referenced by clang::Sema::GetTypeForDeclarator(), and clang::Sema::GetTypeForDeclaratorCast().

◆ GetEnumUnderlyingType()

static QualType GetEnumUnderlyingType ( Sema S,
QualType  BaseType,
SourceLocation  Loc 
)
static

◆ GetFullTypeForDeclarator()

static TypeSourceInfo * GetFullTypeForDeclarator ( TypeProcessingState &  state,
QualType  declSpecType,
TypeSourceInfo TInfo 
)
static

Never complain.

Complain on the inner pointers (but not the outermost pointer).

Complain about any pointers that don't have nullability specified or inferred.

Definition at line 4292 of file SemaType.cpp.

References clang::Qualifiers::addAddressSpace(), clang::ParsedAttributesView::addAtEnd(), clang::Qualifiers::addCVRUQualifiers(), clang::AliasDecl, clang::AliasTemplate, clang::TargetInfo::allowHalfArgsAndReturns(), clang::DeclaratorChunk::Arr, clang::DeclaratorChunk::Array, clang::Association, clang::ast_matchers::attr, clang::Auto, clang::Block, clang::BlockLiteral, clang::DeclaratorChunk::BlockPointer, clang::Sema::BuildArrayType(), clang::Sema::BuildBlockPointerType(), clang::Sema::BuildMemberPointerType(), clang::Sema::BuildParenType(), clang::Sema::BuildPointerType(), clang::Sema::BuildQualifiedType(), clang::Sema::BuildReadPipeType(), clang::Sema::BuildReferenceType(), clang::Type::castAs(), clang::Sema::CheckDistantExceptionSpec(), clang::Sema::checkExceptionSpecification(), checkExtParameterInfos(), checkNullabilityConsistency(), classifyPointerDeclarator(), clang::DeclaratorChunk::Cls, clang::Sema::CodeSynthesisContexts, clang::Sema::computeDeclContext(), clang::Condition, clang::Constexpr, clang::Type::containsUnexpandedParameterPack(), clang::Sema::Context, clang::ConversionId, clang::FixItHint::CreateInsertion(), createNullabilityAttr(), clang::FixItHint::CreateRemoval(), clang::Sema::CUDA(), clang::CXXCatch, clang::CXXNew, clang::Default, clang::Definition, clang::ASTContext::DependentTy, Diag(), clang::SemaBase::Diag(), DiagnoseMultipleAddrSpaceAttributes(), diagnoseRedundantReturnTypeQualifiers(), clang::ASTContext::DoubleTy, clang::ObjCDeclSpec::DQ_CSNullability, clang::FunctionProtoType::ExtProtoInfo::EllipsisLoc, clang::DeclaratorChunk::EndLoc, clang::EST_Dynamic, clang::DeclaratorChunk::FunctionTypeInfo::Exceptions, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::FunctionProtoType::ExtProtoInfo::ExtInfo, clang::FunctionProtoType::ExtProtoInfo::ExtParameterInfos, clang::File, fixItNullability(), clang::DeclSpec::forEachQualifier(), clang::ForInit, clang::DeclaratorChunk::Fun, clang::DeclaratorChunk::Function, clang::FunctionalCast, clang::Type::getAs(), clang::NestedNameSpecifier::getAsIdentifier(), clang::NestedNameSpecifier::getAsType(), clang::Decl::getAttr(), clang::DeclSpec::getAttributePool(), clang::DeclSpec::getAttributes(), clang::Declarator::getAttributes(), clang::DeclaratorChunk::getAttrs(), clang::CharSourceRange::getBegin(), clang::TypeLoc::getBeginLoc(), clang::CXXScopeSpec::getBeginLoc(), clang::DeclSpec::getBeginLoc(), clang::Declarator::getBeginLoc(), clang::ASTContext::getBuiltinVaListDecl(), getCCForDeclaratorChunk(), clang::DeclSpec::getConstexprSpecifier(), clang::Type::getContainedAutoType(), clang::Declarator::getContext(), clang::Sema::getCurLambda(), clang::Declarator::getCXXScopeSpec(), clang::Declarator::getDeclarationAttributes(), clang::Declarator::getDeclSpec(), clang::Sema::getDefaultCXXMethodAddrSpace(), clang::ASTContext::getDependentNameType(), clang::ASTContext::getElaboratedType(), clang::DeclaratorChunk::FunctionTypeInfo::getEllipsisLoc(), clang::Declarator::getEllipsisLoc(), clang::TypeLoc::getEndLoc(), clang::DeclSpec::getEndLoc(), clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecLocBeg(), clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecType(), clang::FunctionProtoType::getExtProtoInfo(), clang::Declarator::getFunctionDefinitionKind(), clang::ASTContext::getFunctionNoProtoType(), getFunctionQualifiersAsString(), clang::ASTContext::getFunctionType(), clang::Declarator::getIdentifier(), clang::Declarator::getIdentifierLoc(), clang::SourceManager::getImmediateExpansionRange(), clang::Declarator::getInnermostNonParenChunk(), clang::NestedNameSpecifier::getKind(), clang::UnqualifiedId::getKind(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::Sema::getLocForEndOfToken(), clang::DeclaratorChunk::FunctionTypeInfo::getLParenLoc(), clang::Declarator::getMutableDeclSpec(), clang::Declarator::getName(), clang::IdentifierInfo::getName(), clang::Type::getNullability(), clang::Sema::getNullabilityKeyword(), clang::DeclaratorChunk::FunctionTypeInfo::getNumExceptions(), clang::Declarator::getNumTypeObjects(), clang::ASTContext::getObjCObjectPointerType(), clang::LangOptions::getOpenCLCompatibleVersion(), clang::Sema::getOpenCLOptions(), clang::ASTContext::getPackExpansionType(), clang::FunctionProtoType::getParamTypes(), clang::Preprocessor::getPragmaAssumeNonNullLoc(), clang::NestedNameSpecifier::getPrefix(), clang::ASTContext::getPromotedIntegerType(), clang::CXXScopeSpec::getRange(), clang::DeclaratorChunk::FunctionTypeInfo::getRefQualifierLoc(), clang::DeclSpec::getRepAsDecl(), clang::FunctionType::getReturnType(), clang::DeclaratorChunk::FunctionTypeInfo::getRParenLoc(), clang::CXXScopeSpec::getScopeRep(), clang::Sema::getSourceManager(), clang::DeclSpec::getSourceRange(), clang::Declarator::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::ASTContext::getTargetInfo(), clang::DeclaratorChunk::FunctionTypeInfo::getTrailingReturnType(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ValueDecl::getType(), clang::ASTContext::getTypeDeclType(), clang::Sema::GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), clang::Declarator::getTypeObject(), clang::DeclSpec::getTypeQualifiers(), clang::TypeLocBuilder::getTypeSourceInfo(), GetTypeSourceInfoForDeclarator(), clang::DeclSpec::getTypeSpecType(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::NestedNameSpecifier::Global, clang::Decl::hasAttr(), clang::ParsedAttributesView::hasAttribute(), clang::DeclSpec::hasAutoTypeSpec(), clang::Declarator::hasEllipsis(), clang::DeclaratorChunk::FunctionTypeInfo::hasMethodTypeQualifiers(), clang::ParsedAttributesView::hasMSPropertyAttr(), hasNullabilityAttr(), hasOuterPointerLikeChunk(), clang::DeclaratorChunk::FunctionTypeInfo::hasPrototype, clang::QualType::hasQualifiers(), clang::DeclaratorChunk::FunctionTypeInfo::hasRefQualifier(), clang::DeclaratorChunk::ReferenceTypeInfo::HasRestrict, clang::DeclaratorChunk::ArrayTypeInfo::hasStatic, clang::DeclSpec::hasTagDefinition(), clang::FunctionProtoType::ExtProtoInfo::HasTrailingReturn, clang::DeclaratorChunk::FunctionTypeInfo::hasTrailingReturnType(), clang::DeclaratorChunk::ParamInfo::Ident, clang::NestedNameSpecifier::Identifier, clang::SemaCUDA::IdentifyTarget(), clang::DeclaratorChunk::ParamInfo::IdentLoc, clang::IK_ConversionFunctionId, clang::IK_DeductionGuideName, clang::ASTContext::IntTy, clang::Sema::InventedParameterInfos, InventTemplateParameter(), clang::DeclaratorChunk::FunctionTypeInfo::isAmbiguous, clang::Type::isArrayType(), clang::Type::isAtomicType(), clang::OpenCLOptions::isAvailableOption(), clang::Type::isBlockPointerType(), clang::isComputedNoexcept(), clang::AutoType::isDecltypeAuto(), clang::Sema::isDependentScopeSpecifier(), clang::Type::isDependentType(), clang::Declarator::isExplicitObjectMemberFunction(), clang::DeclSpec::isFriendSpecified(), clang::Declarator::isFunctionDeclarationContext(), clang::Declarator::isFunctionDeclarator(), isFunctionOrMethod(), clang::Type::isFunctionProtoType(), clang::Type::isFunctionType(), clang::Type::isHalfType(), clang::Type::isImageType(), clang::SourceLocation::isInvalid(), clang::CXXScopeSpec::isInvalid(), clang::Declarator::isInvalidType(), clang::SourceLocation::isMacroID(), clang::Type::isMemberPointerType(), IsNoDerefableChunk(), clang::QualType::isNull(), clang::Type::isObjCObjectType(), clang::Type::isObjectType(), clang::Type::isPipeType(), clang::ASTContext::isPromotableIntegerType(), clang::Declarator::isPrototypeContext(), clang::DeclContext::isRecord(), clang::Type::isRecordType(), clang::Type::isSamplerT(), clang::CXXScopeSpec::isSet(), clang::DeclaratorChunk::ArrayTypeInfo::isStar, clang::Declarator::isStaticMember(), clang::SourceLocation::isValid(), clang::DeclaratorChunk::FunctionTypeInfo::isVariadic, clang::Type::isVoidType(), clang::DeclaratorChunk::Kind, clang::KNRTypeList, clang::LambdaExpr, clang::LambdaExprParameter, clang::DeclaratorChunk::Loc, Loc, clang::DeclaratorChunk::ReferenceTypeInfo::LValueRef, clang::DeclaratorChunk::Mem, clang::Member, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::FunctionTypeInfo::MethodQualifiers, clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, clang::DeclaratorChunk::FunctionTypeInfo::NoexceptExpr, clang::None, clang::NonNull, clang::Normal, clang::Nullable, clang::DeclaratorChunk::ArrayTypeInfo::NumElts, clang::DeclaratorChunk::FunctionTypeInfo::NumParams, clang::ObjCCatch, clang::ObjCParameter, clang::ObjCResult, P, clang::DeclaratorChunk::ParamInfo::Param, clang::DeclaratorChunk::FunctionTypeInfo::Params, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::Sema::PP, processTypeAttrs(), clang::Prototype, clang::DeclaratorChunk::Ptr, clang::TypeLocBuilder::push(), clang::TypeLocBuilder::pushFullCopy(), clang::DeclaratorChunk::TypeAndRange::Range, recordNullabilitySeen(), clang::DeclaratorChunk::Ref, clang::DeclaratorChunk::Reference, clang::FunctionProtoType::ExtProtoInfo::RefQualifier, clang::DeclaratorChunk::FunctionTypeInfo::RefQualifierIsLValueRef, clang::Qualifiers::removeCVRQualifiers(), clang::RequiresExpr, clang::LangOptions::requiresStrictPrototypes(), clang::Qualifiers::Restrict, clang::RQ_LValue, clang::RQ_None, clang::RQ_RValue, clang::DeclaratorChunk::MemberPointerTypeInfo::Scope(), clang::DeclSpec::SCS_static, clang::DeclSpec::SCS_typedef, clang::SelectionInit, clang::Declarator::setEllipsisLoc(), clang::Decl::setInvalidDecl(), clang::Declarator::setInvalidType(), clang::ParmVarDecl::setKNRPromoted(), clang::ObjCObjectPointerTypeLoc::setStarLoc(), clang::ValueDecl::setType(), shouldHaveNullability(), clang::Sema::SourceMgr, clang::Star, clang::Static, clang::NestedNameSpecifier::Super, clang::T, TAL_DeclChunk, TAL_DeclName, TAL_DeclSpec, clang::TemplateArg, clang::TemplateParam, clang::TemplateTypeArg, clang::DeclSpec::TQ_const, clang::TrailingReturn, clang::TrailingReturnVar, clang::DeclSpec::TST_auto, clang::DeclaratorChunk::TypeAndRange::Ty, clang::Declarator::type_objects(), clang::TypeName, clang::FunctionProtoType::ExtProtoInfo::TypeQuals, clang::DeclaratorChunk::PointerTypeInfo::TypeQuals, clang::DeclaratorChunk::ArrayTypeInfo::TypeQuals, clang::DeclaratorChunk::BlockPointerTypeInfo::TypeQuals, clang::DeclaratorChunk::MemberPointerTypeInfo::TypeQuals, clang::NestedNameSpecifier::TypeSpec, clang::NestedNameSpecifier::TypeSpecWithTemplate, clang::FunctionProtoType::ExtProtoInfo::Variadic, warnAboutAmbiguousFunction(), and warnAboutRedundantParens().

Referenced by clang::Sema::GetTypeForDeclarator(), and clang::Sema::GetTypeForDeclaratorCast().

◆ getFunctionQualifiersAsString()

static std::string getFunctionQualifiersAsString ( const FunctionProtoType FnTy)
static

◆ getImageAccess()

static OpenCLAccessAttr::Spelling getImageAccess ( const ParsedAttributesView Attrs)
static

Definition at line 854 of file SemaType.cpp.

◆ getLiteralDiagFromTagKind()

static unsigned getLiteralDiagFromTagKind ( TagTypeKind  Tag)
static

Get diagnostic select index for tag kind for literal type diagnostic message.

WARNING: Indexes apply to particular diagnostics only!

Returns
diagnostic select index.

Definition at line 9187 of file SemaType.cpp.

References clang::Class, clang::Interface, and clang::Struct.

Referenced by clang::Sema::RequireLiteralType().

◆ getNullabilityCompletenessCheckFileID()

static FileID getNullabilityCompletenessCheckFileID ( Sema S,
SourceLocation  loc 
)
static

◆ getPrintableNameForEntity()

static std::string getPrintableNameForEntity ( DeclarationName  Entity)
static

◆ GetTypeSourceInfoForDeclarator()

static TypeSourceInfo * GetTypeSourceInfoForDeclarator ( TypeProcessingState &  State,
QualType  T,
TypeSourceInfo ReturnTypeInfo 
)
static

◆ HandleAddressSpaceTypeAttribute()

static void HandleAddressSpaceTypeAttribute ( QualType Type,
const ParsedAttr Attr,
TypeProcessingState &  State 
)
static

◆ HandleAnnotateTypeAttr()

static void HandleAnnotateTypeAttr ( TypeProcessingState &  State,
QualType CurType,
const ParsedAttr PA 
)
static

◆ HandleArmMveStrictPolymorphismAttr()

static void HandleArmMveStrictPolymorphismAttr ( TypeProcessingState &  State,
QualType CurType,
ParsedAttr Attr 
)
static

◆ handleArmStateAttribute()

static bool handleArmStateAttribute ( Sema S,
FunctionProtoType::ExtProtoInfo EPI,
ParsedAttr Attr,
FunctionType::ArmStateValue  State 
)
static

◆ HandleArmSveVectorBitsTypeAttr()

static void HandleArmSveVectorBitsTypeAttr ( QualType CurType,
ParsedAttr Attr,
Sema S 
)
static

◆ HandleBTFTypeTagAttribute()

static void HandleBTFTypeTagAttribute ( QualType Type,
const ParsedAttr Attr,
TypeProcessingState &  State 
)
static

◆ HandleExtVectorTypeAttr()

static void HandleExtVectorTypeAttr ( QualType CurType,
const ParsedAttr Attr,
Sema S 
)
static

Process the OpenCL-like ext_vector_type attribute when it occurs on a type.

Definition at line 7988 of file SemaType.cpp.

References clang::Sema::BuildExtVectorType(), clang::SemaBase::Diag(), clang::AttributeCommonInfo::getLoc(), and clang::T.

Referenced by processTypeAttrs().

◆ handleFunctionTypeAttr()

static bool handleFunctionTypeAttr ( TypeProcessingState &  state,
ParsedAttr attr,
QualType type,
CUDAFunctionTarget  CFT 
)
static

Process an individual function attribute.

Returns true to indicate that the attribute was handled, false if it wasn't.

Definition at line 7589 of file SemaType.cpp.

References clang::ASTContext::adjustFunctionType(), clang::FunctionType::ARM_In, clang::FunctionType::ARM_InOut, clang::FunctionType::ARM_Out, clang::FunctionType::ARM_Preserves, clang::ast_matchers::attr, clang::CC_X86FastCall, clang::CC_X86StdCall, clang::Sema::CheckAttrNoArgs(), clang::Sema::CheckAttrTarget(), clang::Sema::CheckCallingConvAttr(), checkMutualExclusion(), clang::Sema::checkNSReturnsRetainedReturnType(), clang::Sema::CheckRegparmAttr(), clang::Sema::Context, clang::SemaBase::Diag(), clang::Equivalent, clang::EST_BasicNoexcept, clang::EST_DependentNoexcept, clang::EST_Dynamic, clang::EST_DynamicNone, clang::EST_MSAny, clang::EST_NoexceptFalse, clang::EST_NoexceptTrue, clang::EST_None, clang::EST_NoThrow, clang::EST_Unevaluated, clang::EST_Uninstantiated, clang::EST_Unparsed, clang::ExpectedFunctionWithProtoType, clang::Type::getAs(), clang::FunctionType::getCallConv(), clang::Sema::getCallingConvAttributedType(), getCCTypeAttr(), clang::ASTContext::getFunctionType(), clang::ASTContext::getFunctionTypeWithExceptionSpec(), clang::FunctionType::getHasRegParm(), clang::Sema::getLangOpts(), clang::FunctionType::getNameForCallConv(), handleArmStateAttribute(), int, clang::FunctionProtoType::isVariadic(), clang::FunctionProtoType::ExtProtoInfo::setArmSMEAttribute(), clang::FunctionType::SME_PStateSMCompatibleMask, clang::FunctionType::SME_PStateSMEnabledMask, clang::supportsVariadicCall(), clang::ast_matchers::type, and clang::Sema::VariadicFunction.

Referenced by distributeFunctionTypeAttrToInnermost(), and processTypeAttrs().

◆ HandleHLSLParamModifierAttr()

static void HandleHLSLParamModifierAttr ( QualType CurType,
const ParsedAttr Attr,
Sema S 
)
static

◆ HandleLifetimeBoundAttr()

static void HandleLifetimeBoundAttr ( TypeProcessingState &  State,
QualType CurType,
ParsedAttr Attr 
)
static

Definition at line 8400 of file SemaType.cpp.

Referenced by processTypeAttrs().

◆ HandleMatrixTypeAttr()

static void HandleMatrixTypeAttr ( QualType CurType,
const ParsedAttr Attr,
Sema S 
)
static

HandleMatrixTypeAttr - "matrix_type" attribute, like ext_vector_type.

Definition at line 8352 of file SemaType.cpp.

References clang::Sema::BuildMatrixType(), clang::SemaBase::Diag(), clang::Sema::getLangOpts(), clang::AttributeCommonInfo::getLoc(), and clang::T.

Referenced by processTypeAttrs().

◆ handleMSPointerTypeQualifierAttr()

static bool handleMSPointerTypeQualifierAttr ( TypeProcessingState &  state,
ParsedAttr attr,
QualType type 
)
static

◆ HandleNeonVectorTypeAttr()

static void HandleNeonVectorTypeAttr ( QualType CurType,
const ParsedAttr Attr,
Sema S,
VectorKind  VecKind 
)
static

HandleNeonVectorTypeAttr - The "neon_vector_type" and "neon_polyvector_type" attributes are used to create vector types that are mangled according to ARM's ABI.

Otherwise, these types are identical to those created with the "vector_size" attribute. Unlike "vector_size" the argument to these Neon attributes is the number of vector elements, not the vector size in bytes. The vector width and element type must match one of the standard Neon vector types.

Definition at line 8074 of file SemaType.cpp.

References clang::Sema::Context, clang::SemaBase::Diag(), clang::Sema::getASTContext(), clang::ASTContext::getAuxTargetInfo(), clang::Sema::getLangOpts(), clang::AttributeCommonInfo::getLoc(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::ASTContext::getTypeSize(), clang::ASTContext::getVectorType(), clang::TargetInfo::hasFeature(), isPermittedNeonBaseType(), clang::Neon, clang::NeonPoly, and verifyValidIntegerConstantExpr().

Referenced by processTypeAttrs().

◆ handleObjCGCTypeAttr()

static bool handleObjCGCTypeAttr ( TypeProcessingState &  state,
ParsedAttr attr,
QualType type 
)
static

handleObjCGCTypeAttr - Process the attribute((objc_gc)) type attribute on the specified type.

Returns true to indicate that the attribute was handled, false to indicate that the type does not permit the attribute.

Definition at line 6789 of file SemaType.cpp.

References clang::AANT_ArgumentString, clang::ast_matchers::attr, clang::Sema::Context, clang::SemaBase::Diag(), clang::Qualifiers::GCNone, clang::ASTContext::getObjCGCQualType(), clang::IdentifierInfo::isStr(), clang::Qualifiers::Strong, clang::ast_matchers::type, and clang::Qualifiers::Weak.

Referenced by handleObjCPointerTypeAttr().

◆ handleObjCOwnershipTypeAttr()

static bool handleObjCOwnershipTypeAttr ( TypeProcessingState &  state,
ParsedAttr attr,
QualType type 
)
static

◆ handleObjCPointerTypeAttr()

static bool handleObjCPointerTypeAttr ( TypeProcessingState &  state,
ParsedAttr attr,
QualType type 
)
static

◆ HandleOpenCLAccessAttr()

static void HandleOpenCLAccessAttr ( QualType CurType,
const ParsedAttr Attr,
Sema S 
)
static

◆ HandleRISCVRVVVectorBitsTypeAttr()

static void HandleRISCVRVVVectorBitsTypeAttr ( QualType CurType,
ParsedAttr Attr,
Sema S 
)
static

◆ HandleVectorSizeAttr()

static void HandleVectorSizeAttr ( QualType CurType,
const ParsedAttr Attr,
Sema S 
)
static

HandleVectorSizeAttribute - this attribute is only applicable to integral and float scalars, although arrays, pointers, and function return values are allowed in conjunction with this construct.

Aggregates with this attribute are invalid, even if they are of the same size as a corresponding scalar. The raw attribute should contain precisely 1 argument, the vector size for the variable, measured in bytes. If curType and rawAttr are well formed, this routine will return a new vector type.

Definition at line 7968 of file SemaType.cpp.

References clang::Sema::BuildVectorType(), clang::SemaBase::Diag(), clang::AttributeCommonInfo::getLoc(), and clang::T.

Referenced by processTypeAttrs().

◆ HandleWebAssemblyFuncrefAttr()

static bool HandleWebAssemblyFuncrefAttr ( TypeProcessingState &  State,
QualType QT,
ParsedAttr PAttr 
)
static

◆ hasNullabilityAttr()

static bool hasNullabilityAttr ( const ParsedAttributesView attrs)
static

Check whether there is a nullability attribute of any kind in the given attribute list.

Definition at line 3852 of file SemaType.cpp.

Referenced by distributeNullabilityTypeAttr(), and GetFullTypeForDeclarator().

◆ hasOuterPointerLikeChunk()

static bool hasOuterPointerLikeChunk ( const Declarator D,
unsigned  endIndex 
)
static

Returns true if any of the declarator chunks before endIndex include a level of indirection: array, pointer, reference, or pointer-to-member.

Because declarator chunks are stored in outer-to-inner order, testing every chunk before endIndex is testing all chunks that embed the current chunk as part of their type.

It is legal to pass the result of Declarator::getNumTypeObjects() as the end index, in which case all chunks are tested.

Definition at line 4207 of file SemaType.cpp.

References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::Function, clang::Declarator::getTypeObject(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, and clang::DeclaratorChunk::Reference.

Referenced by GetFullTypeForDeclarator(), and processTypeAttrs().

◆ inferARCLifetimeForPointee()

static QualType inferARCLifetimeForPointee ( Sema S,
QualType  type,
SourceLocation  loc,
bool  isReference 
)
static

◆ inferARCWriteback()

static void inferARCWriteback ( TypeProcessingState &  state,
QualType declSpecType 
)
static

◆ InventTemplateParameter()

static std::pair< QualType, TypeSourceInfo * > InventTemplateParameter ( TypeProcessingState &  state,
QualType  T,
TypeSourceInfo TrailingTSI,
AutoType Auto,
InventedTemplateParameterInfo Info 
)
static

Definition at line 3047 of file SemaType.cpp.

References clang::TemplateArgumentListInfo::addArgument(), clang::TemplateArgumentListInfo::arguments(), clang::Sema::AttachTypeConstraint(), clang::Auto, clang::InventedTemplateParameterInfo::AutoTemplateParameterDepth, clang::Sema::Context, clang::TemplateTypeParmDecl::Create(), clang::Sema::DiagnoseUnexpandedParameterPack(), clang::OpaquePtr< PtrTy >::get(), clang::AutoTypeLoc::getArgLoc(), clang::TemplateName::getAsTemplateDecl(), clang::TemplateName::getAsUsingShadowDecl(), clang::AutoTypeLoc::getConceptNameInfo(), clang::TypeLoc::getContainedAutoTypeLoc(), clang::Declarator::getDeclSpec(), clang::Declarator::getEllipsisLoc(), clang::AutoTypeLoc::getFoundDecl(), clang::Declarator::getIdentifier(), clang::Declarator::getIdentifierLoc(), clang::AutoTypeLoc::getLAngleLoc(), clang::AutoTypeLoc::getNamedConcept(), clang::AutoTypeLoc::getNestedNameSpecifierLoc(), clang::AutoTypeLoc::getNumArgs(), clang::AutoTypeLoc::getRAngleLoc(), clang::DeclSpec::getRepAsTemplateId(), clang::TemplateIdAnnotation::getTemplateArgs(), clang::ASTContext::getTranslationUnitDecl(), clang::TypeDecl::getTypeForDecl(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclSpec::getTypeSpecScope(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::CXXScopeSpec::getWithLocInContext(), clang::Declarator::hasEllipsis(), clang::AutoTypeLoc::hasExplicitTemplateArgs(), clang::Invalid, clang::Sema::InventAbbreviatedTemplateParameterTypeName(), clang::SourceLocation::isInvalid(), clang::SourceLocation::isValid(), clang::TemplateIdAnnotation::LAngleLoc, clang::TemplateIdAnnotation::Name, clang::TemplateIdAnnotation::NumArgs, clang::TemplateIdAnnotation::RAngleLoc, clang::Sema::ReplaceAutoTypeSourceInfo(), clang::Decl::setImplicit(), clang::T, clang::TemplateIdAnnotation::Template, clang::TemplateIdAnnotation::TemplateNameLoc, clang::InventedTemplateParameterInfo::TemplateParams, clang::Sema::translateTemplateArguments(), and clang::Sema::UPPC_TypeConstraint.

Referenced by GetDeclSpecTypeForDeclarator(), and GetFullTypeForDeclarator().

◆ isDependentOrGNUAutoType()

static bool isDependentOrGNUAutoType ( QualType  T)
static

◆ IsNoDerefableChunk()

static bool IsNoDerefableChunk ( const DeclaratorChunk Chunk)
static

◆ isOmittedBlockReturnType()

static bool isOmittedBlockReturnType ( const Declarator D)
static

isOmittedBlockReturnType - Return true if this declarator is missing a return type because this is a omitted return type on a block literal.

Definition at line 63 of file SemaType.cpp.

References clang::DeclaratorChunk::Function, clang::Declarator::getContext(), clang::Declarator::getDeclSpec(), clang::Declarator::getNumTypeObjects(), clang::Declarator::getTypeObject(), clang::DeclSpec::hasTypeSpecifier(), and clang::DeclaratorChunk::Kind.

Referenced by checkOmittedBlockReturnType().

◆ isPermittedNeonBaseType()

static bool isPermittedNeonBaseType ( QualType Ty,
VectorKind  VecKind,
Sema S 
)
static

◆ mapNullabilityAttrKind()

static NullabilityKind mapNullabilityAttrKind ( ParsedAttr::Kind  kind)
static

Map a nullability attribute kind to a nullability kind.

Definition at line 7161 of file SemaType.cpp.

References clang::NonNull, clang::Nullable, clang::NullableResult, and clang::Unspecified.

Referenced by CheckNullabilityTypeSpecifier(), and distributeNullabilityTypeAttr().

◆ maybeMovePastReturnType()

static DeclaratorChunk * maybeMovePastReturnType ( Declarator declarator,
unsigned  i,
bool  onlyBlockPointers 
)
static

Given the index of a declarator chunk, check whether that chunk directly specifies the return type of a function and, if so, find an appropriate place for it.

Parameters
i- a notional index which the search will start immediately inside
onlyBlockPointersWhether we should only look into block pointer types (vs. all pointer types).

Definition at line 414 of file SemaType.cpp.

References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::Function, clang::Declarator::getNumTypeObjects(), clang::Declarator::getTypeObject(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, and clang::DeclaratorChunk::Reference.

Referenced by distributeNullabilityTypeAttr(), distributeObjCPointerTypeAttr(), and handleObjCOwnershipTypeAttr().

◆ maybeSynthesizeBlockSignature()

static void maybeSynthesizeBlockSignature ( TypeProcessingState &  state,
QualType  declSpecType 
)
static

◆ moveAttrFromListToList()

static void moveAttrFromListToList ( ParsedAttr attr,
ParsedAttributesView fromList,
ParsedAttributesView toList 
)
static

◆ processTypeAttrs()

static void processTypeAttrs ( TypeProcessingState &  state,
QualType type,
TypeAttrLocation  TAL,
const ParsedAttributesView attrs,
CUDAFunctionTarget  CFT = CUDAFunctionTarget::HostDevice 
)
static

◆ rebuildAttributedTypeWithoutNullability()

static QualType rebuildAttributedTypeWithoutNullability ( ASTContext Ctx,
QualType  Type 
)
static

Rebuild an attributed type without the nullability attribute on it.

Definition at line 7142 of file SemaType.cpp.

References clang::ASTContext::getAttributedType(), clang::QualType::getTypePtr(), and rebuildAttributedTypeWithoutNullability().

Referenced by CheckNullabilityTypeSpecifier(), and rebuildAttributedTypeWithoutNullability().

◆ recordNullabilitySeen()

static void recordNullabilitySeen ( Sema S,
SourceLocation  loc 
)
static

Marks that a nullability feature has been used in the file containing loc.

If this file already had pointer types in it that were missing nullability, the first such instance is retroactively diagnosed.

See also
checkNullabilityConsistency

Definition at line 4178 of file SemaType.cpp.

References emitNullabilityConsistencyWarning(), getNullabilityCompletenessCheckFileID(), clang::FileID::isInvalid(), clang::SourceLocation::isInvalid(), clang::Sema::NullabilityMap, clang::FileNullability::PointerEndLoc, clang::FileNullability::PointerKind, clang::FileNullability::PointerLoc, and clang::FileNullability::SawTypeNullability.

Referenced by CheckNullabilityTypeSpecifier(), and GetFullTypeForDeclarator().

◆ shouldHaveNullability()

static bool shouldHaveNullability ( QualType  T)
static

◆ transferARCOwnership()

static void transferARCOwnership ( TypeProcessingState &  state,
QualType declSpecTy,
Qualifiers::ObjCLifetime  ownership 
)
static

◆ transferARCOwnershipToDeclaratorChunk()

static void transferARCOwnershipToDeclaratorChunk ( TypeProcessingState &  state,
Qualifiers::ObjCLifetime  ownership,
unsigned  chunkIndex 
)
static

◆ transferARCOwnershipToDeclSpec()

static void transferARCOwnershipToDeclSpec ( Sema S,
QualType declSpecTy,
Qualifiers::ObjCLifetime  ownership 
)
static

◆ TSTToUnaryTransformType()

static UnaryTransformType::UTTKind TSTToUnaryTransformType ( DeclSpec::TST  SwitchTST)
static

Definition at line 862 of file SemaType.cpp.

Referenced by ConvertDeclSpecToType().

◆ verifyValidIntegerConstantExpr()

static bool verifyValidIntegerConstantExpr ( Sema S,
const ParsedAttr Attr,
llvm::APSInt Result 
)
static

◆ warnAboutAmbiguousFunction()

static void warnAboutAmbiguousFunction ( Sema S,
Declarator D,
DeclaratorChunk DeclType,
QualType  RT 
)
static

Produce an appropriate diagnostic for an ambiguity between a function declarator and a C++ direct-initializer.

Definition at line 3502 of file SemaType.cpp.

References clang::Condition, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), clang::Sema::CurContext, clang::Declaration, clang::SemaBase::Diag(), clang::DeclaratorChunk::EndLoc, clang::DeclaratorChunk::Fun, clang::Type::getAsCXXRecordDecl(), clang::SourceRange::getBegin(), clang::Declarator::getCommaLoc(), clang::Declarator::getContext(), clang::Sema::getCurScope(), clang::Declarator::getDeclSpec(), clang::SourceRange::getEnd(), clang::Sema::getFixItZeroInitializerForType(), clang::Declarator::getFunctionDefinitionKind(), clang::Declarator::getIdentifier(), clang::Declarator::getIdentifierLoc(), clang::Sema::getLocForEndOfToken(), clang::Decl::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::CXXRecordDecl::hasDefinition(), clang::CXXRecordDecl::hasUserProvidedDefaultConstructor(), clang::Init, clang::DeclaratorChunk::FunctionTypeInfo::isAmbiguous, clang::CXXRecordDecl::isEmpty(), clang::Declarator::isFirstDeclarator(), clang::Declarator::isFunctionDeclarator(), clang::DeclContext::isFunctionOrMethod(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::Type::isVoidType(), clang::Sema::LangOpts, clang::DeclaratorChunk::Loc, clang::Sema::LookupName(), clang::Sema::LookupOrdinaryName, clang::DeclaratorChunk::FunctionTypeInfo::NumParams, clang::DeclaratorChunk::ParamInfo::Param, clang::DeclaratorChunk::FunctionTypeInfo::Params, Range, clang::Result, clang::DeclSpec::SCS_unspecified, and clang::Sema::SourceMgr.

Referenced by GetFullTypeForDeclarator().

◆ warnAboutRedundantParens()

static void warnAboutRedundantParens ( Sema S,
Declarator D,
QualType  T 
)
static

Produce an appropriate diagnostic for a declarator with top-level parentheses.

Definition at line 3599 of file SemaType.cpp.

References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::C, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::CXXNew, clang::SemaBase::Diag(), clang::DeclaratorChunk::Function, clang::Type::getAsCXXRecordDecl(), clang::Declarator::getBeginLoc(), clang::Declarator::getContext(), clang::Sema::getCurScope(), clang::Declarator::getCXXScopeSpec(), clang::Declarator::getDeclSpec(), clang::Declarator::getEndLoc(), clang::Declarator::getIdentifier(), clang::Sema::getLangOpts(), clang::Sema::getLocForEndOfToken(), clang::Declarator::getNumTypeObjects(), clang::DeclSpec::getParsedSpecifiers(), clang::NestedNameSpecifier::getPrefix(), clang::CXXScopeSpec::getScopeRep(), clang::Declarator::getTypeObject(), clang::DeclSpec::getTypeQualifiers(), clang::NestedNameSpecifier::Global, clang::Sema::inTemplateInstantiation(), clang::Type::isDependentType(), clang::Declarator::isExpressionContext(), clang::Declarator::isFirstDeclarator(), clang::Declarator::isInvalidType(), clang::Type::isRecordType(), clang::CXXScopeSpec::isValid(), clang::Sema::LookupName(), clang::Sema::LookupOrdinaryName, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::Paren, Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclSpec::PQ_TypeSpecifier, clang::DeclaratorChunk::Reference, clang::Result, clang::T, and clang::Declarator::type_objects().

Referenced by GetFullTypeForDeclarator().