|
clang 22.0.0git
|
#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/ExprObjC.h"#include "clang/AST/LocInfoType.h"#include "clang/AST/Type.h"#include "clang/AST/TypeLoc.h"#include "clang/AST/TypeLocVisitor.h"#include "clang/Basic/LangOptions.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/EnterExpressionEvaluationContext.h"#include "clang/Sema/Initialization.h"#include "clang/Sema/Lookup.h"#include "clang/Sema/ParsedAttr.h"#include "clang/Sema/ParsedTemplate.h"#include "clang/Sema/ScopeInfo.h"#include "clang/Sema/SemaCUDA.h"#include "clang/Sema/SemaHLSL.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/StringExtras.h"#include "llvm/IR/DerivedTypes.h"#include "llvm/Support/ErrorHandling.h"#include <bitset>#include <optional>#include "clang/Basic/TransformTypeTraits.def"#include "clang/Basic/OpenCLImageTypes.def"#include "clang/Basic/HLSLIntangibleTypes.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) |
| #define | GENERIC_IMAGE_TYPE(ImgType, Id) |
| #define | HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) |
| #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 DeclaratorChunk * | maybeMovePastReturnType (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 bool | CheckBitIntElementType (Sema &S, SourceLocation AttrLoc, const BitIntType *BIT, bool ForMatrixType=false) |
| 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 TypeSourceInfo * | GetTypeSourceInfoForDeclarator (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 Attr * | createNullabilityAttr (ASTContext &Ctx, ParsedAttr &Attr, NullabilityKind NK) |
| static bool | DiagnoseMultipleAddrSpaceAttributes (Sema &S, LangAS ASOld, LangAS ASNew, SourceLocation AttrLoc) |
| static bool | shouldHaveNullability (QualType T) |
| static TypeSourceInfo * | GetFullTypeForDeclarator (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 | fillHLSLAttributedResourceTypeLoc (HLSLAttributedResourceTypeLoc 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 void | HandleSwiftAttr (TypeProcessingState &State, TypeAttrLocation TAL, 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 Attr * | getCCTypeAttr (ASTContext &Ctx, ParsedAttr &Attr) |
| static bool | handleNonBlockingNonAllocatingTypeAttr (TypeProcessingState &TPState, ParsedAttr &PAttr, QualType &QT, FunctionTypeUnwrapper &Unwrapped) |
| static bool | checkMutualExclusion (TypeProcessingState &state, const FunctionProtoType::ExtProtoInfo &EPI, ParsedAttr &Attr, AttributeCommonInfo::Kind OtherKind) |
| static bool | handleArmAgnosticAttribute (Sema &S, FunctionProtoType::ExtProtoInfo &EPI, ParsedAttr &Attr) |
| 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 | HandlePtrAuthQualifier (ASTContext &Ctx, QualType &T, const ParsedAttr &Attr, Sema &S) |
| Handle the __ptrauth qualifier. | |
| 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 | HandleLifetimeCaptureByAttr (TypeProcessingState &State, QualType &CurType, ParsedAttr &PA) |
| static void | HandleHLSLParamModifierAttr (TypeProcessingState &State, 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) |
| #define CALLING_CONV_ATTRS_CASELIST |
Definition at line 127 of file SemaType.cpp.
Referenced by getCCForDeclaratorChunk().
| #define FUNCTION_TYPE_ATTRS_CASELIST |
Definition at line 151 of file SemaType.cpp.
Referenced by distributeTypeAttrsFromDeclarator(), and processTypeAttrs().
| #define GENERIC_IMAGE_TYPE | ( | ImgType, | |
| Id ) |
| #define HLSL_INTANGIBLE_TYPE | ( | Name, | |
| Id, | |||
| SingletonId ) |
| #define IMAGE_TYPE | ( | ImgType, | |
| Id, | |||
| SingletonId, | |||
| Access, | |||
| Suffix ) |
| #define MS_TYPE_ATTRS_CASELIST |
Definition at line 174 of file SemaType.cpp.
Referenced by distributeTypeAttrsFromDeclarator(), and processTypeAttrs().
| #define NULLABILITY_TYPE_ATTRS_CASELIST |
Definition at line 181 of file SemaType.cpp.
Referenced by distributeTypeAttrsFromDeclarator(), and processTypeAttrs().
| #define OBJC_POINTER_TYPE_ATTRS_CASELIST |
Definition at line 122 of file SemaType.cpp.
Referenced by distributeTypeAttrsFromDeclarator(), and processTypeAttrs().
| #define TRANSFORM_TYPE_TRAIT_DEF | ( | _, | |
| Trait ) |
| #define TRANSFORM_TYPE_TRAIT_DEF | ( | Enum, | |
| Trait ) |
| enum 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 389 of file SemaType.cpp.
| enum TypeDiagSelector |
| Enumerator | |
|---|---|
| TDS_Function | |
| TDS_Pointer | |
| TDS_ObjCObjOrBlock | |
Definition at line 57 of file SemaType.cpp.
|
static |
Locks in the inheritance model for the given class and all of its bases.
Definition at line 9387 of file SemaType.cpp.
References clang::Decl::addAttr(), clang::ASTConsumer::AssignInheritanceModel(), clang::CXXRecordDecl::calculateInheritanceModel(), clang::Sema::Consumer, clang::Sema::getASTContext(), clang::CXXRecordDecl::getMostRecentDecl(), clang::TagDecl::getSourceRange(), clang::Decl::hasAttr(), clang::Sema::ImplicitMSInheritanceAttrLoc, clang::SourceLocation::isValid(), clang::Sema::MSPointerToMemberRepresentationMethod, clang::Multiple, clang::LangOptionsBase::PPTMK_BestCase, clang::LangOptionsBase::PPTMK_FullGeneralityMultipleInheritance, clang::LangOptionsBase::PPTMK_FullGeneralitySingleInheritance, clang::LangOptionsBase::PPTMK_FullGeneralityVirtualInheritance, clang::Single, and clang::Unspecified.
|
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 6458 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().
|
static |
Definition at line 9718 of file SemaType.cpp.
References clang::cast().
Referenced by clang::Sema::BuildCountAttributedArrayOrPointerType().
|
static |
Definition at line 10003 of file SemaType.cpp.
References BitInt, clang::Sema::Context, clang::SemaBase::Diag(), clang::ASTContext::getBitIntType(), GetEnumUnderlyingType(), clang::ASTContext::getTargetInfo(), clang::ASTContext::getTypeSize(), clang::TargetInfo::hasInt128Type(), clang::ASTContext::Int128Ty, clang::ASTContext::IntTy, clang::Type::isBooleanType(), clang::ASTContext::LongLongTy, clang::ASTContext::LongTy, clang::ASTContext::ShortTy, clang::ASTContext::SignedCharTy, clang::T, clang::ASTContext::UnsignedCharTy, clang::ASTContext::UnsignedInt128Ty, clang::ASTContext::UnsignedIntTy, clang::ASTContext::UnsignedLongLongTy, clang::ASTContext::UnsignedLongTy, and clang::ASTContext::UnsignedShortTy.
Referenced by clang::Sema::BuiltinChangeSignedness().
|
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 1981 of file SemaType.cpp.
References clang::ArrayBound, clang::Sema::CheckConvertedConstantExpression(), clang::Sema::Context, clang::SemaBase::Diag(), clang::Sema::getLangOpts(), clang::ASTContext::getSizeType(), clang::Expr::getType(), clang::Type::isIntegralOrUnscopedEnumerationType(), clang::T, and clang::Sema::VerifyIntegerConstantExpression().
Referenced by clang::Sema::BuildArrayType().
|
static |
Definition at line 2324 of file SemaType.cpp.
References clang::SemaBase::Diag(), and clang::BitIntType::getNumBits().
Referenced by clang::Sema::BuildExtVectorType(), clang::Sema::BuildMatrixType(), and clang::Sema::BuildVectorType().
|
static |
Check the extended parameter information.
Most of the necessary checking should occur when applying the parameter attribute; the only other checks required are positional restrictions.
Definition at line 2600 of file SemaType.cpp.
References clang::CC_Swift, clang::CC_SwiftAsync, clang::SemaBase::Diag(), clang::FunctionProtoType::ExtProtoInfo::ExtInfo, clang::FunctionProtoType::ExtProtoInfo::ExtParameterInfos, clang::FunctionType::ExtParameterInfo::getABI(), clang::FunctionType::ExtInfo::getCC(), clang::getParameterABISpelling(), clang::HLSLInOut, clang::HLSLOut, clang::Ordinary, clang::SwiftAsyncContext, clang::SwiftContext, clang::SwiftErrorResult, and clang::SwiftIndirectResult.
Referenced by clang::Sema::BuildFunctionType(), and GetFullTypeForDeclarator().
|
static |
Definition at line 7743 of file SemaType.cpp.
References clang::SemaBase::Diag(), clang::AttributeCommonInfo::getLoc(), and clang::AttributeCommonInfo::isRegularKeywordAttribute().
Referenced by handleFunctionTypeAttr().
|
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 4134 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().
|
static |
Definition at line 7286 of file SemaType.cpp.
References clang::Type::canHaveNullability(), clang::Sema::Context, createNullabilityAttr(), clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), clang::Type::getArrayElementTypeNoTypeQual(), clang::Type::getAs(), clang::ASTContext::getAttributedType(), clang::Type::getNullability(), clang::getNullabilitySpelling(), clang::Type::getPointeeType(), clang::QualType::getTypePtr(), clang::Implicit, clang::Type::isAnyPointerType(), clang::Type::isArrayType(), clang::Type::isMemberPointerType(), clang::Type::isObjCObjectPointerType(), rebuildAttributedTypeWithoutNullability(), recordNullabilitySeen(), and clang::ast_matchers::typedefDecl.
Referenced by clang::Sema::CheckImplicitNullabilityTypeSpecifier(), CheckNullabilityTypeSpecifier(), and processTypeAttrs().
|
static |
Definition at line 7397 of file SemaType.cpp.
References CheckNullabilityTypeSpecifier(), clang::Attr::getKind(), clang::AttributeCommonInfo::getLoc(), clang::AttributeCommonInfo::isContextSensitiveKeywordAttribute(), and mapNullabilityAttrKind().
|
static |
Check the application of the Objective-C '__kindof' qualifier to the given type.
Definition at line 7422 of file SemaType.cpp.
References clang::Sema::Context, createNullabilityAttr(), createSimpleAttr(), clang::SemaBase::Diag(), clang::ASTContext::getObjCObjectPointerType(), clang::ASTContext::getObjCObjectType(), clang::ObjCObjectPointerType::getObjectType(), clang::isa(), clang::Attr::setImplicit(), and clang::ast_matchers::type.
Referenced by processTypeAttrs().
|
static |
Return true if this is omitted block return type.
Also check type attributes and type qualifiers when returning true.
Definition at line 842 of file SemaType.cpp.
References clang::DeclSpec::ClearTypeQualifiers(), clang::SemaBase::Diag(), diagnoseAndRemoveTypeQualifiers(), clang::DeclSpec::getAttributes(), clang::Declarator::getDeclSpec(), clang::Declarator::getMutableDeclSpec(), clang::DeclSpec::getTypeQualifiers(), isOmittedBlockReturnType(), and clang::ParsedAttributesView::remove().
Referenced by ConvertDeclSpecToType().
|
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 1772 of file SemaType.cpp.
References clang::SemaBase::Diag(), clang::Qualifiers::empty(), getFunctionQualifiersAsString(), clang::FunctionProtoType::getMethodQuals(), clang::FunctionProtoType::getRefQualifier(), clang::RQ_None, and clang::T.
Referenced by clang::Sema::BuildBlockPointerType(), clang::Sema::BuildPointerType(), and clang::Sema::BuildReferenceType().
|
static |
Classify the given declarator, whose type-specified is type, based on what kind of pointer it refers to.
This is used to determine the default nullability.
Definition at line 3898 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::Function, clang::SemaObjC::getNSErrorIdent(), clang::Declarator::getNumTypeObjects(), clang::Declarator::getTypeObject(), clang::SemaObjC::isCFError(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, clang::Sema::ObjC(), clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::ast_matchers::recordDecl, clang::DeclaratorChunk::Reference, and clang::ast_matchers::type.
Referenced by GetFullTypeForDeclarator().
|
static |
Convert the specified declspec to the appropriate type object.
| state | Specifies the declarator containing the declaration specifier to be converted, along with other associated processing state. |
Definition at line 897 of file SemaType.cpp.
References clang::ParsedAttributesView::addAtEnd(), clang::AltiVecBool, clang::AltiVecPixel, clang::AltiVecVector, clang::TemplateArgumentListInfo::arguments(), clang::Auto, clang::BlockLiteral, clang::Sema::BuildAtomicType(), clang::Sema::BuildBitIntType(), clang::Sema::BuildDecltypeType(), clang::Sema::BuildPackIndexingType(), clang::Sema::BuildQualifiedType(), clang::Sema::BuildTypeofExprType(), clang::Sema::BuildUnaryTransformType(), clang::cast(), checkOmittedBlockReturnType(), clang::Sema::Context, clang::FixItHint::CreateInsertion(), clang::DecltypeAuto, clang::SemaBase::Diag(), diagnoseAndRemoveTypeQualifiers(), clang::Sema::DiagnoseUseOfDecl(), clang::DeclSpec::getAttributes(), clang::ASTContext::getAutoType(), clang::DeclSpec::getBeginLoc(), clang::DeclSpec::getConstSpecLoc(), clang::Declarator::getContext(), clang::Declarator::getDeclarationAttributes(), clang::DeclSpec::getEllipsisLoc(), clang::Declarator::getIdentifierLoc(), clang::KeywordHelpers::getKeywordForTypeSpec(), clang::Sema::getLangOpts(), clang::Declarator::getMutableDeclSpec(), clang::LangOptions::getOpenCLCompatibleVersion(), clang::Sema::getOpenCLOptions(), clang::DeclSpec::getPackIndexingExpr(), clang::DeclSpec::getRepAsDecl(), clang::DeclSpec::getRepAsExpr(), clang::DeclSpec::getRepAsTemplateId(), clang::DeclSpec::getRepAsType(), clang::CXXScopeSpec::getScopeRep(), clang::DeclSpec::getSourceRange(), clang::DeclSpec::getSpecifierName(), clang::DeclSpec::getStorageClassSpec(), clang::ASTContext::getTargetInfo(), clang::Sema::GetTypeFromParser(), clang::DeclSpec::getTypeQualifiers(), 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::DeclSpec::getVolatileSpecLoc(), clang::GNUAutoType, clang::TargetInfo::hasBFloat16Type(), clang::TargetInfo::hasBitIntType(), clang::TargetInfo::hasFloat128Type(), clang::TargetInfo::hasFloat16Type(), clang::TargetInfo::hasIbm128Type(), clang::TargetInfo::hasInt128Type(), clang::DeclSpec::hasTypeSpecifier(), clang::Sema::HLSL(), clang::OpenCLOptions::isAvailableOption(), clang::DeclSpec::isConstrainedAuto(), clang::LangOptions::isImplicitIntAllowed(), clang::LangOptions::isImplicitIntRequired(), clang::SourceLocation::isInvalid(), clang::OpenCLOptions::isSupported(), clang::LangOptions::isTargetDevice(), clang::DeclSpec::isTypeAltiVecBool(), clang::DeclSpec::isTypeAltiVecPixel(), clang::DeclSpec::isTypeAltiVecVector(), clang::DeclSpec::isTypeSpecOwned(), clang::DeclSpec::isTypeSpecPipe(), clang::DeclSpec::isTypeSpecSat(), clang::Keyword, clang::LambdaExpr, clang::Long, clang::LongLong, maybeSynthesizeBlockSignature(), clang::SemaHLSL::ProcessResourceTypeAttributes(), processTypeAttrs(), clang::Qualified, clang::DeclSpec::SCS_typedef, clang::Declarator::setInvalidType(), clang::TemplateArgumentListInfo::setLAngleLoc(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::Short, clang::Signed, 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::Unqualified, clang::Unsigned, and clang::Unspecified.
Referenced by GetDeclSpecTypeForDeclarator().
|
static |
Definition at line 4239 of file SemaType.cpp.
References createSimpleAttr(), clang::NonNull, clang::Nullable, clang::NullableResult, and clang::Unspecified.
Referenced by CheckNullabilityTypeSpecifier(), checkObjCKindOfType(), and GetFullTypeForDeclarator().
|
static |
Definition at line 4234 of file SemaType.cpp.
References clang::ParsedAttr::setUsedAsTypeAttr().
Referenced by checkObjCKindOfType(), createNullabilityAttr(), getCCTypeAttr(), HandleArmMveStrictPolymorphismAttr(), handleFunctionTypeAttr(), HandleLifetimeBoundAttr(), handleMSPointerTypeQualifierAttr(), handleObjCOwnershipTypeAttr(), HandleWebAssemblyFuncrefAttr(), and processTypeAttrs().
Definition at line 1798 of file SemaType.cpp.
References clang::ASTContext::getAddrSpaceQualType(), clang::Sema::getASTContext(), clang::ASTContext::getDefaultOpenCLPointeeAddrSpace(), clang::QualType::hasAddressSpace(), clang::Type::isDependentType(), clang::Type::isSamplerT(), and clang::Type::isUndeducedAutoType().
Referenced by clang::Sema::BuildBlockPointerType(), clang::Sema::BuildPointerType(), and clang::Sema::BuildReferenceType().
|
static |
Definition at line 814 of file SemaType.cpp.
References clang::FixItHint::CreateRemoval(), clang::SemaBase::Diag(), clang::DeclSpec::getAtomicSpecLoc(), clang::DeclSpec::getConstSpecLoc(), clang::DeclSpec::getRestrictSpecLoc(), clang::DeclSpec::getSpecifierName(), clang::DeclSpec::getVolatileSpecLoc(), clang::Sema::inTemplateInstantiation(), clang::DeclSpec::TQ_atomic, clang::DeclSpec::TQ_const, clang::DeclSpec::TQ_restrict, and clang::DeclSpec::TQ_volatile.
Referenced by checkOmittedBlockReturnType(), and ConvertDeclSpecToType().
|
static |
diagnoseBadTypeAttribute - Diagnoses a type attribute which doesn't apply to the given type.
Definition at line 82 of file SemaType.cpp.
References clang::SemaBase::Diag(), clang::Sema::findMacroSpelling(), clang::SourceLocation::isMacroID(), clang::IdentifierInfo::isStr(), TDS_Function, TDS_ObjCObjOrBlock, TDS_Pointer, and clang::ast_matchers::type.
Referenced by distributeFunctionTypeAttr(), distributeObjCPointerTypeAttr(), and processTypeAttrs().
|
static |
Definition at line 4261 of file SemaType.cpp.
References clang::Default, and clang::SemaBase::Diag().
Referenced by clang::Sema::BuildAddressSpaceAttr(), GetFullTypeForDeclarator(), and HandleAddressSpaceTypeAttribute().
|
static |
Definition at line 2967 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().
|
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 617 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, 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().
|
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 688 of file SemaType.cpp.
References distributeFunctionTypeAttrToInnermost(), clang::Declarator::getAttributes(), and clang::ParsedAttributesView::remove().
Referenced by distributeTypeAttrsFromDeclarator().
|
static |
A function type attribute was written in the decl spec.
Try to apply it somewhere.
Definition at line 668 of file SemaType.cpp.
References distributeFunctionTypeAttrToInnermost().
Referenced by processTypeAttrs().
|
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 648 of file SemaType.cpp.
References clang::DeclaratorChunk::Function, clang::DeclaratorChunk::getAttrs(), clang::Declarator::getNumTypeObjects(), clang::Declarator::getTypeObject(), handleFunctionTypeAttr(), clang::DeclaratorChunk::Kind, and moveAttrFromListToList().
Referenced by distributeFunctionTypeAttrFromDeclarator(), and distributeFunctionTypeAttrFromDeclSpec().
|
static |
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.
Attempt to move the attribute to the specified chunk.
Definition at line 7480 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::DeclaratorChunk::Function, clang::DeclaratorChunk::getAttrs(), clang::Declarator::getTypeObject(), hasNullabilityAttr(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::Loc, mapNullabilityAttrKind(), 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().
|
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 500 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, 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().
|
static |
Distribute an objc_gc type attribute that was written on the declarator.
Definition at line 556 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::Function, clang::Declarator::getAttributes(), clang::DeclSpec::getAttributes(), clang::DeclaratorChunk::getAttrs(), clang::Declarator::getMutableDeclSpec(), clang::Declarator::getNumTypeObjects(), clang::Declarator::getTypeObject(), handleObjCPointerTypeAttr(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, moveAttrFromListToList(), clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, clang::ParsedAttributesView::remove(), and clang::ParsedAttributes::takeOneFrom().
Referenced by distributeTypeAttrsFromDeclarator().
|
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 717 of file SemaType.cpp.
References distributeFunctionTypeAttrFromDeclarator(), distributeObjCPointerTypeAttrFromDeclarator(), FUNCTION_TYPE_ATTRS_CASELIST, MS_TYPE_ATTRS_CASELIST, NULLABILITY_TYPE_ATTRS_CASELIST, and OBJC_POINTER_TYPE_ATTRS_CASELIST.
Referenced by GetDeclSpecTypeForDeclarator().
|
static |
Definition at line 4100 of file SemaType.cpp.
References clang::SemaBase::Diag(), Diag(), fixItNullability(), clang::SourceLocation::isValid(), clang::NonNull, and clang::Nullable.
Referenced by checkNullabilityConsistency(), and recordNullabilitySeen().
|
static |
Definition at line 5873 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::PointerTypeInfo::AtomicQualLoc, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::Function, clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Ptr, clang::DeclaratorChunk::Reference, clang::AtomicTypeLoc::setKWLoc(), and clang::AtomicTypeLoc::setParensRange().
Referenced by GetTypeSourceInfoForDeclarator().
|
static |
Definition at line 5845 of file SemaType.cpp.
References clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getTypePtr(), and clang::AttributedTypeLoc::setAttr().
Referenced by GetTypeSourceInfoForDeclarator().
|
static |
Definition at line 6292 of file SemaType.cpp.
References clang::DependentAddressSpaceTypeLoc::setAttrExprOperand(), clang::DependentAddressSpaceTypeLoc::setAttrNameLoc(), and clang::DependentAddressSpaceTypeLoc::setAttrOperandParensRange().
Referenced by GetTypeSourceInfoForDeclarator().
|
static |
Definition at line 5850 of file SemaType.cpp.
References clang::HLSLAttributedResourceLocInfo::ContainedTyInfo, clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getTypePtr(), clang::HLSLAttributedResourceLocInfo::Range, clang::HLSLAttributedResourceTypeLoc::setContainedTypeSourceInfo(), and clang::HLSLAttributedResourceTypeLoc::setSourceRange().
|
static |
Definition at line 5858 of file SemaType.cpp.
References clang::MatrixTypeLoc::setAttrColumnOperand(), clang::MatrixTypeLoc::setAttrNameLoc(), clang::MatrixTypeLoc::setAttrOperandParensRange(), and clang::MatrixTypeLoc::setAttrRowOperand().
|
static |
Creates a fix-it to insert a C-style nullability keyword at pointerLoc, taking into account whitespace before and after.
Definition at line 4065 of file SemaType.cpp.
References clang::FixItHint::CreateInsertion(), Diag(), clang::SourceManager::getCharacterData(), clang::Sema::getLocForEndOfToken(), clang::getNullabilitySpelling(), clang::isAsciiIdentifierContinue(), clang::SourceLocation::isMacroID(), clang::SourceLocation::isValid(), clang::isWhitespace(), and clang::Sema::SourceMgr.
Referenced by emitNullabilityConsistencyWarning(), and GetFullTypeForDeclarator().
|
static |
Helper for figuring out the default CC for a function declarator type.
If this is the outermost chunk, then we can determine the CC from the declarator context. If not, then this could be either a member function type or normal function type.
Definition at line 3722 of file SemaType.cpp.
References CALLING_CONV_ATTRS_CASELIST, clang::CC_DeviceKernel, clang::Sema::CheckCallingConvAttr(), clang::Sema::Context, clang::Sema::CUDA(), clang::DeclaratorChunk::Function, clang::Declarator::getAttributes(), clang::DeclSpec::getAttributes(), clang::Declarator::getContext(), clang::Declarator::getDeclSpec(), clang::ASTContext::getDefaultCallingConvention(), clang::Sema::getLangOpts(), clang::DeclSpec::getStorageClassSpec(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::Declarator::getTypeObject(), clang::SemaCUDA::IdentifyTarget(), clang::Declarator::isFirstDeclarationOfMember(), clang::Declarator::isFunctionDeclarator(), clang::Declarator::isStaticMember(), clang::DeclaratorChunk::FunctionTypeInfo::isVariadic, clang::DeclaratorChunk::Kind, clang::LambdaExpr, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::Paren, clang::DeclSpec::SCS_static, clang::DeclSpec::SCS_typedef, and clang::supportsVariadicCall().
Referenced by GetFullTypeForDeclarator().
|
static |
Definition at line 7561 of file SemaType.cpp.
References clang::cast(), createSimpleAttr(), and clang::Attr::getKind().
Referenced by handleFunctionTypeAttr().
|
static |
Definition at line 3143 of file SemaType.cpp.
References clang::AliasDecl, clang::AliasTemplate, clang::Association, clang::Auto, clang::Block, clang::BlockLiteral, clang::cast(), 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::Error, clang::File, clang::ForInit, clang::FunctionalCast, clang::TemplateName::getAsTemplateDecl(), clang::Declarator::getAttributes(), clang::DeclSpec::getAttributes(), clang::SourceRange::getBegin(), clang::ASTContext::getCanonicalTagType(), 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::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::isa(), clang::TagDecl::isCompleteDefinition(), clang::DeclSpec::isFriendSpecified(), clang::Scope::isFunctionDeclarationScope(), clang::Declarator::isFunctionDeclarator(), clang::Declarator::isInvalidType(), clang::Declarator::isStaticMember(), clang::DeclSpec::isTypeSpecOwned(), clang::KNRTypeList, clang::LambdaExpr, clang::LambdaExprParameter, clang::Member, clang::Sema::NoteTemplateLocation(), clang::nullptr, clang::ObjCCatch, clang::ObjCParameter, clang::ObjCResult, clang::DeclSpec::PQ_TypeSpecifier, processTypeAttrs(), clang::Prototype, clang::RequiresExpr, clang::DeclSpec::SCS_typedef, clang::SelectionInit, clang::TagDecl::setEmbeddedInDeclarator(), clang::Declarator::setInvalidType(), clang::Struct, clang::T, TAL_DeclSpec, clang::TemplateArg, clang::TemplateName, 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().
|
static |
Definition at line 9875 of file SemaType.cpp.
References clang::Sema::DiagnoseUseOfDecl(), clang::EnumDecl::getDefinition(), clang::EnumDecl::getIntegerType(), clang::QualType::isNull(), and clang::TagDecl::isThisDeclarationADemotedDefinition().
Referenced by clang::Sema::BuiltinEnumUnderlyingType(), and ChangeIntegralSignedness().
|
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 4289 of file SemaType.cpp.
References clang::Qualifiers::addAddressSpace(), clang::ParsedAttributesView::addAtEnd(), clang::Qualifiers::addCVRUQualifiers(), clang::AliasDecl, clang::AliasTemplate, clang::LangOptions::allowArrayReturnTypes(), clang::TargetInfo::allowHalfArgsAndReturns(), clang::DeclaratorChunk::Arr, clang::DeclaratorChunk::Array, clang::Association, 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::C, clang::cast(), clang::Sema::CheckDistantExceptionSpec(), clang::Sema::checkExceptionSpecification(), checkExtParameterInfos(), checkNullabilityConsistency(), classifyPointerDeclarator(), clang::DeclaratorChunk::Cls, clang::Sema::CodeSynthesisContexts, clang::Sema::computeDeclContext(), clang::Condition, clang::Constexpr, clang::Sema::Context, clang::ConversionId, clang::FixItHint::CreateInsertion(), createNullabilityAttr(), clang::FixItHint::CreateRemoval(), clang::Sema::CUDA(), clang::CXXCatch, clang::CXXNew, clang::Default, clang::Definition, clang::SemaBase::Diag(), Diag(), DiagnoseMultipleAddrSpaceAttributes(), diagnoseRedundantReturnTypeQualifiers(), 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, clang::First, fixItNullability(), clang::DeclSpec::forEachQualifier(), clang::ForInit, clang::DeclaratorChunk::Fun, clang::DeclaratorChunk::Function, clang::FunctionalCast, clang::Type::getAs(), clang::DeclSpec::getAttributePool(), clang::Declarator::getAttributes(), clang::DeclSpec::getAttributes(), clang::DeclaratorChunk::getAttrs(), clang::CharSourceRange::getBegin(), clang::Declarator::getBeginLoc(), clang::DeclSpec::getBeginLoc(), clang::TypeLoc::getBeginLoc(), clang::ASTContext::getBuiltinVaListDecl(), getCCForDeclaratorChunk(), clang::DeclSpec::getConstexprSpecifier(), clang::Declarator::getContext(), clang::Sema::getCurLambda(), clang::Declarator::getCXXScopeSpec(), clang::Declarator::getDeclarationAttributes(), clang::Declarator::getDeclSpec(), clang::Sema::getDefaultCXXMethodAddrSpace(), clang::Declarator::getEllipsisLoc(), clang::DeclaratorChunk::FunctionTypeInfo::getEllipsisLoc(), clang::DeclSpec::getEndLoc(), clang::TypeLoc::getEndLoc(), clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecLocBeg(), clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecType(), clang::FunctionProtoType::getExtProtoInfo(), clang::Declarator::getFunctionDefinitionKind(), getFunctionQualifiersAsString(), clang::Declarator::getIdentifier(), clang::Declarator::getIdentifierLoc(), clang::SourceManager::getImmediateExpansionRange(), clang::Declarator::getInnermostNonParenChunk(), clang::SemaHLSL::getInoutParameterType(), clang::UnqualifiedId::getKind(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::Sema::getLocForEndOfToken(), clang::DeclaratorChunk::FunctionTypeInfo::getLParenLoc(), clang::FunctionProtoType::getMethodQuals(), clang::Declarator::getMutableDeclSpec(), clang::Declarator::getName(), clang::IdentifierInfo::getName(), clang::Sema::getNullabilityKeyword(), clang::DeclaratorChunk::FunctionTypeInfo::getNumExceptions(), clang::Declarator::getNumTypeObjects(), clang::LangOptions::getOpenCLCompatibleVersion(), clang::Sema::getOpenCLOptions(), clang::FunctionProtoType::getParamTypes(), clang::Preprocessor::getPragmaAssumeNonNullLoc(), clang::FunctionProtoType::getRefQualifier(), clang::DeclaratorChunk::FunctionTypeInfo::getRefQualifierLoc(), clang::DeclSpec::getRepAsDecl(), clang::FunctionType::getReturnType(), clang::DeclaratorChunk::FunctionTypeInfo::getRParenLoc(), clang::Sema::getSourceManager(), clang::Declarator::getSourceRange(), clang::DeclSpec::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::ASTContext::getTargetInfo(), clang::DeclaratorChunk::FunctionTypeInfo::getTrailingReturnType(), clang::DeclaratorChunk::FunctionTypeInfo::getTrailingReturnTypeLoc(), clang::Sema::GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), clang::Declarator::getTypeObject(), clang::DeclSpec::getTypeQualifiers(), clang::TypeLocBuilder::getTypeSourceInfo(), GetTypeSourceInfoForDeclarator(), clang::DeclSpec::getTypeSpecType(), clang::DeclSpec::getTypeSpecTypeLoc(), 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::Sema::HLSL(), clang::DeclaratorChunk::ParamInfo::Ident, clang::SemaCUDA::IdentifyTarget(), clang::DeclaratorChunk::ParamInfo::IdentLoc, clang::IK_ConversionFunctionId, clang::IK_DeductionGuideName, clang::Sema::InventedParameterInfos, InventTemplateParameter(), clang::isa(), clang::DeclaratorChunk::FunctionTypeInfo::isAmbiguous, clang::OpenCLOptions::isAvailableOption(), clang::Type::isBlockPointerType(), clang::isComputedNoexcept(), clang::Declarator::isExplicitObjectMemberFunction(), clang::DeclSpec::isFriendSpecified(), clang::Declarator::isFunctionDeclarationContext(), clang::Declarator::isFunctionDeclarator(), clang::Type::isHalfType(), clang::CXXScopeSpec::isInvalid(), clang::SourceLocation::isInvalid(), clang::Declarator::isInvalidType(), clang::SourceLocation::isMacroID(), IsNoDerefableChunk(), clang::QualType::isNull(), clang::Declarator::isPrototypeContext(), clang::DeclContext::isRecord(), 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, clang::DeclaratorChunk::ReferenceTypeInfo::LValueRef, clang::DeclaratorChunk::Mem, clang::Member, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::FunctionTypeInfo::MethodQualifiers, clang::DeclaratorChunk::FunctionTypeInfo::NoexceptExpr, clang::NonNull, clang::Normal, clang::Nullable, clang::DeclaratorChunk::ArrayTypeInfo::NumElts, clang::DeclaratorChunk::FunctionTypeInfo::NumParams, clang::ObjCCatch, clang::ObjCParameter, clang::ObjCResult, 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::Declarator::setInvalidType(), clang::ObjCObjectPointerTypeLoc::setStarLoc(), shouldHaveNullability(), clang::Sema::SourceMgr, clang::Star, clang::Static, 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::NestedNameSpecifier::Type, clang::Declarator::type_objects(), clang::TypeName, clang::DeclaratorChunk::ArrayTypeInfo::TypeQuals, clang::DeclaratorChunk::BlockPointerTypeInfo::TypeQuals, clang::DeclaratorChunk::MemberPointerTypeInfo::TypeQuals, clang::DeclaratorChunk::PointerTypeInfo::TypeQuals, clang::FunctionProtoType::ExtProtoInfo::TypeQuals, clang::FunctionProtoType::ExtProtoInfo::Variadic, warnAboutAmbiguousFunction(), and warnAboutRedundantParens().
Referenced by clang::Sema::GetTypeForDeclarator(), and clang::Sema::GetTypeForDeclaratorCast().
|
static |
Definition at line 1733 of file SemaType.cpp.
References clang::Qualifiers::getAsString(), clang::FunctionProtoType::getMethodQuals(), clang::FunctionProtoType::getRefQualifier(), clang::RQ_LValue, clang::RQ_None, and clang::RQ_RValue.
Referenced by checkQualifiedFunction(), clang::Sema::CheckQualifiedFunctionForTypeId(), and GetFullTypeForDeclarator().
|
static |
Definition at line 872 of file SemaType.cpp.
|
static |
Get diagnostic select index for tag kind for literal type diagnostic message.
WARNING: Indexes apply to particular diagnostics only!
Definition at line 9596 of file SemaType.cpp.
References clang::Class, clang::Interface, and clang::Struct.
Referenced by clang::Sema::RequireLiteralType().
|
static |
Definition at line 4025 of file SemaType.cpp.
References clang::SrcMgr::C_User, clang::Sema::CurContext, clang::Sema::Diags, clang::SourceManager::getExpansionLoc(), clang::SrcMgr::SLocEntry::getFile(), clang::SrcMgr::FileInfo::getFileCharacteristic(), clang::SourceManager::getFileID(), clang::SrcMgr::FileInfo::getIncludeLoc(), clang::DeclContext::getParent(), clang::SourceManager::getSLocEntry(), clang::DiagnosticsEngine::getSuppressSystemWarnings(), clang::SrcMgr::SLocEntry::isFile(), clang::FileID::isInvalid(), clang::SourceLocation::isInvalid(), and clang::Sema::SourceMgr.
Referenced by checkNullabilityConsistency(), and recordNullabilitySeen().
|
static |
Definition at line 1565 of file SemaType.cpp.
References clang::DeclarationName::getAsString().
Referenced by clang::Sema::BuildArrayType(), clang::Sema::BuildMemberPointerType(), and clang::Sema::BuildPointerType().
|
static |
Create and instantiate a TypeSourceInfo with type source information.
| T | QualType referring to the type as written in source code. |
| ReturnTypeInfo | For declarators whose return type does not show up in the normal place in the declaration specifiers (such as a C++ conversion function), this pointer will refer to a type source information for that return type. |
Definition at line 6316 of file SemaType.cpp.
References clang::TypeLoc::castAs(), clang::Sema::Context, clang::ASTContext::CreateTypeSourceInfo(), fillAtomicQualLoc(), fillAttributedTypeLoc(), fillDependentAddressSpaceTypeLoc(), clang::TypeLoc::getAs(), clang::DeclSpec::getAttributes(), clang::DeclaratorChunk::getAttrs(), clang::Declarator::getDeclSpec(), clang::Declarator::getEllipsisLoc(), clang::TypeLoc::getFullDataSize(), clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getNextTypeLoc(), clang::TypeLoc::getNextTypeLoc(), clang::Declarator::getNumTypeObjects(), clang::TypeLoc::getOpaqueData(), clang::TypeSourceInfo::getTypeLoc(), clang::UnqualTypeLoc::getTypeLocClass(), clang::Declarator::getTypeObject(), clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getTypePtr(), clang::TypeLoc::getUnqualifiedLoc(), clang::ParsedAttributesView::hasMSPropertyAttr(), clang::isa(), memcpy(), and clang::T.
Referenced by GetFullTypeForDeclarator().
|
static |
HandleAddressSpaceTypeAttribute - Process an address_space attribute on the specified type.
The attribute contains 1 argument, the id of the address space for the type.
Definition at line 6572 of file SemaType.cpp.
References clang::Sema::BuildAddressSpaceAttr(), BuildAddressSpaceIndex(), clang::Sema::Context, clang::Default, clang::SemaBase::Diag(), DiagnoseMultipleAddrSpaceAttributes(), clang::ASTContext::getAddrSpaceQualType(), clang::Attr::getKind(), clang::Sema::getLangOpts(), clang::AttributeCommonInfo::getLoc(), clang::Type::isFunctionType(), clang::QualType::isNull(), clang::Expr::isValueDependent(), and clang::T.
Referenced by processTypeAttrs().
|
static |
Definition at line 8763 of file SemaType.cpp.
References clang::Sema::checkStringLiteralArgumentAttr(), clang::Sema::ConstantFoldAttrArgs(), clang::Sema::Context, clang::SemaBase::Diag(), clang::ParsedAttr::getArgAsExpr(), clang::AttributeCommonInfo::getLoc(), clang::ParsedAttr::getNumArgs(), and clang::ParsedAttr::isArgIdent().
Referenced by processTypeAttrs().
|
static |
Definition at line 7763 of file SemaType.cpp.
References clang::FunctionProtoType::ExtProtoInfo::AArch64SMEAttributes, clang::Sema::checkStringLiteralArgumentAttr(), clang::SemaBase::Diag(), clang::AttributeCommonInfo::getLoc(), clang::FunctionProtoType::ExtProtoInfo::setArmSMEAttribute(), clang::FunctionType::SME_AgnosticZAStateMask, clang::FunctionType::SME_ZAMask, and clang::FunctionType::SME_ZT0Mask.
Referenced by handleFunctionTypeAttr().
|
static |
Definition at line 8582 of file SemaType.cpp.
References createSimpleAttr(), clang::AttributeCommonInfo::getLoc(), clang::VectorType::getVectorKind(), and clang::Neon.
Referenced by processTypeAttrs().
|
static |
Definition at line 7797 of file SemaType.cpp.
References clang::FunctionProtoType::ExtProtoInfo::AArch64SMEAttributes, clang::FunctionType::ARM_None, clang::Sema::checkStringLiteralArgumentAttr(), clang::SemaBase::Diag(), clang::FunctionType::getArmZAState(), clang::FunctionType::getArmZT0State(), clang::AttributeCommonInfo::getLoc(), clang::FunctionProtoType::ExtProtoInfo::setArmSMEAttribute(), clang::FunctionType::SME_AgnosticZAStateMask, clang::FunctionType::SME_ZAShift, and clang::FunctionType::SME_ZT0Shift.
Referenced by handleFunctionTypeAttr().
|
static |
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.
Definition at line 8518 of file SemaType.cpp.
References clang::Type::castAs(), clang::Sema::Context, clang::SemaBase::Diag(), clang::ASTContext::getCharWidth(), clang::Sema::getLangOpts(), clang::AttributeCommonInfo::getLoc(), clang::Type::getSveEltType(), clang::ASTContext::getTargetInfo(), clang::ASTContext::getTypeSize(), clang::ASTContext::getVectorType(), clang::TargetInfo::hasFeature(), clang::Type::isSveVLSBuiltinType(), clang::SveFixedLengthData, clang::SveFixedLengthPredicate, and verifyValidIntegerConstantExpr().
Referenced by processTypeAttrs().
|
static |
Definition at line 6533 of file SemaType.cpp.
References clang::AANT_ArgumentString, clang::Sema::Context, clang::SemaBase::Diag(), and clang::AttributeCommonInfo::getLoc().
Referenced by processTypeAttrs().
|
static |
Process the OpenCL-like ext_vector_type attribute when it occurs on a type.
Definition at line 8314 of file SemaType.cpp.
References clang::Sema::BuildExtVectorType(), clang::SemaBase::Diag(), clang::AttributeCommonInfo::getLoc(), and clang::T.
Referenced by processTypeAttrs().
|
static |
Process an individual function attribute.
Returns true to indicate that the attribute was handled, false if it wasn't.
Definition at line 7851 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::cast(), clang::CC_X86FastCall, clang::CC_X86StdCall, clang::FunctionType::FunctionTypeExtraAttributeInfo::CFISalt, clang::Sema::CheckAttrNoArgs(), clang::Sema::CheckAttrTarget(), clang::Sema::CheckCallingConvAttr(), checkMutualExclusion(), clang::SemaObjC::checkNSReturnsRetainedReturnType(), clang::Sema::CheckRegparmAttr(), clang::Sema::checkStringLiteralArgumentAttr(), clang::Sema::Context, createSimpleAttr(), 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::FunctionProtoType::ExtProtoInfo::ExtraAttributeInfo, 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(), handleArmAgnosticAttribute(), handleArmStateAttribute(), handleNonBlockingNonAllocatingTypeAttr(), int, clang::FunctionProtoType::isVariadic(), clang::Sema::ObjC(), 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().
|
static |
Definition at line 8814 of file SemaType.cpp.
References clang::Type::isDependentType().
Referenced by processTypeAttrs().
|
static |
Definition at line 8791 of file SemaType.cpp.
References createSimpleAttr(), clang::ExpectedParameterOrImplicitObjectParameter, clang::AttributeCommonInfo::getLoc(), and clang::AttributeCommonInfo::isRegularKeywordAttribute().
Referenced by processTypeAttrs().
|
static |
Definition at line 8805 of file SemaType.cpp.
Referenced by processTypeAttrs().
|
static |
HandleMatrixTypeAttr - "matrix_type" attribute, like ext_vector_type.
Definition at line 8743 of file SemaType.cpp.
References clang::Sema::BuildMatrixType(), clang::SemaBase::Diag(), clang::Sema::getLangOpts(), clang::AttributeCommonInfo::getLoc(), and clang::T.
Referenced by processTypeAttrs().
|
static |
Definition at line 7067 of file SemaType.cpp.
References clang::Sema::Context, createSimpleAttr(), clang::Default, clang::SemaBase::Diag(), clang::ASTContext::getAddrSpaceQualType(), clang::Attr::getKind(), clang::ParsedAttr::getKind(), clang::AttributeCommonInfo::getLoc(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::TargetInfo::getPointerWidth(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::isa(), clang::Type::isMemberPointerType(), clang::ptr32_sptr, clang::ptr32_uptr, clang::ptr64, and clang::ASTContext::removeAddrSpaceQualType().
Referenced by processTypeAttrs().
|
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 8401 of file SemaType.cpp.
References clang::Sema::Context, clang::SemaBase::Diag(), clang::Sema::getLangOpts(), clang::AttributeCommonInfo::getLoc(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::ASTContext::getTypeSize(), clang::ASTContext::getVectorType(), clang::TargetInfo::hasFeature(), isPermittedNeonBaseType(), clang::LangOptions::isTargetDevice(), clang::Neon, clang::NeonPoly, and verifyValidIntegerConstantExpr().
Referenced by processTypeAttrs().
|
static |
Definition at line 7658 of file SemaType.cpp.
References clang::Sema::ActOnEffectExpression(), clang::FunctionEffect::Allocating, clang::FunctionEffect::Blocking, clang::ParsedAttr::checkAtMostNumArgs(), clang::Sema::CheckAttrNoArgs(), clang::Sema::Context, clang::Dependent, clang::SemaBase::Diag(), clang::Sema::diagnoseConflictingFunctionEffect(), clang::False, clang::FunctionProtoType::ExtProtoInfo::FunctionEffects, clang::ParsedAttr::getArgAsExpr(), clang::Type::getAs(), clang::AttributeCommonInfo::getAttrName(), clang::ASTContext::getFunctionType(), clang::ParsedAttr::getKind(), clang::AttributeCommonInfo::getLoc(), clang::IdentifierInfo::getName(), clang::ParsedAttr::getNumArgs(), clang::FunctionEffectSet::insert(), clang::FunctionEffect::NonAllocating, clang::FunctionEffect::NonBlocking, clang::None, clang::ParsedAttr::setInvalid(), clang::Success, and clang::True.
Referenced by handleFunctionTypeAttr().
|
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 6842 of file SemaType.cpp.
References clang::AANT_ArgumentString, 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().
|
static |
handleObjCOwnershipTypeAttr - Process an objc_ownership attribute on the specified type.
Returns 'true' if the attribute was handled.
Definition at line 6655 of file SemaType.cpp.
References clang::AANT_ArgumentString, clang::Sema::DelayedDiagnostics::add(), clang::Qualifiers::addObjCLifetime(), clang::Sema::Context, createSimpleAttr(), clang::Sema::DelayedDiagnostics, clang::SemaBase::Diag(), clang::CharSourceRange::getBegin(), clang::SourceManager::getExpansionLoc(), clang::SourceManager::getImmediateExpansionRange(), clang::Sema::getLangOpts(), clang::Declarator::getNumTypeObjects(), clang::Type::getPointeeType(), clang::ASTContext::getQualifiedType(), clang::SplitQualType::getSingleStepDesugaredType(), clang::Sema::getSourceManager(), clang::ASTContext::hasDirectOwnershipQualifier(), clang::SourceLocation::isMacroID(), clang::Type::isObjCRetainableType(), clang::Type::isPointerType(), clang::IdentifierInfo::isStr(), clang::SourceLocation::isValid(), clang::sema::DelayedDiagnostic::makeForbiddenType(), maybeMovePastReturnType(), clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, clang::SplitQualType::Quals, clang::Qualifiers::removeObjCLifetime(), clang::Sema::DelayedDiagnostics::shouldDelayDiagnostics(), TDS_ObjCObjOrBlock, clang::SplitQualType::Ty, and clang::ast_matchers::type.
Referenced by handleObjCPointerTypeAttr().
|
static |
Definition at line 415 of file SemaType.cpp.
References handleObjCGCTypeAttr(), handleObjCOwnershipTypeAttr(), and clang::ast_matchers::type.
Referenced by distributeObjCPointerTypeAttrFromDeclarator(), and processTypeAttrs().
|
static |
Handle OpenCL Access Qualifier Attribute.
Definition at line 8687 of file SemaType.cpp.
References clang::Type::castAs(), clang::Sema::Context, clang::SemaBase::Diag(), clang::Type::getAs(), clang::AttributeCommonInfo::getAttrName(), clang::AttributeCommonInfo::getLoc(), clang::IdentifierInfo::getName(), clang::AttributeCommonInfo::getRange(), clang::Attr::getSpelling(), clang::ASTContext::getWritePipeType(), clang::Type::isImageType(), and clang::Type::isPipeType().
Referenced by processTypeAttrs().
|
static |
Handle the __ptrauth qualifier.
Definition at line 8457 of file SemaType.cpp.
References clang::Addr, clang::Sema::checkConstantPointerAuthKey(), clang::Sema::checkPointerAuthDiscriminatorArg(), clang::Sema::Context, clang::PointerAuthQualifier::Create(), clang::SemaBase::Diag(), clang::Extra, clang::Sema::getLangOpts(), clang::AttributeCommonInfo::getLoc(), clang::ASTContext::getPointerAuthType(), clang::AttributeCommonInfo::getRange(), clang::PointerAuthQualifier::MaxKey, clang::SignAndAuth, and clang::T.
Referenced by processTypeAttrs().
|
static |
HandleRISCVRVVVectorBitsTypeAttr - The "riscv_rvv_vector_bits" attribute is used to create fixed-length versions of sizeless RVV types such as vint8m1_t_t.
Definition at line 8602 of file SemaType.cpp.
References clang::ASTContext::BoolTy, clang::Type::castAs(), clang::Sema::Context, clang::SemaBase::Diag(), ASTContext::BuiltinVectorTypeInfo::EC, ASTContext::BuiltinVectorTypeInfo::ElementType, clang::ASTContext::getBuiltinVectorTypeInfo(), clang::ASTContext::getCharWidth(), clang::Sema::getLangOpts(), clang::AttributeCommonInfo::getLoc(), clang::Type::getRVVEltType(), clang::ASTContext::getTargetInfo(), clang::ASTContext::getTypeSize(), clang::ASTContext::getVectorType(), clang::TargetInfo::getVScaleRange(), clang::TargetInfo::hasFeature(), clang::Type::isRVVVLSBuiltinType(), clang::TargetInfo::NotStreaming, clang::RVVFixedLengthData, clang::RVVFixedLengthMask, clang::RVVFixedLengthMask_1, clang::RVVFixedLengthMask_2, clang::RVVFixedLengthMask_4, and verifyValidIntegerConstantExpr().
Referenced by processTypeAttrs().
|
static |
Definition at line 7192 of file SemaType.cpp.
References clang::Sema::checkStringLiteralArgumentAttr(), clang::Sema::Context, clang::DeclaratorChunk::getAttrs(), moveAttrFromListToList(), clang::DeclaratorChunk::Paren, clang::ParsedAttr::setInvalid(), clang::ParsedAttr::setUsedAsTypeAttr(), TAL_DeclChunk, TAL_DeclName, and clang::TypeName.
Referenced by processTypeAttrs().
|
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 8294 of file SemaType.cpp.
References clang::Sema::BuildVectorType(), clang::SemaBase::Diag(), clang::AttributeCommonInfo::getLoc(), and clang::T.
Referenced by processTypeAttrs().
|
static |
Definition at line 7161 of file SemaType.cpp.
References clang::Sema::Context, createSimpleAttr(), clang::SemaBase::Diag(), clang::ASTContext::getAddrSpaceQualType(), clang::Attr::getKind(), clang::ParsedAttr::getKind(), clang::AttributeCommonInfo::getLoc(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::ASTContext::removeAddrSpaceQualType(), and clang::wasm_funcref.
Referenced by processTypeAttrs().
|
static |
Check whether there is a nullability attribute of any kind in the given attribute list.
Definition at line 3851 of file SemaType.cpp.
Referenced by distributeNullabilityTypeAttr(), and GetFullTypeForDeclarator().
|
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 4204 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().
|
static |
Given that we're building a pointer or reference to the given.
Definition at line 1682 of file SemaType.cpp.
References clang::Sema::DelayedDiagnostics::add(), clang::Qualifiers::addObjCLifetime(), clang::Sema::Context, clang::Sema::DelayedDiagnostics, clang::SemaBase::Diag(), clang::ASTContext::getQualifiedType(), clang::Sema::isUnevaluatedContext(), clang::sema::DelayedDiagnostic::makeForbiddenType(), clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Sema::DelayedDiagnostics::shouldDelayDiagnostics(), and clang::ast_matchers::type.
Referenced by clang::Sema::BuildPointerType(), and clang::Sema::BuildReferenceType().
|
static |
Given that this is the declaration of a parameter under ARC, attempt to infer attributes and such for pointer-to-whatever types.
Definition at line 2820 of file SemaType.cpp.
References clang::Qualifiers::addObjCLifetime(), clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::Sema::Context, clang::DeclaratorChunk::Function, clang::DeclaratorChunk::getAttrs(), clang::Declarator::getNumTypeObjects(), clang::QualType::getObjCLifetime(), clang::ASTContext::getQualifiedType(), clang::Declarator::getTypeObject(), clang::isBlockPointer(), clang::Type::isObjCARCImplicitlyUnretainedType(), clang::Type::isObjCObjectType(), clang::Type::isObjCRetainableType(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, and transferARCOwnershipToDeclaratorChunk().
Referenced by clang::Sema::GetTypeForDeclarator().
|
static |
Definition at line 3038 of file SemaType.cpp.
References clang::TemplateArgumentListInfo::addArgument(), clang::TemplateArgumentListInfo::arguments(), clang::Sema::AttachTypeConstraint(), clang::Auto, clang::InventedTemplateParameterInfo::AutoTemplateParameterDepth, clang::cast(), 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().
Definition at line 1572 of file SemaType.cpp.
References clang::T.
Referenced by clang::Sema::BuildAtomicType(), and clang::Sema::BuildQualifiedType().
|
static |
Definition at line 4228 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::Kind, and clang::DeclaratorChunk::Pointer.
Referenced by GetFullTypeForDeclarator().
|
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 65 of file SemaType.cpp.
References clang::BlockLiteral, 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().
|
static |
Definition at line 8329 of file SemaType.cpp.
References clang::Sema::Context, clang::Type::getAs(), clang::BuiltinType::getKind(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), and clang::NeonPoly.
Referenced by HandleNeonVectorTypeAttr().
|
static |
Map a nullability attribute kind to a nullability kind.
Definition at line 7267 of file SemaType.cpp.
References clang::NonNull, clang::Nullable, clang::NullableResult, and clang::Unspecified.
Referenced by CheckNullabilityTypeSpecifier(), and distributeNullabilityTypeAttr().
|
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.
| i | - a notional index which the search will start immediately inside |
| onlyBlockPointers | Whether we should only look into block pointer types (vs. all pointer types). |
Definition at line 432 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().
|
static |
Add a synthetic '()' to a block-literal declarator if it is required, given the return type.
Definition at line 758 of file SemaType.cpp.
References clang::Declarator::AddInnermostTypeInfo(), clang::EST_None, clang::Declarator::getBeginLoc(), clang::DeclaratorChunk::getFunction(), clang::Declarator::getFunctionTypeInfo(), clang::Declarator::getNumTypeObjects(), clang::DeclaratorChunk::FunctionTypeInfo::hasPrototype, clang::Declarator::isFunctionDeclarator(), and clang::Type::isFunctionType().
Referenced by ConvertDeclSpecToType().
|
static |
Definition at line 381 of file SemaType.cpp.
References clang::ParsedAttributesView::addAtEnd(), and clang::ParsedAttributesView::remove().
Referenced by distributeFunctionTypeAttr(), distributeFunctionTypeAttrToInnermost(), distributeNullabilityTypeAttr(), distributeObjCPointerTypeAttr(), distributeObjCPointerTypeAttrFromDeclarator(), and HandleSwiftAttr().
|
static |
Definition at line 8828 of file SemaType.cpp.
References clang::cast(), CheckNullabilityTypeSpecifier(), checkObjCKindOfType(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), createSimpleAttr(), diagnoseBadTypeAttribute(), distributeFunctionTypeAttr(), distributeFunctionTypeAttrFromDeclSpec(), distributeNullabilityTypeAttr(), distributeObjCPointerTypeAttr(), clang::ParsedAttributesView::empty(), FUNCTION_TYPE_ATTRS_CASELIST, HandleAddressSpaceTypeAttribute(), HandleAnnotateTypeAttr(), HandleArmMveStrictPolymorphismAttr(), HandleArmSveVectorBitsTypeAttr(), HandleBTFTypeTagAttribute(), HandleExtVectorTypeAttr(), handleFunctionTypeAttr(), HandleHLSLParamModifierAttr(), HandleLifetimeBoundAttr(), HandleLifetimeCaptureByAttr(), HandleMatrixTypeAttr(), handleMSPointerTypeQualifierAttr(), HandleNeonVectorTypeAttr(), handleObjCPointerTypeAttr(), HandleOpenCLAccessAttr(), HandlePtrAuthQualifier(), HandleRISCVRVVVectorBitsTypeAttr(), HandleSwiftAttr(), HandleVectorSizeAttr(), HandleWebAssemblyFuncrefAttr(), hasOuterPointerLikeChunk(), clang::AttributeCommonInfo::IgnoredAttribute, clang::isa(), MS_TYPE_ATTRS_CASELIST, clang::Neon, clang::NeonPoly, NULLABILITY_TYPE_ATTRS_CASELIST, OBJC_POINTER_TYPE_ATTRS_CASELIST, TAL_DeclChunk, TAL_DeclName, TAL_DeclSpec, clang::ast_matchers::type, and clang::AttributeCommonInfo::UnknownAttribute.
Referenced by ConvertDeclSpecToType(), GetDeclSpecTypeForDeclarator(), and GetFullTypeForDeclarator().
|
static |
Rebuild an attributed type without the nullability attribute on it.
Definition at line 7247 of file SemaType.cpp.
References clang::ASTContext::getAttributedType(), clang::QualType::getTypePtr(), and rebuildAttributedTypeWithoutNullability().
Referenced by CheckNullabilityTypeSpecifier(), and rebuildAttributedTypeWithoutNullability().
|
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.
Definition at line 4175 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().
Definition at line 4279 of file SemaType.cpp.
References clang::isa(), and clang::T.
Referenced by GetFullTypeForDeclarator().
|
static |
Used for transferring ownership in casts resulting in l-values.
Definition at line 5779 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::Function, clang::Declarator::getNumTypeObjects(), clang::Declarator::getTypeObject(), clang::Type::isObjCObjectType(), clang::Type::isObjCRetainableType(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, transferARCOwnershipToDeclaratorChunk(), and transferARCOwnershipToDeclSpec().
Referenced by clang::Sema::GetTypeForDeclaratorCast().
|
static |
Definition at line 5743 of file SemaType.cpp.
References clang::ParsedAttributesView::addAtEnd(), clang::Sema::Context, clang::AttributePool::create(), clang::IdentifierTable::get(), clang::Declarator::getAttributePool(), clang::DeclaratorChunk::getAttrs(), clang::Declarator::getTypeObject(), clang::ParsedAttributesView::hasAttribute(), clang::ASTContext::Idents, clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, and clang::IdentifierLoc::setIdentifierInfo().
Referenced by inferARCWriteback(), and transferARCOwnership().
|
static |
Definition at line 5732 of file SemaType.cpp.
References clang::Qualifiers::addObjCLifetime(), clang::Sema::Context, clang::QualType::getObjCLifetime(), clang::ASTContext::getQualifiedType(), clang::Type::isObjCRetainableType(), and clang::Qualifiers::OCL_None.
Referenced by transferARCOwnership().
|
static |
Definition at line 880 of file SemaType.cpp.
Referenced by ConvertDeclSpecToType().
|
static |
Definition at line 8378 of file SemaType.cpp.
References clang::AANT_ArgumentIntegerConstant, clang::Sema::Context, clang::SemaBase::Diag(), and clang::AttributeCommonInfo::getLoc().
Referenced by HandleArmSveVectorBitsTypeAttr(), HandleNeonVectorTypeAttr(), and HandleRISCVRVVVectorBitsTypeAttr().
|
static |
Produce an appropriate diagnostic for an ambiguity between a function declarator and a C++ direct-initializer.
Definition at line 3495 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::FullSourceLoc::getFileID(), clang::Sema::getFixItZeroInitializerForType(), clang::Declarator::getFunctionDefinitionKind(), clang::Declarator::getIdentifier(), clang::Declarator::getIdentifierLoc(), clang::Sema::getLocForEndOfToken(), clang::Decl::getSourceRange(), clang::FullSourceLoc::getSpellingLineNumber(), 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, clang::Result, clang::DeclSpec::SCS_unspecified, and clang::Sema::SourceMgr.
Referenced by GetFullTypeForDeclarator().
|
static |
Produce an appropriate diagnostic for a declarator with top-level parentheses.
Definition at line 3592 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::NestedNameSpecifier::getAsNamespaceAndPrefix(), clang::NestedNameSpecifier::getAsType(), clang::Declarator::getBeginLoc(), clang::Declarator::getContext(), clang::Sema::getCurScope(), clang::Declarator::getCXXScopeSpec(), clang::Declarator::getDeclSpec(), clang::Declarator::getEndLoc(), clang::Declarator::getIdentifier(), clang::NestedNameSpecifier::getKind(), clang::Sema::getLangOpts(), clang::Sema::getLocForEndOfToken(), clang::Declarator::getNumTypeObjects(), clang::DeclSpec::getParsedSpecifiers(), clang::Type::getPrefix(), clang::CXXScopeSpec::getScopeRep(), clang::Declarator::getTypeObject(), clang::DeclSpec::getTypeQualifiers(), clang::NestedNameSpecifier::Global, clang::Sema::inTemplateInstantiation(), clang::Declarator::isExpressionContext(), clang::Declarator::isFirstDeclarator(), clang::Declarator::isInvalidType(), clang::CXXScopeSpec::isValid(), clang::Sema::LookupName(), clang::Sema::LookupOrdinaryName, clang::DeclaratorChunk::MemberPointer, clang::NestedNameSpecifier::Namespace, clang::out, clang::DeclaratorChunk::Paren, Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclSpec::PQ_TypeSpecifier, clang::NamespaceAndPrefix::Prefix, clang::DeclaratorChunk::Reference, clang::Result, clang::T, clang::NestedNameSpecifier::Type, and clang::Declarator::type_objects().
Referenced by GetFullTypeForDeclarator().