clang 20.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/PartialDiagnostic.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/Specifiers.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/DeclSpec.h"
#include "clang/Sema/DelayedDiagnostic.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/ParsedAttr.h"
#include "clang/Sema/ParsedTemplate.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/SemaCUDA.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/SemaObjC.h"
#include "clang/Sema/SemaOpenMP.h"
#include "clang/Sema/Template.h"
#include "clang/Sema/TemplateInstCallback.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLForwardCompat.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include <bitset>
#include <optional>
#include "clang/Basic/TransformTypeTraits.def"
#include "clang/Basic/OpenCLImageTypes.def"
#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) case DeclSpec::TST_##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 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 | fillMatrixTypeLoc (MatrixTypeLoc MTL, const ParsedAttributesView &Attrs) |
static void | fillAtomicQualLoc (AtomicTypeLoc ATL, const DeclaratorChunk &Chunk) |
static void | fillDependentAddressSpaceTypeLoc (DependentAddressSpaceTypeLoc DASTL, const ParsedAttributesView &Attrs) |
static bool | BuildAddressSpaceIndex (Sema &S, LangAS &ASIdx, const Expr *AddrSpace, SourceLocation AttrLoc) |
Build an AddressSpace index from a constant expression and diagnose any errors related to invalid address_spaces. | |
static void | HandleBTFTypeTagAttribute (QualType &Type, const ParsedAttr &Attr, TypeProcessingState &State) |
static void | HandleAddressSpaceTypeAttribute (QualType &Type, const ParsedAttr &Attr, TypeProcessingState &State) |
HandleAddressSpaceTypeAttribute - Process an address_space attribute on the specified type. | |
static bool | HandleWebAssemblyFuncrefAttr (TypeProcessingState &State, QualType &QT, ParsedAttr &PAttr) |
static QualType | rebuildAttributedTypeWithoutNullability (ASTContext &Ctx, QualType Type) |
Rebuild an attributed type without the nullability attribute on it. | |
static NullabilityKind | mapNullabilityAttrKind (ParsedAttr::Kind kind) |
Map a nullability attribute kind to a nullability kind. | |
static bool | CheckNullabilityTypeSpecifier (Sema &S, TypeProcessingState *State, ParsedAttr *PAttr, QualType &QT, NullabilityKind Nullability, SourceLocation NullabilityLoc, bool IsContextSensitive, bool AllowOnArrayType, bool OverrideExisting) |
static bool | CheckNullabilityTypeSpecifier (TypeProcessingState &State, QualType &Type, ParsedAttr &Attr, bool AllowOnArrayType) |
static bool | checkObjCKindOfType (TypeProcessingState &state, QualType &type, ParsedAttr &attr) |
Check the application of the Objective-C '__kindof' qualifier to the given type. | |
static bool | distributeNullabilityTypeAttr (TypeProcessingState &state, QualType type, ParsedAttr &attr) |
Distribute a nullability type attribute that cannot be applied to the type specifier to a pointer, block pointer, or member pointer declarator, complaining if necessary. | |
static 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 | handleArmStateAttribute (Sema &S, FunctionProtoType::ExtProtoInfo &EPI, ParsedAttr &Attr, FunctionType::ArmStateValue State) |
static void | HandleVectorSizeAttr (QualType &CurType, const ParsedAttr &Attr, Sema &S) |
HandleVectorSizeAttribute - this attribute is only applicable to integral and float scalars, although arrays, pointers, and function return values are allowed in conjunction with this construct. | |
static void | HandleExtVectorTypeAttr (QualType &CurType, const ParsedAttr &Attr, Sema &S) |
Process the OpenCL-like ext_vector_type attribute when it occurs on a type. | |
static bool | isPermittedNeonBaseType (QualType &Ty, VectorKind VecKind, Sema &S) |
static bool | verifyValidIntegerConstantExpr (Sema &S, const ParsedAttr &Attr, llvm::APSInt &Result) |
static void | HandleNeonVectorTypeAttr (QualType &CurType, const ParsedAttr &Attr, Sema &S, VectorKind VecKind) |
HandleNeonVectorTypeAttr - The "neon_vector_type" and "neon_polyvector_type" attributes are used to create vector types that are mangled according to ARM's ABI. | |
static void | HandleArmSveVectorBitsTypeAttr (QualType &CurType, ParsedAttr &Attr, Sema &S) |
HandleArmSveVectorBitsTypeAttr - The "arm_sve_vector_bits" attribute is used to create fixed-length versions of sizeless SVE types defined by the ACLE, such as svint32_t and svbool_t. | |
static void | HandleArmMveStrictPolymorphismAttr (TypeProcessingState &State, QualType &CurType, ParsedAttr &Attr) |
static void | HandleRISCVRVVVectorBitsTypeAttr (QualType &CurType, ParsedAttr &Attr, Sema &S) |
HandleRISCVRVVVectorBitsTypeAttr - The "riscv_rvv_vector_bits" attribute is used to create fixed-length versions of sizeless RVV types such as vint8m1_t_t. | |
static void | HandleOpenCLAccessAttr (QualType &CurType, const ParsedAttr &Attr, Sema &S) |
Handle OpenCL Access Qualifier Attribute. | |
static void | HandleMatrixTypeAttr (QualType &CurType, const ParsedAttr &Attr, Sema &S) |
HandleMatrixTypeAttr - "matrix_type" attribute, like ext_vector_type. | |
static void | HandleAnnotateTypeAttr (TypeProcessingState &State, QualType &CurType, const ParsedAttr &PA) |
static void | HandleLifetimeBoundAttr (TypeProcessingState &State, QualType &CurType, ParsedAttr &Attr) |
static void | HandleHLSLParamModifierAttr (QualType &CurType, const ParsedAttr &Attr, Sema &S) |
static void | assignInheritanceModel (Sema &S, CXXRecordDecl *RD) |
Locks in the inheritance model for the given class and all of its bases. | |
static unsigned | getLiteralDiagFromTagKind (TagTypeKind Tag) |
Get diagnostic select index for tag kind for literal type diagnostic message. | |
static void | BuildTypeCoupledDecls (Expr *E, llvm::SmallVectorImpl< TypeCoupledDeclRefInfo > &Decls) |
static QualType | GetEnumUnderlyingType (Sema &S, QualType BaseType, SourceLocation Loc) |
static QualType | ChangeIntegralSignedness (Sema &S, QualType BaseType, bool IsMakeSigned, SourceLocation Loc) |
#define CALLING_CONV_ATTRS_CASELIST |
Definition at line 128 of file SemaType.cpp.
#define FUNCTION_TYPE_ATTRS_CASELIST |
Definition at line 152 of file SemaType.cpp.
#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 172 of file SemaType.cpp.
#define NULLABILITY_TYPE_ATTRS_CASELIST |
Definition at line 179 of file SemaType.cpp.
#define OBJC_POINTER_TYPE_ATTRS_CASELIST |
Definition at line 123 of file SemaType.cpp.
#define TRANSFORM_TYPE_TRAIT_DEF | ( | _, | |
Trait | |||
) | case DeclSpec::TST_##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 378 of file SemaType.cpp.
enum TypeDiagSelector |
Enumerator | |
---|---|
TDS_Function | |
TDS_Pointer | |
TDS_ObjCObjOrBlock |
Definition at line 58 of file SemaType.cpp.
|
static |
Locks in the inheritance model for the given class and all of its bases.
Definition at line 9053 of file SemaType.cpp.
References clang::Decl::addAttr(), clang::ASTConsumer::AssignInheritanceModel(), clang::CXXRecordDecl::calculateInheritanceModel(), clang::Sema::Consumer, clang::Sema::getASTContext(), clang::CXXRecordDecl::getMostRecentNonInjectedDecl(), clang::TagDecl::getSourceRange(), clang::Decl::hasAttr(), clang::Sema::ImplicitMSInheritanceAttrLoc, clang::SourceLocation::isValid(), Loc, 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 6388 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 9395 of file SemaType.cpp.
References E.
Referenced by clang::Sema::BuildCountAttributedArrayOrPointerType().
|
static |
Definition at line 9677 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::Type::isEnumeralType(), Loc, clang::ASTContext::LongLongTy, clang::ASTContext::LongTy, clang::Result, 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 1965 of file SemaType.cpp.
References clang::Sema::CCEK_ArrayBound, clang::Sema::CheckConvertedConstantExpression(), clang::Sema::Context, clang::SemaBase::Diag(), clang::Sema::getLangOpts(), clang::ASTContext::getSizeType(), clang::Expr::getType(), clang::Type::isIntegralOrUnscopedEnumerationType(), Loc, clang::T, and clang::Sema::VerifyIntegerConstantExpression().
Referenced by clang::Sema::BuildArrayType().
|
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 2551 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::Ordinary, clang::SwiftAsyncContext, clang::SwiftContext, clang::SwiftErrorResult, and clang::SwiftIndirectResult.
Referenced by clang::Sema::BuildFunctionType(), and GetFullTypeForDeclarator().
|
static |
Definition at line 7600 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 4062 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 7154 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::AttributedType::getNullabilityAttrKind(), clang::getNullabilitySpelling(), clang::Type::getPointeeType(), clang::QualType::getTypePtr(), clang::Implicit, clang::Type::isAnyPointerType(), clang::Type::isArrayType(), clang::Type::isMemberPointerType(), clang::Type::isObjCObjectPointerType(), rebuildAttributedTypeWithoutNullability(), recordNullabilitySeen(), clang::AttributedType::stripOuterNullability(), and clang::ast_matchers::typedefDecl.
Referenced by clang::Sema::CheckImplicitNullabilityTypeSpecifier(), CheckNullabilityTypeSpecifier(), and processTypeAttrs().
|
static |
Definition at line 7266 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 7291 of file SemaType.cpp.
References clang::ast_matchers::attr, clang::Sema::Context, createNullabilityAttr(), clang::SemaBase::Diag(), false, clang::ASTContext::getObjCObjectPointerType(), clang::ASTContext::getObjCObjectType(), clang::ObjCObjectPointerType::getObjectType(), 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 831 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 1757 of file SemaType.cpp.
References clang::SemaBase::Diag(), clang::Qualifiers::empty(), clang::Type::getAs(), getFunctionQualifiersAsString(), clang::FunctionProtoType::getMethodQuals(), clang::FunctionProtoType::getRefQualifier(), Loc, clang::RQ_None, and clang::T.
Referenced by clang::Sema::BuildBlockPointerType(), clang::Sema::BuildPointerType(), and clang::Sema::BuildReferenceType().
|
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 3824 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::ast_matchers::recordType, 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 886 of file SemaType.cpp.
References clang::ASTContext::AccumTy, clang::ParsedAttributesView::addAtEnd(), clang::TemplateArgumentListInfo::arguments(), clang::ASTContext::BFloat16Ty, clang::ASTContext::BoolTy, clang::Sema::BuildAtomicType(), clang::Sema::BuildBitIntType(), clang::Sema::BuildDecltypeType(), clang::Sema::BuildPackIndexingType(), clang::Sema::BuildQualifiedType(), clang::Sema::BuildTypeofExprType(), clang::Sema::BuildUnaryTransformType(), clang::ASTContext::Char16Ty, clang::ASTContext::Char32Ty, clang::ASTContext::Char8Ty, clang::ASTContext::CharTy, checkOmittedBlockReturnType(), clang::Sema::Context, clang::FixItHint::CreateInsertion(), D, clang::ASTContext::DependentTy, clang::SemaBase::Diag(), diagnoseAndRemoveTypeQualifiers(), clang::Sema::DiagnoseUseOfDecl(), clang::ASTContext::DoubleTy, E, clang::ASTContext::Float128Ty, clang::ASTContext::Float16Ty, clang::ASTContext::FloatTy, clang::ASTContext::FractTy, clang::DeclSpec::getAttributes(), clang::ASTContext::getAutoDeductType(), clang::ASTContext::getAutoType(), clang::DeclSpec::getBeginLoc(), clang::ASTContext::getComplexType(), clang::DeclSpec::getConstSpecLoc(), clang::Declarator::getContext(), clang::ASTContext::getCorrespondingSaturatedType(), clang::ASTContext::getCorrespondingUnsignedType(), clang::Declarator::getDeclarationAttributes(), clang::Sema::getElaboratedType(), clang::DeclSpec::getEllipsisLoc(), clang::Declarator::getIdentifierLoc(), clang::Sema::getLangOpts(), clang::Declarator::getMutableDeclSpec(), clang::LangOptions::getOpenCLCompatibleVersion(), clang::Sema::getOpenCLOptions(), clang::DeclSpec::getPackIndexingExpr(), clang::ASTContext::getPrintingPolicy(), clang::DeclSpec::getRepAsDecl(), clang::DeclSpec::getRepAsExpr(), clang::DeclSpec::getRepAsTemplateId(), clang::DeclSpec::getRepAsType(), clang::ASTContext::getSignedWCharType(), clang::DeclSpec::getSourceRange(), clang::DeclSpec::getSpecifierName(), clang::DeclSpec::getStorageClassSpec(), clang::ASTContext::getTargetInfo(), clang::ASTContext::getTypeDeclType(), clang::Sema::GetTypeFromParser(), clang::ASTContext::getTypeOfType(), clang::DeclSpec::getTypeQualifiers(), clang::ASTContext::getTypeSize(), clang::DeclSpec::getTypeSpecComplex(), clang::DeclSpec::getTypeSpecComplexLoc(), clang::DeclSpec::getTypeSpecSatLoc(), clang::DeclSpec::getTypeSpecScope(), clang::DeclSpec::getTypeSpecSign(), clang::DeclSpec::getTypeSpecSignLoc(), clang::DeclSpec::getTypeSpecType(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::DeclSpec::getTypeSpecTypeNameLoc(), clang::DeclSpec::getTypeSpecWidth(), clang::DeclSpec::getTypeSpecWidthLoc(), clang::ASTContext::getUnsignedWCharType(), clang::ASTContext::getVectorType(), clang::DeclSpec::getVolatileSpecLoc(), clang::ASTContext::HalfTy, clang::TargetInfo::hasBFloat16Type(), clang::TargetInfo::hasBitIntType(), clang::TargetInfo::hasFloat128Type(), clang::TargetInfo::hasFloat16Type(), clang::TargetInfo::hasIbm128Type(), clang::TargetInfo::hasInt128Type(), clang::DeclSpec::hasTypeSpecifier(), clang::ASTContext::Ibm128Ty, clang::ASTContext::Int128Ty, clang::ASTContext::IntTy, clang::OpenCLOptions::isAvailableOption(), clang::DeclSpec::isConstrainedAuto(), clang::LangOptions::isImplicitIntAllowed(), clang::LangOptions::isImplicitIntRequired(), clang::SourceLocation::isInvalid(), clang::OpenCLOptions::isSupported(), clang::DeclSpec::isTypeAltiVecBool(), clang::DeclSpec::isTypeAltiVecPixel(), clang::DeclSpec::isTypeAltiVecVector(), clang::DeclSpec::isTypeSpecOwned(), clang::DeclSpec::isTypeSpecPipe(), clang::DeclSpec::isTypeSpecSat(), clang::ASTContext::LongAccumTy, clang::ASTContext::LongDoubleTy, clang::ASTContext::LongFractTy, clang::ASTContext::LongLongTy, clang::ASTContext::LongTy, maybeSynthesizeBlockSignature(), processTypeAttrs(), clang::Qualified, clang::DeclSpec::SCS_typedef, clang::Declarator::setInvalidType(), clang::TemplateArgumentListInfo::setLAngleLoc(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::ASTContext::ShortAccumTy, clang::ASTContext::ShortFractTy, clang::ASTContext::ShortTy, clang::ASTContext::SignedCharTy, TAL_DeclSpec, clang::DeclSpec::TQ_atomic, clang::DeclSpec::TQ_const, clang::DeclSpec::TQ_volatile, clang::Sema::translateTemplateArguments(), clang::DeclSpec::TSC_complex, clang::DeclSpec::TSC_imaginary, clang::DeclSpec::TST_accum, clang::DeclSpec::TST_atomic, clang::DeclSpec::TST_auto, clang::DeclSpec::TST_auto_type, clang::DeclSpec::TST_BFloat16, clang::DeclSpec::TST_bitint, clang::DeclSpec::TST_bool, clang::DeclSpec::TST_char, clang::DeclSpec::TST_char16, clang::DeclSpec::TST_char32, clang::DeclSpec::TST_char8, clang::DeclSpec::TST_class, clang::DeclSpec::TST_decimal128, clang::DeclSpec::TST_decimal32, clang::DeclSpec::TST_decimal64, clang::DeclSpec::TST_decltype, clang::DeclSpec::TST_decltype_auto, clang::DeclSpec::TST_double, clang::DeclSpec::TST_enum, clang::DeclSpec::TST_error, clang::DeclSpec::TST_float, clang::DeclSpec::TST_float128, clang::DeclSpec::TST_float16, clang::DeclSpec::TST_fract, clang::DeclSpec::TST_half, clang::DeclSpec::TST_ibm128, clang::DeclSpec::TST_int, clang::DeclSpec::TST_int128, clang::DeclSpec::TST_interface, clang::DeclSpec::TST_struct, clang::DeclSpec::TST_typename, clang::DeclSpec::TST_typename_pack_indexing, clang::DeclSpec::TST_typeof_unqualExpr, clang::DeclSpec::TST_typeof_unqualType, clang::DeclSpec::TST_typeofExpr, clang::DeclSpec::TST_typeofType, clang::DeclSpec::TST_union, clang::DeclSpec::TST_unknown_anytype, clang::DeclSpec::TST_unspecified, clang::DeclSpec::TST_void, clang::DeclSpec::TST_wchar, TSTToUnaryTransformType(), clang::ASTContext::UnknownAnyTy, clang::ASTContext::UnsignedCharTy, clang::ASTContext::UnsignedInt128Ty, clang::ASTContext::UnsignedIntTy, clang::ASTContext::UnsignedLongLongTy, clang::ASTContext::UnsignedLongTy, clang::ASTContext::UnsignedShortTy, clang::ASTContext::VoidTy, and clang::ASTContext::WCharTy.
Referenced by GetDeclSpecTypeForDeclarator().
|
static |
Definition at line 4167 of file SemaType.cpp.
References clang::NonNull, clang::Nullable, clang::NullableResult, and clang::Unspecified.
Referenced by CheckNullabilityTypeSpecifier(), checkObjCKindOfType(), and GetFullTypeForDeclarator().
|
static |
Definition at line 4162 of file SemaType.cpp.
References clang::ParsedAttr::setUsedAsTypeAttr().
Definition at line 1783 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 803 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 83 of file SemaType.cpp.
References clang::ast_matchers::attr, 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 4189 of file SemaType.cpp.
References clang::Default, and clang::SemaBase::Diag().
Referenced by clang::Sema::BuildAddressSpaceAttr(), GetFullTypeForDeclarator(), and HandleAddressSpaceTypeAttribute().
|
static |
Definition at line 2902 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::PointerTypeInfo::AtomicQualLoc, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::PointerTypeInfo::ConstQualLoc, D, clang::Sema::diagnoseIgnoredQualifiers(), clang::DeclaratorChunk::Function, clang::QualType::getCVRQualifiers(), clang::Decl::getKind(), clang::QualType::getLocalCVRQualifiers(), clang::DeclaratorChunk::FunctionTypeInfo::getTrailingReturnTypeLoc(), 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 606 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::ast_matchers::attr, clang::DeclaratorChunk::BlockPointer, diagnoseBadTypeAttribute(), clang::DeclaratorChunk::Function, clang::DeclaratorChunk::getAttrs(), clang::Declarator::getTypeObject(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, moveAttrFromListToList(), clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, and clang::ast_matchers::type.
Referenced by processTypeAttrs().
|
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 677 of file SemaType.cpp.
References clang::ast_matchers::attr, 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 657 of file SemaType.cpp.
References clang::ast_matchers::attr, and 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 637 of file SemaType.cpp.
References clang::ast_matchers::attr, clang::DeclaratorChunk::Function, clang::DeclaratorChunk::getAttrs(), clang::Declarator::getNumTypeObjects(), clang::Declarator::getTypeObject(), handleFunctionTypeAttr(), clang::DeclaratorChunk::Kind, and moveAttrFromListToList().
Referenced by distributeFunctionTypeAttrFromDeclarator(), and distributeFunctionTypeAttrFromDeclSpec().
|
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 7349 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::ast_matchers::attr, 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 489 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::ast_matchers::attr, clang::DeclaratorChunk::BlockPointer, diagnoseBadTypeAttribute(), clang::DeclaratorChunk::Function, clang::DeclaratorChunk::getAttrs(), clang::Declarator::getTypeObject(), clang::DeclaratorChunk::Kind, maybeMovePastReturnType(), clang::DeclaratorChunk::MemberPointer, moveAttrFromListToList(), clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, and clang::ast_matchers::type.
Referenced by processTypeAttrs().
|
static |
Distribute an objc_gc type attribute that was written on the declarator.
Definition at line 545 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::ast_matchers::attr, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::Function, clang::DeclSpec::getAttributes(), clang::Declarator::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 706 of file SemaType.cpp.
References clang::ast_matchers::attr, distributeFunctionTypeAttrFromDeclarator(), distributeObjCPointerTypeAttrFromDeclarator(), FUNCTION_TYPE_ATTRS_CASELIST, MS_TYPE_ATTRS_CASELIST, NULLABILITY_TYPE_ATTRS_CASELIST, and OBJC_POINTER_TYPE_ATTRS_CASELIST.
Referenced by GetDeclSpecTypeForDeclarator().
|
static |
Definition at line 4028 of file SemaType.cpp.
References Diag(), clang::SemaBase::Diag(), fixItNullability(), clang::SourceLocation::isValid(), clang::NonNull, and clang::Nullable.
Referenced by checkNullabilityConsistency(), and recordNullabilitySeen().
|
static |
Definition at line 6197 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::PointerTypeInfo::AtomicQualLoc, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::Function, clang::DeclaratorChunk::Kind, Loc, 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 5781 of file SemaType.cpp.
References clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getTypePtr(), and clang::AttributedTypeLoc::setAttr().
Referenced by GetTypeSourceInfoForDeclarator().
|
static |
Definition at line 6222 of file SemaType.cpp.
References clang::DependentAddressSpaceTypeLoc::setAttrExprOperand(), clang::DependentAddressSpaceTypeLoc::setAttrNameLoc(), and clang::DependentAddressSpaceTypeLoc::setAttrOperandParensRange().
Referenced by GetTypeSourceInfoForDeclarator().
|
static |
Definition at line 5786 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 3993 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 3643 of file SemaType.cpp.
References CALLING_CONV_ATTRS_CASELIST, clang::CC_OpenCLKernel, clang::Sema::CheckCallingConvAttr(), clang::Sema::Context, clang::Sema::CUDA(), D, clang::DeclaratorChunk::Function, clang::ASTContext::getDefaultCallingConvention(), clang::Sema::getLangOpts(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::SemaCUDA::IdentifyTarget(), clang::DeclaratorChunk::FunctionTypeInfo::isVariadic, 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 7430 of file SemaType.cpp.
References clang::Attr::getKind().
Referenced by handleFunctionTypeAttr().
|
static |
Definition at line 3080 of file SemaType.cpp.
References clang::AliasDecl, clang::AliasTemplate, clang::Association, clang::Auto, clang::Block, clang::BlockLiteral, clang::Class, clang::Condition, clang::Sema::Context, clang::ConversionId, ConvertDeclSpecToType(), clang::Sema::CUDA(), clang::Sema::CurContext, clang::CXXCatch, clang::CXXNew, D, clang::DecltypeAuto, clang::ASTContext::DependentTy, clang::SemaBase::Diag(), distributeTypeAttrsFromDeclarator(), clang::Enum, clang::File, clang::ForInit, clang::FunctionalCast, clang::TemplateName::getAsTemplateDecl(), clang::SourceRange::getBegin(), clang::Type::getContainedDeducedType(), clang::Sema::getCurLambda(), clang::Sema::getCurScope(), clang::Decl::getKind(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::Decl::getSourceRange(), clang::Sema::getTemplateNameKindForDiagnostics(), clang::ASTContext::getTypeDeclType(), clang::Sema::GetTypeFromParser(), clang::GNUAutoType, clang::SemaCUDA::IdentifyTarget(), clang::IK_ConstructorName, clang::IK_ConstructorTemplateId, clang::IK_ConversionFunctionId, clang::IK_DeductionGuideName, clang::IK_DestructorName, clang::IK_Identifier, clang::IK_ImplicitSelfParam, clang::IK_LiteralOperatorId, clang::IK_OperatorFunctionId, clang::IK_TemplateId, int, clang::Interface, clang::ASTContext::IntTy, clang::Sema::InventedParameterInfos, InventTemplateParameter(), clang::TagDecl::isCompleteDefinition(), clang::Scope::isFunctionDeclarationScope(), clang::KNRTypeList, clang::LambdaExpr, clang::LambdaExprParameter, clang::Member, clang::Sema::NoteTemplateLocation(), clang::ObjCCatch, clang::ObjCParameter, clang::ObjCResult, clang::DeclSpec::PQ_TypeSpecifier, processTypeAttrs(), clang::Prototype, clang::RequiresExpr, clang::DeclSpec::SCS_typedef, clang::SelectionInit, clang::TagDecl::setEmbeddedInDeclarator(), clang::Struct, clang::T, TAL_DeclSpec, clang::TemplateArg, clang::TemplateParam, clang::TemplateTypeArg, clang::TrailingReturn, clang::TrailingReturnVar, clang::TypeName, clang::Union, and clang::ASTContext::VoidTy.
Referenced by clang::Sema::GetTypeForDeclarator(), and clang::Sema::GetTypeForDeclaratorCast().
|
static |
Definition at line 9554 of file SemaType.cpp.
References clang::Type::castAs(), clang::Sema::DiagnoseUseOfDecl(), clang::EnumDecl::getIntegerType(), clang::Type::isEnumeralType(), clang::QualType::isNull(), and Loc.
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 4217 of file SemaType.cpp.
References clang::Qualifiers::addAddressSpace(), clang::ParsedAttributesView::addAtEnd(), clang::Qualifiers::addCVRUQualifiers(), clang::AliasDecl, clang::AliasTemplate, clang::TargetInfo::allowHalfArgsAndReturns(), clang::DeclaratorChunk::Arr, clang::DeclaratorChunk::Array, clang::Association, clang::ast_matchers::attr, clang::Auto, clang::Block, clang::BlockLiteral, clang::DeclaratorChunk::BlockPointer, clang::Sema::BuildArrayType(), clang::Sema::BuildBlockPointerType(), clang::Sema::BuildMemberPointerType(), clang::Sema::BuildParenType(), clang::Sema::BuildPointerType(), clang::Sema::BuildQualifiedType(), clang::Sema::BuildReadPipeType(), clang::Sema::BuildReferenceType(), clang::C, clang::Type::castAs(), clang::Sema::CheckDistantExceptionSpec(), clang::Sema::checkExceptionSpecification(), checkExtParameterInfos(), checkNullabilityConsistency(), classifyPointerDeclarator(), clang::DeclaratorChunk::Cls, clang::Sema::CodeSynthesisContexts, clang::Sema::computeDeclContext(), clang::Condition, clang::Constexpr, clang::Type::containsUnexpandedParameterPack(), clang::Sema::Context, clang::ConversionId, clang::FixItHint::CreateInsertion(), createNullabilityAttr(), clang::FixItHint::CreateRemoval(), clang::Sema::CUDA(), clang::CXXCatch, clang::CXXNew, D, clang::Default, clang::Definition, clang::ASTContext::DependentTy, Diag(), clang::SemaBase::Diag(), DiagnoseMultipleAddrSpaceAttributes(), diagnoseRedundantReturnTypeQualifiers(), clang::ASTContext::DoubleTy, clang::ObjCDeclSpec::DQ_CSNullability, E, 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::NestedNameSpecifier::getAsIdentifier(), clang::NestedNameSpecifier::getAsType(), clang::Decl::getAttr(), clang::DeclSpec::getAttributes(), clang::DeclaratorChunk::getAttrs(), clang::CharSourceRange::getBegin(), clang::TypeLoc::getBeginLoc(), clang::CXXScopeSpec::getBeginLoc(), clang::Decl::getBeginLoc(), clang::ASTContext::getBuiltinVaListDecl(), getCCForDeclaratorChunk(), clang::Type::getContainedAutoType(), clang::Sema::getCurLambda(), clang::Sema::getDefaultCXXMethodAddrSpace(), clang::ASTContext::getDependentNameType(), clang::ASTContext::getElaboratedType(), clang::DeclaratorChunk::FunctionTypeInfo::getEllipsisLoc(), clang::TypeLoc::getEndLoc(), clang::Decl::getEndLoc(), clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecLocBeg(), clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecType(), clang::FunctionProtoType::getExtProtoInfo(), clang::ASTContext::getFunctionNoProtoType(), getFunctionQualifiersAsString(), clang::ASTContext::getFunctionType(), clang::SourceManager::getImmediateExpansionRange(), clang::Decl::getKind(), clang::NestedNameSpecifier::getKind(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::Sema::getLocForEndOfToken(), clang::DeclaratorChunk::FunctionTypeInfo::getLParenLoc(), clang::Type::getNullability(), clang::Sema::getNullabilityKeyword(), clang::DeclaratorChunk::FunctionTypeInfo::getNumExceptions(), clang::ASTContext::getObjCObjectPointerType(), clang::LangOptions::getOpenCLCompatibleVersion(), clang::Sema::getOpenCLOptions(), clang::ASTContext::getPackExpansionType(), clang::FunctionProtoType::getParamTypes(), clang::Preprocessor::getPragmaAssumeNonNullLoc(), clang::NestedNameSpecifier::getPrefix(), clang::ASTContext::getPromotedIntegerType(), clang::CXXScopeSpec::getRange(), clang::DeclaratorChunk::FunctionTypeInfo::getRefQualifierLoc(), clang::FunctionType::getReturnType(), clang::DeclaratorChunk::FunctionTypeInfo::getRParenLoc(), clang::CXXScopeSpec::getScopeRep(), clang::Sema::getSourceManager(), clang::Decl::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::DeclaratorChunk::FunctionTypeInfo::getTrailingReturnType(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ValueDecl::getType(), clang::ASTContext::getTypeDeclType(), clang::Sema::GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclSpec::getTypeQualifiers(), clang::TypeLocBuilder::getTypeSourceInfo(), GetTypeSourceInfoForDeclarator(), clang::NestedNameSpecifier::Global, clang::Decl::hasAttr(), clang::DeclaratorChunk::FunctionTypeInfo::hasMethodTypeQualifiers(), hasNullabilityAttr(), hasOuterPointerLikeChunk(), clang::DeclaratorChunk::FunctionTypeInfo::hasPrototype, clang::QualType::hasQualifiers(), clang::DeclaratorChunk::FunctionTypeInfo::hasRefQualifier(), clang::DeclaratorChunk::ReferenceTypeInfo::HasRestrict, clang::DeclaratorChunk::ArrayTypeInfo::hasStatic, clang::FunctionProtoType::ExtProtoInfo::HasTrailingReturn, clang::DeclaratorChunk::FunctionTypeInfo::hasTrailingReturnType(), clang::DeclaratorChunk::ParamInfo::Ident, clang::NestedNameSpecifier::Identifier, clang::SemaCUDA::IdentifyTarget(), clang::DeclaratorChunk::ParamInfo::IdentLoc, clang::IK_ConversionFunctionId, clang::IK_DeductionGuideName, clang::ASTContext::IntTy, clang::Sema::InventedParameterInfos, InventTemplateParameter(), clang::DeclaratorChunk::FunctionTypeInfo::isAmbiguous, clang::Type::isArrayType(), clang::Type::isAtomicType(), clang::OpenCLOptions::isAvailableOption(), clang::Type::isBlockPointerType(), clang::isComputedNoexcept(), clang::AutoType::isDecltypeAuto(), clang::Sema::isDependentScopeSpecifier(), clang::Type::isDependentType(), clang::Type::isFunctionProtoType(), clang::Type::isFunctionType(), clang::Type::isHalfType(), clang::Type::isImageType(), clang::SourceLocation::isInvalid(), clang::CXXScopeSpec::isInvalid(), clang::SourceLocation::isMacroID(), clang::Type::isMemberPointerType(), IsNoDerefableChunk(), clang::QualType::isNull(), clang::Type::isObjCObjectType(), clang::Type::isObjectType(), clang::Type::isPipeType(), clang::ASTContext::isPromotableIntegerType(), clang::DeclContext::isRecord(), clang::Type::isRecordType(), clang::Type::isSamplerT(), clang::DeclaratorChunk::ArrayTypeInfo::isStar, clang::SourceLocation::isValid(), clang::DeclaratorChunk::FunctionTypeInfo::isVariadic, clang::Type::isVoidType(), clang::DeclaratorChunk::Kind, clang::KNRTypeList, clang::LambdaExpr, clang::LambdaExprParameter, clang::DeclaratorChunk::Loc, Loc, clang::DeclaratorChunk::ReferenceTypeInfo::LValueRef, clang::DeclaratorChunk::Mem, clang::Member, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::FunctionTypeInfo::MethodQualifiers, clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, clang::DeclaratorChunk::FunctionTypeInfo::NoexceptExpr, clang::None, clang::NonNull, clang::Normal, clang::Nullable, clang::DeclaratorChunk::ArrayTypeInfo::NumElts, clang::DeclaratorChunk::FunctionTypeInfo::NumParams, clang::ObjCCatch, clang::ObjCParameter, clang::ObjCResult, P, clang::DeclaratorChunk::ParamInfo::Param, clang::DeclaratorChunk::FunctionTypeInfo::Params, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::Sema::PP, processTypeAttrs(), clang::Prototype, clang::DeclaratorChunk::Ptr, clang::TypeLocBuilder::push(), clang::TypeLocBuilder::pushFullCopy(), clang::DeclaratorChunk::TypeAndRange::Range, recordNullabilitySeen(), clang::DeclaratorChunk::Ref, clang::DeclaratorChunk::Reference, clang::FunctionProtoType::ExtProtoInfo::RefQualifier, clang::DeclaratorChunk::FunctionTypeInfo::RefQualifierIsLValueRef, clang::Qualifiers::removeCVRQualifiers(), clang::RequiresExpr, clang::LangOptions::requiresStrictPrototypes(), clang::Qualifiers::Restrict, clang::RQ_LValue, clang::RQ_None, clang::RQ_RValue, clang::DeclaratorChunk::MemberPointerTypeInfo::Scope(), clang::DeclSpec::SCS_static, clang::DeclSpec::SCS_typedef, clang::SelectionInit, clang::Decl::setInvalidDecl(), clang::ParmVarDecl::setKNRPromoted(), clang::ObjCObjectPointerTypeLoc::setStarLoc(), clang::ValueDecl::setType(), shouldHaveNullability(), clang::Sema::SourceMgr, clang::Star, clang::Static, clang::NestedNameSpecifier::Super, clang::T, TAL_DeclChunk, TAL_DeclName, TAL_DeclSpec, clang::TemplateArg, clang::TemplateParam, clang::TemplateTypeArg, clang::DeclSpec::TQ_const, clang::TrailingReturn, clang::TrailingReturnVar, clang::DeclSpec::TST_auto, clang::DeclaratorChunk::TypeAndRange::Ty, clang::TypeName, clang::FunctionProtoType::ExtProtoInfo::TypeQuals, clang::DeclaratorChunk::PointerTypeInfo::TypeQuals, clang::DeclaratorChunk::ArrayTypeInfo::TypeQuals, clang::DeclaratorChunk::BlockPointerTypeInfo::TypeQuals, clang::DeclaratorChunk::MemberPointerTypeInfo::TypeQuals, clang::NestedNameSpecifier::TypeSpec, clang::NestedNameSpecifier::TypeSpecWithTemplate, clang::FunctionProtoType::ExtProtoInfo::Variadic, warnAboutAmbiguousFunction(), and warnAboutRedundantParens().
Referenced by clang::Sema::GetTypeForDeclarator(), and clang::Sema::GetTypeForDeclaratorCast().
|
static |
Definition at line 1718 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 861 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 9262 of file SemaType.cpp.
References clang::Class, clang::Interface, and clang::Struct.
Referenced by clang::Sema::RequireLiteralType().
|
static |
Definition at line 3953 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 1553 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 6246 of file SemaType.cpp.
References clang::TypeLoc::castAs(), clang::Sema::Context, clang::ASTContext::CreateTypeSourceInfo(), D, fillAtomicQualLoc(), fillAttributedTypeLoc(), fillDependentAddressSpaceTypeLoc(), clang::TypeLoc::getAs(), clang::Decl::getAttrs(), clang::TypeLoc::getFullDataSize(), clang::TypeLoc::getNextTypeLoc(), clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getNextTypeLoc(), clang::TypeLoc::getOpaqueData(), clang::TypeSourceInfo::getTypeLoc(), clang::UnqualTypeLoc::getTypeLocClass(), clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getTypePtr(), clang::TypeLoc::getUnqualifiedLoc(), 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 6493 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 8468 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 8288 of file SemaType.cpp.
References clang::AttributeCommonInfo::getLoc(), clang::VectorType::getVectorKind(), and clang::Neon.
Referenced by processTypeAttrs().
|
static |
Definition at line 7620 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_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 8224 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 6463 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 8074 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 7668 of file SemaType.cpp.
References clang::ASTContext::adjustFunctionType(), clang::FunctionType::ARM_In, clang::FunctionType::ARM_InOut, clang::FunctionType::ARM_Out, clang::FunctionType::ARM_Preserves, clang::ast_matchers::attr, clang::CC_X86FastCall, clang::CC_X86StdCall, clang::Sema::CheckAttrNoArgs(), clang::Sema::CheckAttrTarget(), clang::Sema::CheckCallingConvAttr(), checkMutualExclusion(), clang::SemaObjC::checkNSReturnsRetainedReturnType(), clang::Sema::CheckRegparmAttr(), clang::Sema::Context, clang::SemaBase::Diag(), clang::Equivalent, clang::EST_BasicNoexcept, clang::EST_DependentNoexcept, clang::EST_Dynamic, clang::EST_DynamicNone, clang::EST_MSAny, clang::EST_NoexceptFalse, clang::EST_NoexceptTrue, clang::EST_None, clang::EST_NoThrow, clang::EST_Unevaluated, clang::EST_Uninstantiated, clang::EST_Unparsed, clang::ExpectedFunctionWithProtoType, clang::Type::getAs(), clang::FunctionType::getCallConv(), clang::Sema::getCallingConvAttributedType(), getCCTypeAttr(), clang::ASTContext::getFunctionType(), clang::ASTContext::getFunctionTypeWithExceptionSpec(), clang::FunctionType::getHasRegParm(), clang::Sema::getLangOpts(), clang::FunctionType::getNameForCallConv(), handleArmStateAttribute(), 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, clang::Sema::VariadicFunction, clang::FunctionType::ExtInfo::withCmseNSCall(), clang::FunctionType::ExtInfo::withNoCallerSavedRegs(), clang::FunctionType::ExtInfo::withNoCfCheck(), clang::FunctionType::ExtInfo::withNoReturn(), clang::FunctionType::ExtInfo::withProducesResult(), and clang::FunctionType::ExtInfo::withRegParm().
Referenced by distributeFunctionTypeAttrToInnermost(), and processTypeAttrs().
|
static |
Definition at line 8506 of file SemaType.cpp.
References clang::Sema::getASTContext(), clang::ASTContext::getLValueReferenceType(), and clang::Type::isDependentType().
Referenced by processTypeAttrs().
|
static |
Definition at line 8496 of file SemaType.cpp.
Referenced by processTypeAttrs().
|
static |
HandleMatrixTypeAttr - "matrix_type" attribute, like ext_vector_type.
Definition at line 8448 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 6987 of file SemaType.cpp.
References clang::Sema::Context, clang::Default, clang::SemaBase::Diag(), clang::ASTContext::getAddrSpaceQualType(), clang::AttributedType::getAttrKind(), clang::Attr::getKind(), clang::ParsedAttr::getKind(), clang::AttributeCommonInfo::getLoc(), clang::AttributedType::getModifiedType(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::TargetInfo::getPointerWidth(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), 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 8160 of file SemaType.cpp.
References clang::Sema::Context, clang::SemaBase::Diag(), clang::Sema::getASTContext(), clang::ASTContext::getAuxTargetInfo(), clang::Sema::getLangOpts(), clang::AttributeCommonInfo::getLoc(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::ASTContext::getTypeSize(), clang::ASTContext::getVectorType(), clang::TargetInfo::hasFeature(), isPermittedNeonBaseType(), clang::Neon, clang::NeonPoly, and verifyValidIntegerConstantExpr().
Referenced by processTypeAttrs().
|
static |
Definition at line 7515 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 6763 of file SemaType.cpp.
References clang::AANT_ArgumentString, clang::ast_matchers::attr, clang::Sema::Context, clang::SemaBase::Diag(), clang::Qualifiers::GCNone, clang::ASTContext::getObjCGCQualType(), clang::IdentifierInfo::isStr(), clang::Qualifiers::Strong, clang::ast_matchers::type, and clang::Qualifiers::Weak.
Referenced by handleObjCPointerTypeAttr().
|
static |
handleObjCOwnershipTypeAttr - Process an objc_ownership attribute on the specified type.
Returns 'true' if the attribute was handled.
Definition at line 6576 of file SemaType.cpp.
References clang::AANT_ArgumentString, clang::Sema::DelayedDiagnostics::add(), clang::Qualifiers::addObjCLifetime(), clang::ast_matchers::attr, clang::Class, clang::Sema::Context, D, clang::Sema::DelayedDiagnostics, clang::SemaBase::Diag(), clang::CharSourceRange::getBegin(), clang::SourceManager::getExpansionLoc(), clang::SourceManager::getImmediateExpansionRange(), clang::Sema::getLangOpts(), 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 404 of file SemaType.cpp.
References clang::ast_matchers::attr, handleObjCGCTypeAttr(), handleObjCOwnershipTypeAttr(), and clang::ast_matchers::type.
Referenced by distributeObjCPointerTypeAttrFromDeclarator(), and processTypeAttrs().
|
static |
Handle OpenCL Access Qualifier Attribute.
Definition at line 8392 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 |
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 8308 of file SemaType.cpp.
References clang::ASTContext::BoolTy, clang::Type::castAs(), clang::Sema::Context, clang::SemaBase::Diag(), clang::ASTContext::BuiltinVectorTypeInfo::EC, clang::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::RVVFixedLengthData, clang::RVVFixedLengthMask, clang::RVVFixedLengthMask_1, clang::RVVFixedLengthMask_2, clang::RVVFixedLengthMask_4, and verifyValidIntegerConstantExpr().
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 8054 of file SemaType.cpp.
References clang::Sema::BuildVectorType(), clang::SemaBase::Diag(), clang::AttributeCommonInfo::getLoc(), and clang::T.
Referenced by processTypeAttrs().
|
static |
Definition at line 7084 of file SemaType.cpp.
References clang::Sema::Context, 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 3777 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 4132 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, D, clang::DeclaratorChunk::Function, 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 1667 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 2755 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 2973 of file SemaType.cpp.
References clang::TemplateArgumentListInfo::addArgument(), clang::TemplateArgumentListInfo::arguments(), clang::Sema::AttachTypeConstraint(), clang::Auto, clang::InventedTemplateParameterInfo::AutoTemplateParameterDepth, clang::Sema::Context, clang::TemplateTypeParmDecl::Create(), D, clang::Sema::DiagnoseUnexpandedParameterPack(), clang::OpaquePtr< PtrTy >::get(), clang::AutoTypeLoc::getArgLoc(), clang::TemplateName::getAsTemplateDecl(), clang::TemplateName::getAsUsingShadowDecl(), clang::AutoTypeLoc::getConceptNameInfo(), clang::TypeLoc::getContainedAutoTypeLoc(), clang::AutoTypeLoc::getFoundDecl(), clang::AutoTypeLoc::getLAngleLoc(), clang::AutoTypeLoc::getNamedConcept(), clang::AutoTypeLoc::getNestedNameSpecifierLoc(), clang::AutoTypeLoc::getNumArgs(), clang::AutoTypeLoc::getRAngleLoc(), clang::TemplateIdAnnotation::getTemplateArgs(), clang::ASTContext::getTranslationUnitDecl(), clang::TypeDecl::getTypeForDecl(), clang::TypeSourceInfo::getTypeLoc(), clang::AutoTypeLoc::hasExplicitTemplateArgs(), clang::Invalid, clang::Sema::InventAbbreviatedTemplateParameterTypeName(), 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 1560 of file SemaType.cpp.
References clang::Type::isDependentType(), and clang::T.
Referenced by clang::Sema::BuildAtomicType(), and clang::Sema::BuildQualifiedType().
|
static |
Definition at line 4156 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 66 of file SemaType.cpp.
References D, and clang::DeclaratorChunk::Function.
Referenced by checkOmittedBlockReturnType().
|
static |
Definition at line 8089 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 7135 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 421 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 747 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 370 of file SemaType.cpp.
References clang::ParsedAttributesView::addAtEnd(), clang::ast_matchers::attr, and clang::ParsedAttributesView::remove().
Referenced by distributeFunctionTypeAttr(), distributeFunctionTypeAttrToInnermost(), distributeNullabilityTypeAttr(), distributeObjCPointerTypeAttr(), and distributeObjCPointerTypeAttrFromDeclarator().
|
static |
Definition at line 8517 of file SemaType.cpp.
References clang::ast_matchers::attr, CheckNullabilityTypeSpecifier(), checkObjCKindOfType(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), diagnoseBadTypeAttribute(), distributeFunctionTypeAttr(), distributeFunctionTypeAttrFromDeclSpec(), distributeNullabilityTypeAttr(), distributeObjCPointerTypeAttr(), clang::ParsedAttributesView::empty(), FUNCTION_TYPE_ATTRS_CASELIST, HandleAddressSpaceTypeAttribute(), HandleAnnotateTypeAttr(), HandleArmMveStrictPolymorphismAttr(), HandleArmSveVectorBitsTypeAttr(), HandleBTFTypeTagAttribute(), HandleExtVectorTypeAttr(), handleFunctionTypeAttr(), HandleHLSLParamModifierAttr(), HandleLifetimeBoundAttr(), HandleMatrixTypeAttr(), handleMSPointerTypeQualifierAttr(), HandleNeonVectorTypeAttr(), handleObjCPointerTypeAttr(), HandleOpenCLAccessAttr(), HandleRISCVRVVVectorBitsTypeAttr(), HandleVectorSizeAttr(), HandleWebAssemblyFuncrefAttr(), hasOuterPointerLikeChunk(), clang::AttributeCommonInfo::IgnoredAttribute, 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 7116 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 4103 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 4207 of file SemaType.cpp.
References clang::Type::canHaveNullability(), clang::Type::getCanonicalTypeInternal(), and clang::T.
Referenced by GetFullTypeForDeclarator().
|
static |
Used for transferring ownership in casts resulting in l-values.
Definition at line 5715 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, D, clang::DeclaratorChunk::Function, 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 5678 of file SemaType.cpp.
References clang::ParsedAttributesView::addAtEnd(), clang::ast_matchers::attr, clang::Sema::Context, D, clang::IdentifierTable::get(), clang::DeclaratorChunk::getAttrs(), clang::ParsedAttributesView::hasAttribute(), clang::IdentifierLoc::Ident, clang::ASTContext::Idents, clang::IdentifierLoc::Loc, clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, and clang::Qualifiers::OCL_Weak.
Referenced by inferARCWriteback(), and transferARCOwnership().
|
static |
Definition at line 5667 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 869 of file SemaType.cpp.
Referenced by ConvertDeclSpecToType().
|
static |
Definition at line 8137 of file SemaType.cpp.
References clang::AANT_ArgumentIntegerConstant, clang::Sema::Context, clang::SemaBase::Diag(), clang::AttributeCommonInfo::getLoc(), and clang::Result.
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 3427 of file SemaType.cpp.
References clang::Condition, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), clang::Sema::CurContext, D, clang::Declaration, clang::SemaBase::Diag(), E, clang::DeclaratorChunk::EndLoc, clang::DeclaratorChunk::Fun, clang::Type::getAsCXXRecordDecl(), clang::SourceRange::getBegin(), clang::Sema::getCurScope(), clang::SourceRange::getEnd(), clang::Sema::getFixItZeroInitializerForType(), clang::Sema::getLocForEndOfToken(), clang::Decl::getSourceRange(), clang::CXXRecordDecl::hasDefinition(), clang::CXXRecordDecl::hasUserProvidedDefaultConstructor(), clang::Init, clang::DeclaratorChunk::FunctionTypeInfo::isAmbiguous, clang::CXXRecordDecl::isEmpty(), clang::DeclContext::isFunctionOrMethod(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::Type::isVoidType(), clang::Sema::LangOpts, clang::DeclaratorChunk::Loc, clang::Sema::LookupName(), clang::Sema::LookupOrdinaryName, clang::DeclaratorChunk::FunctionTypeInfo::NumParams, clang::DeclaratorChunk::ParamInfo::Param, clang::DeclaratorChunk::FunctionTypeInfo::Params, Range, clang::Result, clang::DeclSpec::SCS_unspecified, and clang::Sema::SourceMgr.
Referenced by GetFullTypeForDeclarator().
|
static |
Produce an appropriate diagnostic for a declarator with top-level parentheses.
Definition at line 3524 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::C, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::CXXNew, D, clang::SemaBase::Diag(), clang::DeclaratorChunk::Function, clang::Type::getAsCXXRecordDecl(), clang::Decl::getBeginLoc(), clang::Sema::getCurScope(), clang::Decl::getEndLoc(), clang::Sema::getLangOpts(), clang::Sema::getLocForEndOfToken(), clang::NestedNameSpecifier::Global, clang::Sema::inTemplateInstantiation(), clang::Type::isDependentType(), clang::Type::isRecordType(), clang::Sema::LookupName(), clang::Sema::LookupOrdinaryName, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::Paren, Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclSpec::PQ_TypeSpecifier, clang::DeclaratorChunk::Reference, clang::Result, and clang::T.
Referenced by GetFullTypeForDeclarator().