clang 17.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/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/AST/Type.h"
#include "clang/AST/TypeLoc.h"
#include "clang/AST/TypeLocVisitor.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/Specifiers.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/DeclSpec.h"
#include "clang/Sema/DelayedDiagnostic.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/ParsedTemplate.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/Template.h"
#include "clang/Sema/TemplateInstCallback.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallString.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"
Go to the source code of this file.
Macros | |
#define | OBJC_POINTER_TYPE_ATTRS_CASELIST |
#define | CALLING_CONV_ATTRS_CASELIST |
#define | FUNCTION_TYPE_ATTRS_CASELIST |
#define | MS_TYPE_ATTRS_CASELIST |
#define | NULLABILITY_TYPE_ATTRS_CASELIST |
#define | TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait) |
#define | TRANSFORM_TYPE_TRAIT_DEF(_, Trait) case DeclSpec::TST_##Trait: |
#define | GENERIC_IMAGE_TYPE(ImgType, Id) |
#define | IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) |
Enumerations | |
enum | TypeDiagSelector { TDS_Function , TDS_Pointer , TDS_ObjCObjOrBlock } |
enum | TypeAttrLocation { TAL_DeclSpec , TAL_DeclChunk , TAL_DeclName } |
The location of a type attribute. More... | |
Functions | |
static bool | isOmittedBlockReturnType (const Declarator &D) |
isOmittedBlockReturnType - Return true if this declarator is missing a return type because this is a omitted return type on a block literal. | |
static void | diagnoseBadTypeAttribute (Sema &S, const ParsedAttr &attr, QualType type) |
diagnoseBadTypeAttribute - Diagnoses a type attribute which doesn't apply to the given type. | |
static void | moveAttrFromListToList (ParsedAttr &attr, ParsedAttributesView &fromList, ParsedAttributesView &toList) |
static void | processTypeAttrs (TypeProcessingState &state, QualType &type, TypeAttrLocation TAL, const ParsedAttributesView &attrs) |
static bool | handleFunctionTypeAttr (TypeProcessingState &state, ParsedAttr &attr, QualType &type) |
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) |
Try to distribute a function type attribute to the innermost function chunk or type. | |
static void | distributeFunctionTypeAttrFromDeclSpec (TypeProcessingState &state, ParsedAttr &attr, QualType &declSpecType) |
A function type attribute was written in the decl spec. | |
static void | distributeFunctionTypeAttrFromDeclarator (TypeProcessingState &state, ParsedAttr &attr, QualType &declSpecType) |
A function type attribute was written on the declarator or declaration. | |
static void | distributeTypeAttrsFromDeclarator (TypeProcessingState &state, QualType &declSpecType) |
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 QualType | applyObjCTypeArgs (Sema &S, SourceLocation loc, QualType type, ArrayRef< TypeSourceInfo * > typeArgs, SourceRange typeArgsRange, bool failOnError, bool rebuilding) |
Apply Objective-C type arguments to the given 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 (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 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 NullabilityKind | mapNullabilityAttrKind (ParsedAttr::Kind kind) |
Map a nullability attribute kind to a nullability kind. | |
static bool | checkNullabilityTypeSpecifier (TypeProcessingState &state, QualType &type, ParsedAttr &attr, bool allowOnArrayType) |
Applies a nullability type specifier to the given type, if possible. | |
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 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, VectorType::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, VectorType::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 | 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 | 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 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 116 of file SemaType.cpp.
#define FUNCTION_TYPE_ATTRS_CASELIST |
Definition at line 137 of file SemaType.cpp.
#define GENERIC_IMAGE_TYPE | ( | ImgType, | |
Id | |||
) |
#define IMAGE_TYPE | ( | ImgType, | |
Id, | |||
SingletonId, | |||
Access, | |||
Suffix | |||
) |
#define MS_TYPE_ATTRS_CASELIST |
Definition at line 147 of file SemaType.cpp.
#define NULLABILITY_TYPE_ATTRS_CASELIST |
Definition at line 154 of file SemaType.cpp.
#define OBJC_POINTER_TYPE_ATTRS_CASELIST |
Definition at line 111 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 353 of file SemaType.cpp.
enum TypeDiagSelector |
Enumerator | |
---|---|
TDS_Function | |
TDS_Pointer | |
TDS_ObjCObjOrBlock |
Definition at line 48 of file SemaType.cpp.
|
static |
Apply Objective-C type arguments to the given type.
Definition at line 831 of file SemaType.cpp.
References clang::ast_matchers::attr, clang::ObjCTypeParamList::begin(), clang::ASTContext::canAssignObjCInterfaces(), clang::Sema::Context, clang::FixItHint::CreateRemoval(), clang::Sema::Diag(), clang::TypeLoc::findExplicitQualifierLoc(), clang::Type::getAs(), clang::Qualifiers::getAsString(), clang::TypeLoc::getBeginLoc(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::ASTContext::getObjCObjectType(), clang::QualType::getQualifiers(), clang::TypeLoc::getSourceRange(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::ObjCInterfaceDecl::getTypeParamList(), clang::TypedefNameDecl::getUnderlyingType(), clang::QualType::getUnqualifiedType(), clang::Type::isBlockCompatibleObjCPointerType(), clang::Type::isBlockPointerType(), clang::Type::isDependentType(), clang::ObjCTypeParamList::size(), and clang::ast_matchers::type.
Referenced by clang::Sema::BuildObjCObjectType().
|
static |
Locks in the inheritance model for the given class and all of its bases.
Definition at line 8919 of file SemaType.cpp.
References clang::Decl::addAttr(), clang::AttributeCommonInfo::AS_Microsoft, 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(), clang::Sema::MSPointerToMemberRepresentationMethod, clang::Multiple, clang::LangOptions::PPTMK_BestCase, clang::LangOptions::PPTMK_FullGeneralityMultipleInheritance, clang::LangOptions::PPTMK_FullGeneralitySingleInheritance, clang::LangOptions::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 6649 of file SemaType.cpp.
References clang::AANT_ArgumentIntegerConstant, clang::Sema::Context, clang::Default, clang::Sema::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 9484 of file SemaType.cpp.
References clang::Sema::Context, clang::Sema::Diag(), clang::ASTContext::getBitIntType(), GetEnumUnderlyingType(), clang::ASTContext::getTargetInfo(), clang::CanQual< T >::getTypePtr(), clang::ASTContext::getTypeSize(), clang::TargetInfo::hasInt128Type(), clang::ASTContext::Int128Ty, clang::ASTContext::IntTy, clang::Type::isBooleanType(), clang::Type::isEnumeralType(), clang::ASTContext::LongLongTy, clang::ASTContext::LongTy, clang::Result, clang::ASTContext::ShortTy, clang::ASTContext::SignedCharTy, 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 2366 of file SemaType.cpp.
References clang::Sema::CCEK_ArrayBound, clang::Sema::CheckConvertedConstantExpression(), clang::Sema::Context, clang::Sema::Diag(), clang::Sema::getLangOpts(), clang::ASTContext::getSizeType(), clang::Expr::getType(), clang::Type::isIntegralOrUnscopedEnumerationType(), 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 2924 of file SemaType.cpp.
References clang::CC_Swift, clang::CC_SwiftAsync, clang::Sema::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 |
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 4462 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 |
Applies a nullability type specifier to the given type, if possible.
state | The type processing state. |
type | The type to which the nullability specifier will be added. On success, this type will be updated appropriately. |
attr | The attribute as written on the type. |
allowOnArrayType | Whether to accept nullability specifiers on an array type (e.g., because it will decay to a pointer). |
Definition at line 7413 of file SemaType.cpp.
References clang::ast_matchers::attr, clang::Type::canHaveNullability(), clang::Sema::Context, createNullabilityAttr(), clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), clang::Sema::Diag(), clang::Type::getArrayElementTypeNoTypeQual(), clang::Type::getAs(), clang::Type::getNullability(), clang::getNullabilitySpelling(), clang::Type::getPointeeType(), clang::QualType::getTypePtr(), clang::Type::isAnyPointerType(), clang::Type::isArrayType(), clang::Type::isMemberPointerType(), clang::Type::isObjCObjectPointerType(), mapNullabilityAttrKind(), recordNullabilitySeen(), clang::AttributedType::stripOuterNullability(), clang::ast_matchers::type, clang::ast_matchers::typedefDecl, and clang::ast_matchers::typedefType.
Referenced by processTypeAttrs().
|
static |
Check the application of the Objective-C '__kindof' qualifier to the given type.
Definition at line 7517 of file SemaType.cpp.
References clang::ast_matchers::attr, clang::Sema::Context, createNullabilityAttr(), clang::Sema::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 801 of file SemaType.cpp.
References clang::DeclSpec::ClearTypeQualifiers(), clang::Sema::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 2120 of file SemaType.cpp.
References clang::Sema::Diag(), clang::Qualifiers::empty(), clang::Type::getAs(), getFunctionQualifiersAsString(), clang::FunctionProtoType::getMethodQuals(), clang::FunctionProtoType::getRefQualifier(), clang::QualType::IgnoreParens(), and clang::RQ_None.
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 4200 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::Function, clang::Sema::getNSErrorIdent(), clang::Declarator::getNumTypeObjects(), clang::Declarator::getTypeObject(), clang::Sema::isCFError(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::MemberPointer, 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 1269 of file SemaType.cpp.
References clang::ASTContext::AccumTy, clang::ParsedAttributesView::addAtEnd(), clang::VectorType::AltiVecBool, clang::VectorType::AltiVecPixel, clang::VectorType::AltiVecVector, clang::TemplateArgumentListInfo::arguments(), clang::Auto, clang::ASTContext::BFloat16Ty, clang::BlockLiteral, clang::ASTContext::BoolTy, clang::Sema::BuildAtomicType(), clang::Sema::BuildBitIntType(), clang::Sema::BuildDecltypeType(), clang::Sema::BuildQualifiedType(), clang::Sema::BuildTypeofExprType(), clang::Sema::BuildUnaryTransformType(), clang::ASTContext::Char16Ty, clang::ASTContext::Char32Ty, clang::ASTContext::Char8Ty, clang::ASTContext::CharTy, checkOmittedBlockReturnType(), clang::Sema::Context, clang::FixItHint::CreateInsertion(), clang::DecltypeAuto, clang::ASTContext::DependentTy, clang::Sema::Diag(), diagnoseAndRemoveTypeQualifiers(), clang::Sema::DiagnoseUseOfDecl(), clang::ASTContext::DoubleTy, clang::ASTContext::Float128Ty, clang::ASTContext::Float16Ty, clang::ASTContext::FloatTy, clang::ASTContext::FractTy, clang::DeclSpec::getAttributes(), clang::ASTContext::getAutoDeductType(), clang::ASTContext::getAutoType(), clang::DeclSpec::getBeginLoc(), clang::ASTContext::getComplexType(), clang::DeclSpec::getConstSpecLoc(), clang::Declarator::getContext(), clang::ASTContext::getCorrespondingSaturatedType(), clang::ASTContext::getCorrespondingUnsignedType(), clang::Declarator::getDeclarationAttributes(), clang::Sema::getElaboratedType(), clang::Declarator::getIdentifierLoc(), clang::TypeWithKeyword::getKeywordForTypeSpec(), clang::Sema::getLangOpts(), clang::Declarator::getMutableDeclSpec(), clang::LangOptions::getOpenCLCompatibleVersion(), clang::Sema::getOpenCLOptions(), 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::GNUAutoType, 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::LambdaExpr, clang::Long, clang::ASTContext::LongAccumTy, clang::ASTContext::LongDoubleTy, clang::ASTContext::LongFractTy, clang::LongLong, clang::ASTContext::LongLongTy, clang::ASTContext::LongTy, maybeSynthesizeBlockSignature(), processTypeAttrs(), clang::Qualified, clang::Result, clang::DeclSpec::SCS_typedef, clang::Declarator::setInvalidType(), clang::TemplateArgumentListInfo::setLAngleLoc(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::Short, clang::ASTContext::ShortAccumTy, clang::ASTContext::ShortFractTy, clang::ASTContext::ShortTy, clang::Signed, 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_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::Unqualified, clang::Unsigned, clang::ASTContext::UnsignedCharTy, clang::ASTContext::UnsignedInt128Ty, clang::ASTContext::UnsignedIntTy, clang::ASTContext::UnsignedLongLongTy, clang::ASTContext::UnsignedLongTy, clang::ASTContext::UnsignedShortTy, clang::Unspecified, clang::ASTContext::VoidTy, and clang::ASTContext::WCharTy.
Referenced by GetDeclSpecTypeForDeclarator().
|
static |
Definition at line 4567 of file SemaType.cpp.
References clang::NonNull, clang::Nullable, clang::NullableResult, and clang::Unspecified.
Referenced by checkNullabilityTypeSpecifier(), checkObjCKindOfType(), and GetFullTypeForDeclarator().
|
static |
Definition at line 4562 of file SemaType.cpp.
References clang::ParsedAttr::setUsedAsTypeAttr().
Definition at line 2146 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 773 of file SemaType.cpp.
References clang::FixItHint::CreateRemoval(), clang::Sema::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 73 of file SemaType.cpp.
References clang::ast_matchers::attr, clang::Sema::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 4589 of file SemaType.cpp.
References clang::Default, and clang::Sema::Diag().
Referenced by clang::Sema::BuildAddressSpaceAttr(), GetFullTypeForDeclarator(), and HandleAddressSpaceTypeAttribute().
|
static |
Definition at line 3292 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 580 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 649 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 630 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 611 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 7575 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 463 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 519 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 677 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 4428 of file SemaType.cpp.
References Diag(), clang::Sema::Diag(), fixItNullability(), clang::SourceLocation::isValid(), clang::NonNull, and clang::Nullable.
Referenced by checkNullabilityConsistency(), and recordNullabilitySeen().
|
static |
Definition at line 6462 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 6066 of file SemaType.cpp.
References clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getTypePtr(), and clang::AttributedTypeLoc::setAttr().
Referenced by GetTypeSourceInfoForDeclarator().
|
static |
Definition at line 6487 of file SemaType.cpp.
References clang::DependentAddressSpaceTypeLoc::setAttrExprOperand(), clang::DependentAddressSpaceTypeLoc::setAttrNameLoc(), and clang::DependentAddressSpaceTypeLoc::setAttrOperandParensRange().
Referenced by GetTypeSourceInfoForDeclarator().
|
static |
Definition at line 6071 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 4393 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 4013 of file SemaType.cpp.
References CALLING_CONV_ATTRS_CASELIST, clang::CC_OpenCLKernel, clang::Sema::CheckCallingConvAttr(), clang::Sema::Context, clang::DeclaratorChunk::Function, 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::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_typedef, and clang::supportsVariadicCall().
Referenced by GetFullTypeForDeclarator().
|
static |
Definition at line 7656 of file SemaType.cpp.
References clang::Attr::getKind().
Referenced by handleFunctionTypeAttr().
|
static |
Definition at line 3463 of file SemaType.cpp.
References clang::AliasDecl, clang::AliasTemplate, clang::Association, clang::Auto, clang::Block, clang::BlockLiteral, clang::Condition, clang::Sema::Context, clang::UnqualifiedId::ConversionFunctionId, clang::ConversionId, ConvertDeclSpecToType(), clang::Sema::CurContext, clang::CXXCatch, clang::CXXNew, clang::DecltypeAuto, clang::ASTContext::DependentTy, clang::Sema::Diag(), distributeTypeAttrsFromDeclarator(), clang::File, clang::ForInit, clang::FunctionalCast, clang::TemplateName::getAsTemplateDecl(), clang::DeclSpec::getAttributes(), clang::SourceRange::getBegin(), clang::Type::getContainedDeducedType(), clang::Declarator::getContext(), clang::Sema::getCurLambda(), clang::Sema::getCurScope(), clang::Declarator::getDeclSpec(), clang::UnqualifiedId::getKind(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::Declarator::getMutableDeclSpec(), clang::Declarator::getName(), clang::Declarator::getNumTypeObjects(), clang::DeclSpec::getParsedSpecifiers(), clang::DeclSpec::getRepAsDecl(), clang::UnqualifiedId::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::Sema::getTemplateNameKindForDiagnostics(), clang::Declarator::getTrailingReturnType(), clang::ASTContext::getTypeDeclType(), clang::Sema::GetTypeFromParser(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::GNUAutoType, clang::Declarator::hasTrailingReturnType(), clang::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::ASTContext::IntTy, clang::Sema::InventedParameterInfos, InventTemplateParameter(), clang::TagDecl::isCompleteDefinition(), clang::DeclSpec::isFriendSpecified(), clang::Scope::isFunctionDeclarationScope(), clang::Declarator::isFunctionDeclarator(), clang::Declarator::isInvalidType(), clang::QualType::isNull(), clang::DeclSpec::isTypeSpecOwned(), clang::KNRTypeList, clang::LambdaExpr, clang::LambdaExprParameter, clang::Member, clang::ObjCCatch, clang::ObjCParameter, clang::ObjCResult, clang::DeclSpec::PQ_TypeSpecifier, processTypeAttrs(), clang::Prototype, clang::RequiresExpr, clang::DeclSpec::SCS_static, clang::DeclSpec::SCS_typedef, clang::SelectionInit, clang::TagDecl::setEmbeddedInDeclarator(), clang::Declarator::setInvalidType(), TAL_DeclSpec, clang::TemplateArg, clang::TemplateParam, clang::TemplateTypeArg, clang::TrailingReturn, clang::TrailingReturnVar, clang::TTK_Class, clang::TTK_Enum, clang::TTK_Interface, clang::TTK_Struct, clang::TTK_Union, clang::TypeName, and clang::ASTContext::VoidTy.
Referenced by clang::Sema::GetTypeForDeclarator(), and clang::Sema::GetTypeForDeclaratorCast().
|
static |
Definition at line 9361 of file SemaType.cpp.
References clang::Type::castAs(), clang::Sema::DiagnoseUseOfDecl(), clang::EnumDecl::getIntegerType(), clang::Type::isEnumeralType(), and clang::QualType::isNull().
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 4604 of file SemaType.cpp.
References clang::Qualifiers::addAddressSpace(), clang::ParsedAttributesView::addAtEnd(), clang::QualType::addConst(), clang::Qualifiers::addCVRUQualifiers(), clang::AliasDecl, clang::AliasTemplate, clang::TargetInfo::allowHalfArgsAndReturns(), clang::DeclaratorChunk::Arr, clang::DeclaratorChunk::Array, clang::AttributeCommonInfo::AS_ContextSensitiveKeyword, clang::AttributeCommonInfo::AS_Keyword, clang::Association, clang::ast_matchers::attr, clang::Auto, clang::Block, clang::BlockLiteral, clang::DeclaratorChunk::BlockPointer, clang::Sema::BuildArrayType(), clang::Sema::BuildBlockPointerType(), clang::Sema::BuildMemberPointerType(), clang::Sema::BuildParenType(), clang::Sema::BuildPointerType(), clang::Sema::BuildQualifiedType(), clang::Sema::BuildReadPipeType(), clang::Sema::BuildReferenceType(), clang::Type::canHaveNullability(), 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::CXXCatch, clang::CXXNew, clang::Default, clang::Definition, clang::ASTContext::DependentTy, Diag(), clang::Sema::Diag(), DiagnoseMultipleAddrSpaceAttributes(), diagnoseRedundantReturnTypeQualifiers(), clang::ASTContext::DoubleTy, clang::ObjCDeclSpec::DQ_CSNullability, clang::FunctionProtoType::ExtProtoInfo::EllipsisLoc, clang::DeclaratorChunk::EndLoc, clang::EST_Dynamic, clang::ETK_None, clang::DeclaratorChunk::FunctionTypeInfo::Exceptions, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::FunctionProtoType::ExtProtoInfo::ExtInfo, clang::FunctionProtoType::ExtProtoInfo::ExtParameterInfos, clang::File, fixItNullability(), clang::DeclSpec::forEachQualifier(), clang::ForInit, clang::DeclaratorChunk::Fun, clang::DeclaratorChunk::Function, clang::FunctionalCast, clang::Type::getAs(), clang::NestedNameSpecifier::getAsIdentifier(), clang::NestedNameSpecifier::getAsType(), clang::Decl::getAttr(), clang::DeclSpec::getAttributePool(), clang::DeclSpec::getAttributes(), clang::Declarator::getAttributes(), clang::DeclaratorChunk::getAttrs(), clang::CharSourceRange::getBegin(), clang::TypeLoc::getBeginLoc(), clang::CXXScopeSpec::getBeginLoc(), clang::DeclSpec::getBeginLoc(), clang::Declarator::getBeginLoc(), clang::ASTContext::getBuiltinVaListDecl(), getCCForDeclaratorChunk(), clang::DeclSpec::getConstexprSpecifier(), clang::Type::getContainedAutoType(), clang::Declarator::getContext(), clang::Sema::getCurLambda(), clang::QualType::getCVRQualifiers(), clang::Declarator::getCXXScopeSpec(), clang::Declarator::getDeclarationAttributes(), clang::Declarator::getDeclSpec(), clang::Sema::getDefaultCXXMethodAddrSpace(), clang::ASTContext::getDependentNameType(), clang::ASTContext::getElaboratedType(), clang::DeclaratorChunk::FunctionTypeInfo::getEllipsisLoc(), clang::Declarator::getEllipsisLoc(), clang::TypeLoc::getEndLoc(), clang::DeclSpec::getEndLoc(), clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecLocBeg(), clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecType(), clang::FunctionProtoType::getExtProtoInfo(), clang::Declarator::getFunctionDefinitionKind(), clang::ASTContext::getFunctionNoProtoType(), getFunctionQualifiersAsString(), clang::ASTContext::getFunctionType(), clang::Declarator::getIdentifier(), clang::Declarator::getIdentifierLoc(), clang::SourceManager::getImmediateExpansionRange(), clang::Declarator::getInnermostNonParenChunk(), clang::NestedNameSpecifier::getKind(), clang::UnqualifiedId::getKind(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::Sema::getLocForEndOfToken(), clang::DeclaratorChunk::FunctionTypeInfo::getLParenLoc(), clang::Declarator::getMutableDeclSpec(), clang::Declarator::getName(), clang::IdentifierInfo::getName(), clang::Type::getNullability(), clang::Sema::getNullabilityKeyword(), clang::DeclaratorChunk::FunctionTypeInfo::getNumExceptions(), clang::Declarator::getNumTypeObjects(), clang::Qualifiers::getObjCLifetime(), clang::ASTContext::getObjCObjectPointerType(), clang::LangOptions::getOpenCLCompatibleVersion(), clang::Sema::getOpenCLOptions(), clang::ASTContext::getPackExpansionType(), clang::FunctionProtoType::getParamTypes(), clang::Preprocessor::getPragmaAssumeNonNullLoc(), clang::NestedNameSpecifier::getPrefix(), getPrintableNameForEntity(), clang::ASTContext::getPromotedIntegerType(), clang::QualType::getQualifiers(), clang::CXXScopeSpec::getRange(), clang::DeclaratorChunk::FunctionTypeInfo::getRefQualifierLoc(), clang::DeclSpec::getRepAsDecl(), clang::FunctionType::getReturnType(), clang::DeclaratorChunk::FunctionTypeInfo::getRParenLoc(), clang::CXXScopeSpec::getScopeRep(), clang::Sema::getSourceManager(), clang::DeclSpec::getSourceRange(), clang::Declarator::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::ASTContext::getTargetInfo(), clang::DeclaratorChunk::FunctionTypeInfo::getTrailingReturnType(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ValueDecl::getType(), clang::ASTContext::getTypeDeclType(), clang::Sema::GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), clang::Declarator::getTypeObject(), clang::DeclSpec::getTypeQualifiers(), clang::TypeLocBuilder::getTypeSourceInfo(), GetTypeSourceInfoForDeclarator(), clang::DeclSpec::getTypeSpecType(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::NestedNameSpecifier::Global, clang::Decl::hasAttr(), clang::ParsedAttributesView::hasAttribute(), clang::DeclSpec::hasAutoTypeSpec(), clang::Declarator::hasEllipsis(), clang::DeclaratorChunk::FunctionTypeInfo::hasMethodTypeQualifiers(), hasNullabilityAttr(), clang::Qualifiers::hasObjCLifetime(), hasOuterPointerLikeChunk(), clang::DeclaratorChunk::FunctionTypeInfo::hasPrototype, clang::QualType::hasQualifiers(), clang::DeclaratorChunk::FunctionTypeInfo::hasRefQualifier(), clang::DeclaratorChunk::ReferenceTypeInfo::HasRestrict, clang::DeclaratorChunk::ArrayTypeInfo::hasStatic, clang::DeclSpec::hasTagDefinition(), clang::FunctionProtoType::ExtProtoInfo::HasTrailingReturn, clang::DeclaratorChunk::FunctionTypeInfo::hasTrailingReturnType(), clang::DeclaratorChunk::ParamInfo::Ident, clang::NestedNameSpecifier::Identifier, clang::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::DeclSpec::isFriendSpecified(), clang::Declarator::isFunctionDeclarationContext(), clang::Declarator::isFunctionDeclarator(), isFunctionOrMethod(), clang::Type::isFunctionProtoType(), clang::Type::isFunctionType(), clang::Type::isHalfType(), clang::Type::isImageType(), clang::SourceLocation::isInvalid(), clang::CXXScopeSpec::isInvalid(), clang::Declarator::isInvalidType(), clang::SourceLocation::isMacroID(), clang::Type::isMemberPointerType(), IsNoDerefableChunk(), clang::QualType::isNull(), clang::Type::isObjCObjectType(), clang::Type::isObjectType(), clang::Type::isPipeType(), clang::ASTContext::isPromotableIntegerType(), clang::Declarator::isPrototypeContext(), clang::DeclContext::isRecord(), clang::Type::isRecordType(), clang::Type::isSamplerT(), clang::CXXScopeSpec::isSet(), clang::DeclaratorChunk::ArrayTypeInfo::isStar, clang::SourceLocation::isValid(), clang::DeclaratorChunk::FunctionTypeInfo::isVariadic, clang::Type::isVoidType(), clang::QualType::isVolatileQualified(), 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::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::NamespaceAlias, clang::DeclaratorChunk::FunctionTypeInfo::NoexceptExpr, clang::NonNull, clang::ArrayType::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::Decl::setInvalidDecl(), clang::Declarator::setInvalidType(), clang::ParmVarDecl::setKNRPromoted(), clang::ObjCObjectPointerTypeLoc::setStarLoc(), clang::ValueDecl::setType(), clang::Sema::SourceMgr, clang::ArrayType::Star, clang::ArrayType::Static, clang::NestedNameSpecifier::Super, TAL_DeclChunk, TAL_DeclName, TAL_DeclSpec, clang::TemplateArg, clang::TemplateParam, clang::TemplateTypeArg, clang::DeclSpec::TQ_const, clang::TrailingReturn, clang::TrailingReturnVar, clang::DeclSpec::TST_auto, clang::DeclaratorChunk::TypeAndRange::Ty, clang::Declarator::type_objects(), clang::TypeName, clang::FunctionProtoType::ExtProtoInfo::TypeQuals, clang::DeclaratorChunk::PointerTypeInfo::TypeQuals, clang::DeclaratorChunk::ArrayTypeInfo::TypeQuals, clang::DeclaratorChunk::BlockPointerTypeInfo::TypeQuals, clang::DeclaratorChunk::MemberPointerTypeInfo::TypeQuals, clang::NestedNameSpecifier::TypeSpec, clang::NestedNameSpecifier::TypeSpecWithTemplate, clang::FunctionProtoType::ExtProtoInfo::Variadic, warnAboutAmbiguousFunction(), and warnAboutRedundantParens().
Referenced by clang::Sema::GetTypeForDeclarator(), and clang::Sema::GetTypeForDeclaratorCast().
|
static |
Definition at line 2081 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 1244 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 9130 of file SemaType.cpp.
References clang::TTK_Class, clang::TTK_Interface, and clang::TTK_Struct.
Referenced by clang::Sema::RequireLiteralType().
|
static |
Definition at line 4353 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 1915 of file SemaType.cpp.
References clang::DeclarationName::getAsString().
Referenced by clang::Sema::BuildArrayType(), clang::Sema::BuildMemberPointerType(), clang::Sema::BuildPointerType(), and GetFullTypeForDeclarator().
|
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 6511 of file SemaType.cpp.
References clang::TypeLoc::castAs(), clang::Sema::Context, clang::ASTContext::CreateTypeSourceInfo(), fillAtomicQualLoc(), fillAttributedTypeLoc(), fillDependentAddressSpaceTypeLoc(), clang::TypeLoc::getAs(), clang::DeclaratorChunk::getAttrs(), clang::Declarator::getDeclSpec(), clang::Declarator::getEllipsisLoc(), clang::TypeLoc::getFullDataSize(), clang::TypeLoc::getNextTypeLoc(), clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::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(), and memcpy().
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 6758 of file SemaType.cpp.
References clang::Sema::BuildAddressSpaceAttr(), BuildAddressSpaceIndex(), clang::Sema::Context, clang::Default, clang::Sema::Diag(), DiagnoseMultipleAddrSpaceAttributes(), clang::ASTContext::getAddrSpaceQualType(), clang::Attr::getKind(), clang::Sema::getLangOpts(), clang::AttributeCommonInfo::getLoc(), clang::Type::isFunctionType(), clang::QualType::isNull(), and clang::Expr::isValueDependent().
Referenced by processTypeAttrs().
|
static |
Definition at line 8336 of file SemaType.cpp.
References clang::Sema::checkStringLiteralArgumentAttr(), clang::Sema::ConstantFoldAttrArgs(), clang::Sema::Context, clang::Sema::Diag(), clang::ParsedAttr::getArgAsExpr(), clang::AttributeCommonInfo::getLoc(), clang::ParsedAttr::getNumArgs(), and clang::ParsedAttr::isArgIdent().
Referenced by processTypeAttrs().
|
static |
Definition at line 8242 of file SemaType.cpp.
References clang::AttributeCommonInfo::getLoc(), clang::VectorType::getVectorKind(), and clang::VectorType::NeonVector.
Referenced by processTypeAttrs().
|
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 8178 of file SemaType.cpp.
References clang::Type::castAs(), clang::Sema::Context, clang::Sema::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::isVLSTBuiltinType(), clang::VectorType::SveFixedLengthDataVector, clang::VectorType::SveFixedLengthPredicateVector, and verifyValidIntegerConstantExpr().
Referenced by processTypeAttrs().
|
static |
Definition at line 6728 of file SemaType.cpp.
References clang::AANT_ArgumentString, clang::Sema::Context, clang::Sema::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 8045 of file SemaType.cpp.
References clang::Sema::BuildExtVectorType(), clang::Sema::Diag(), clang::AttributeCommonInfo::getLoc(), and clang::QualType::isNull().
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 7715 of file SemaType.cpp.
References clang::ASTContext::adjustFunctionType(), clang::ast_matchers::attr, clang::CC_X86FastCall, clang::CC_X86StdCall, clang::Sema::CheckAttrNoArgs(), clang::Sema::CheckAttrTarget(), clang::Sema::CheckCallingConvAttr(), clang::Sema::checkNSReturnsRetainedReturnType(), clang::Sema::CheckRegparmAttr(), clang::Sema::Context, clang::Sema::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::Type::getAs(), clang::FunctionType::getCallConv(), clang::Sema::getCallingConvAttributedType(), getCCTypeAttr(), clang::ASTContext::getFunctionTypeWithExceptionSpec(), clang::FunctionType::getHasRegParm(), clang::Sema::getLangOpts(), clang::FunctionType::getNameForCallConv(), int, clang::FunctionProtoType::isVariadic(), clang::supportsVariadicCall(), clang::ast_matchers::type, and clang::Sema::VariadicFunction.
Referenced by distributeFunctionTypeAttrToInnermost(), and processTypeAttrs().
|
static |
Definition at line 8364 of file SemaType.cpp.
Referenced by processTypeAttrs().
|
static |
HandleMatrixTypeAttr - "matrix_type" attribute, like ext_vector_type.
Definition at line 8316 of file SemaType.cpp.
References clang::Sema::BuildMatrixType(), clang::Sema::Diag(), clang::Sema::getLangOpts(), clang::AttributeCommonInfo::getLoc(), and clang::QualType::isNull().
Referenced by processTypeAttrs().
|
static |
Definition at line 7252 of file SemaType.cpp.
References clang::Sema::Context, clang::Default, clang::Sema::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::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 8132 of file SemaType.cpp.
References clang::Sema::Context, clang::Sema::Diag(), clang::AttributeCommonInfo::getLoc(), clang::ASTContext::getTargetInfo(), clang::ASTContext::getTypeSize(), clang::ASTContext::getVectorType(), clang::TargetInfo::hasFeature(), isPermittedNeonBaseType(), and verifyValidIntegerConstantExpr().
Referenced by processTypeAttrs().
|
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 7028 of file SemaType.cpp.
References clang::AANT_ArgumentString, clang::ast_matchers::attr, clang::Sema::Context, clang::Sema::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 6841 of file SemaType.cpp.
References clang::AANT_ArgumentString, clang::Sema::DelayedDiagnostics::add(), clang::Qualifiers::addObjCLifetime(), clang::ast_matchers::attr, clang::Sema::Context, clang::Sema::DelayedDiagnostics, clang::Sema::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 378 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 8260 of file SemaType.cpp.
References clang::Type::castAs(), clang::Sema::Context, clang::Sema::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 |
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 8025 of file SemaType.cpp.
References clang::Sema::BuildVectorType(), clang::Sema::Diag(), clang::AttributeCommonInfo::getLoc(), and clang::QualType::isNull().
Referenced by processTypeAttrs().
|
static |
Definition at line 7349 of file SemaType.cpp.
References clang::Sema::Context, clang::Sema::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 4153 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 4532 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 2030 of file SemaType.cpp.
References clang::Sema::DelayedDiagnostics::add(), clang::Qualifiers::addObjCLifetime(), clang::Sema::Context, clang::Sema::DelayedDiagnostics, clang::Sema::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 3145 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(), 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 3363 of file SemaType.cpp.
References clang::TemplateArgumentListInfo::addArgument(), clang::TemplateArgumentListInfo::arguments(), clang::Sema::AttachTypeConstraint(), clang::Auto, clang::InventedTemplateParameterInfo::AutoTemplateParameterDepth, clang::Sema::Context, clang::TemplateTypeParmDecl::Create(), clang::Sema::DiagnoseUnexpandedParameterPack(), clang::OpaquePtr< PtrTy >::get(), clang::AutoTypeLoc::getArgLoc(), clang::TemplateName::getAsTemplateDecl(), clang::AutoTypeLoc::getConceptNameInfo(), clang::TypeLoc::getContainedAutoTypeLoc(), clang::Declarator::getDeclSpec(), clang::Declarator::getEllipsisLoc(), 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::Sema::ReplaceAutoTypeSourceInfo(), clang::Decl::setImplicit(), 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 1922 of file SemaType.cpp.
References clang::Type::isDependentType().
Referenced by clang::Sema::BuildAtomicType(), and clang::Sema::BuildQualifiedType().
|
static |
Definition at line 4556 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 56 of file SemaType.cpp.
References clang::DeclaratorChunk::Function, clang::Declarator::getContext(), clang::Declarator::getDeclSpec(), clang::Declarator::getNumTypeObjects(), clang::Declarator::getTypeObject(), clang::DeclSpec::hasTypeSpecifier(), and clang::DeclaratorChunk::Kind.
Referenced by checkOmittedBlockReturnType().
|
static |
Definition at line 8060 of file SemaType.cpp.
References clang::Sema::Context, clang::Type::getAs(), clang::BuiltinType::getKind(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), and clang::VectorType::NeonPolyVector.
Referenced by HandleNeonVectorTypeAttr().
|
static |
Map a nullability attribute kind to a nullability kind.
Definition at line 7381 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 395 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 717 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 345 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 8374 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(), HandleLifetimeBoundAttr(), HandleMatrixTypeAttr(), handleMSPointerTypeQualifierAttr(), HandleNeonVectorTypeAttr(), handleObjCPointerTypeAttr(), HandleOpenCLAccessAttr(), HandleVectorSizeAttr(), HandleWebAssemblyFuncrefAttr(), hasOuterPointerLikeChunk(), clang::AttributeCommonInfo::IgnoredAttribute, MS_TYPE_ATTRS_CASELIST, clang::VectorType::NeonPolyVector, clang::VectorType::NeonVector, 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 |
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 4503 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().
|
static |
Used for transferring ownership in casts resulting in l-values.
Definition at line 6000 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 5963 of file SemaType.cpp.
References clang::ParsedAttributesView::addAtEnd(), clang::AttributeCommonInfo::AS_GNU, clang::ast_matchers::attr, clang::Sema::Context, clang::AttributePool::create(), clang::IdentifierTable::get(), clang::Declarator::getAttributePool(), clang::DeclaratorChunk::getAttrs(), clang::Declarator::getTypeObject(), 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 5952 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 1252 of file SemaType.cpp.
Referenced by ConvertDeclSpecToType().
|
static |
Definition at line 8109 of file SemaType.cpp.
References clang::AANT_ArgumentIntegerConstant, clang::Sema::Context, clang::Sema::Diag(), clang::AttributeCommonInfo::getLoc(), and clang::Result.
Referenced by HandleArmSveVectorBitsTypeAttr(), and HandleNeonVectorTypeAttr().
|
static |
Produce an appropriate diagnostic for an ambiguity between a function declarator and a C++ direct-initializer.
Definition at line 3797 of file SemaType.cpp.
References clang::Condition, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), clang::Sema::CurContext, clang::Declaration, clang::Sema::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::Sema::getFixItZeroInitializerForType(), clang::Declarator::getFunctionDefinitionKind(), clang::Declarator::getIdentifier(), clang::Declarator::getIdentifierLoc(), clang::Sema::getLocForEndOfToken(), clang::Decl::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::CXXRecordDecl::hasDefinition(), clang::CXXRecordDecl::hasUserProvidedDefaultConstructor(), clang::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 3894 of file SemaType.cpp.
References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::C, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::CXXNew, clang::Sema::Diag(), clang::DeclaratorChunk::Function, clang::Type::getAsCXXRecordDecl(), clang::Declarator::getBeginLoc(), clang::Declarator::getContext(), clang::Sema::getCurScope(), clang::Declarator::getCXXScopeSpec(), clang::Declarator::getDeclSpec(), clang::Declarator::getEndLoc(), clang::Declarator::getIdentifier(), clang::Sema::getLangOpts(), clang::Sema::getLocForEndOfToken(), clang::Declarator::getNumTypeObjects(), clang::DeclSpec::getParsedSpecifiers(), clang::NestedNameSpecifier::getPrefix(), clang::CXXScopeSpec::getScopeRep(), clang::Declarator::getTypeObject(), clang::DeclSpec::getTypeQualifiers(), clang::NestedNameSpecifier::Global, clang::Sema::inTemplateInstantiation(), clang::Type::isDependentType(), clang::Declarator::isExpressionContext(), clang::Declarator::isFirstDeclarator(), clang::Declarator::isInvalidType(), clang::Type::isRecordType(), clang::CXXScopeSpec::isValid(), clang::Sema::LookupName(), clang::Sema::LookupOrdinaryName, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::Paren, Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclSpec::PQ_TypeSpecifier, clang::DeclaratorChunk::Reference, clang::Result, and clang::Declarator::type_objects().
Referenced by GetFullTypeForDeclarator().