clang  6.0.0svn
Macros | Enumerations | Functions
SemaType.cpp File Reference
#include "TypeLocBuilder.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTMutationListener.h"
#include "clang/AST/ASTStructuralEquivalence.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/AST/TypeLoc.h"
#include "clang/AST/TypeLocVisitor.h"
#include "clang/Basic/PartialDiagnostic.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/ScopeInfo.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/Template.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/ErrorHandling.h"
#include "clang/Basic/OpenCLImageTypes.def"
Include dependency graph for SemaType.cpp:

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 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...
 
enum  QualifiedFunctionKind
 Kinds of declarator that cannot contain a qualified function type. More...
 
enum  SimplePointerKind
 A simple notion of pointer kinds, which matches up with the various pointer declarators. More...
 
enum  PointerDeclaratorKind
 Describes the kind of a pointer a declarator describes. More...
 
enum  PointerWrappingDeclaratorKind
 Describes a declarator chunk wrapping a pointer that marks inference as unexpected. 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. More...
 
static void diagnoseBadTypeAttribute (Sema &S, const AttributeList &attr, QualType type)
 diagnoseBadTypeAttribute - Diagnoses a type attribute which doesn't apply to the given type. More...
 
static void spliceAttrIntoList (AttributeList &attr, AttributeList *&head)
 
static void spliceAttrOutOfList (AttributeList &attr, AttributeList *&head)
 
static void moveAttrFromListToList (AttributeList &attr, AttributeList *&fromList, AttributeList *&toList)
 
static void processTypeAttrs (TypeProcessingState &state, QualType &type, TypeAttrLocation TAL, AttributeList *attrs)
 
static bool handleFunctionTypeAttr (TypeProcessingState &state, AttributeList &attr, QualType &type)
 Process an individual function attribute. More...
 
static bool handleMSPointerTypeQualifierAttr (TypeProcessingState &state, AttributeList &attr, QualType &type)
 
static bool handleObjCGCTypeAttr (TypeProcessingState &state, AttributeList &attr, QualType &type)
 handleObjCGCTypeAttr - Process the attribute((objc_gc)) type attribute on the specified type. More...
 
static bool handleObjCOwnershipTypeAttr (TypeProcessingState &state, AttributeList &attr, QualType &type)
 handleObjCOwnershipTypeAttr - Process an objc_ownership attribute on the specified type. More...
 
static bool handleObjCPointerTypeAttr (TypeProcessingState &state, AttributeList &attr, QualType &type)
 
static DeclaratorChunkmaybeMovePastReturnType (Declarator &declarator, unsigned i, bool onlyBlockPointers)
 Given the index of a declarator chunk, check whether that chunk directly specifies the return type of a function and, if so, find an appropriate place for it. More...
 
static void distributeObjCPointerTypeAttr (TypeProcessingState &state, AttributeList &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. More...
 
static void distributeObjCPointerTypeAttrFromDeclarator (TypeProcessingState &state, AttributeList &attr, QualType &declSpecType)
 Distribute an objc_gc type attribute that was written on the declarator. More...
 
static void distributeFunctionTypeAttr (TypeProcessingState &state, AttributeList &attr, QualType type)
 A function type attribute was written somewhere in a declaration other than on the declarator itself or in the decl spec. More...
 
static bool distributeFunctionTypeAttrToInnermost (TypeProcessingState &state, AttributeList &attr, AttributeList *&attrList, QualType &declSpecType)
 Try to distribute a function type attribute to the innermost function chunk or type. More...
 
static void distributeFunctionTypeAttrFromDeclSpec (TypeProcessingState &state, AttributeList &attr, QualType &declSpecType)
 A function type attribute was written in the decl spec. More...
 
static void distributeFunctionTypeAttrFromDeclarator (TypeProcessingState &state, AttributeList &attr, QualType &declSpecType)
 A function type attribute was written on the declarator. More...
 
static void distributeTypeAttrsFromDeclarator (TypeProcessingState &state, QualType &declSpecType)
 Given that there are attributes written on the declarator itself, try to distribute any type attributes to the appropriate declarator chunk. More...
 
static void maybeSynthesizeBlockSignature (TypeProcessingState &state, QualType declSpecType)
 Add a synthetic '()' to a block-literal declarator if it is required, given the return type. More...
 
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. More...
 
static QualType applyObjCTypeArgs (Sema &S, SourceLocation loc, QualType type, ArrayRef< TypeSourceInfo *> typeArgs, SourceRange typeArgsRange, bool failOnError=false)
 Apply Objective-C type arguments to the given type. More...
 
static OpenCLAccessAttr::Spelling getImageAccess (const AttributeList *Attrs)
 
static QualType ConvertDeclSpecToType (TypeProcessingState &state)
 Convert the specified declspec to the appropriate type object. More...
 
static std::string getPrintableNameForEntity (DeclarationName Entity)
 
static QualType inferARCLifetimeForPointee (Sema &S, QualType type, SourceLocation loc, bool isReference)
 Given that we're building a pointer or reference to the given. More...
 
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. More...
 
static bool isArraySizeVLA (Sema &S, Expr *ArraySize, llvm::APSInt &SizeVal)
 Check whether the specified array size makes the array type a VLA. More...
 
static void checkExtParameterInfos (Sema &S, ArrayRef< QualType > paramTypes, const FunctionProtoType::ExtProtoInfo &EPI, llvm::function_ref< SourceLocation(unsigned)> getParamLoc)
 Check the extended parameter information. More...
 
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. More...
 
static void diagnoseRedundantReturnTypeQualifiers (Sema &S, QualType RetTy, Declarator &D, unsigned FunctionChunkIndex)
 
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. More...
 
static void warnAboutRedundantParens (Sema &S, Declarator &D, QualType T)
 Produce an appropriate diagnostic for a declarator with top-level parentheses. More...
 
static CallingConv getCCForDeclaratorChunk (Sema &S, Declarator &D, const DeclaratorChunk::FunctionTypeInfo &FTI, unsigned ChunkIndex)
 Helper for figuring out the default CC for a function declarator type. More...
 
static bool hasNullabilityAttr (const AttributeList *attrs)
 Check whether there is a nullability attribute of any kind in the given attribute list. More...
 
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. More...
 
static FileID getNullabilityCompletenessCheckFileID (Sema &S, SourceLocation loc)
 
static void fixItNullability (Sema &S, DiagnosticBuilder &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. More...
 
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). More...
 
static void recordNullabilitySeen (Sema &S, SourceLocation loc)
 Marks that a nullability feature has been used in the file containing loc. More...
 
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. More...
 
static TypeSourceInfoGetFullTypeForDeclarator (TypeProcessingState &state, QualType declSpecType, TypeSourceInfo *TInfo)
 
static void transferARCOwnershipToDeclSpec (Sema &S, QualType &declSpecTy, Qualifiers::ObjCLifetime ownership)
 
static void transferARCOwnership (TypeProcessingState &state, QualType &declSpecTy, Qualifiers::ObjCLifetime ownership)
 Used for transferring ownership in casts resulting in l-values. More...
 
static AttributeList::Kind getAttrListKind (AttributedType::Kind kind)
 Map an AttributedType::Kind to an AttributeList::Kind. More...
 
static void fillAttributedTypeLoc (AttributedTypeLoc TL, const AttributeList *attrs, const AttributeList *DeclAttrs=nullptr)
 
static void fillAtomicQualLoc (AtomicTypeLoc ATL, const DeclaratorChunk &Chunk)
 
static void fillDependentAddressSpaceTypeLoc (DependentAddressSpaceTypeLoc DASTL, const AttributeList *Attrs)
 
static void HandleAddressSpaceTypeAttribute (QualType &Type, const AttributeList &Attr, Sema &S)
 HandleAddressSpaceTypeAttribute - Process an address_space attribute on the specified type. More...
 
static bool hasDirectOwnershipQualifier (QualType type)
 Does this type have a "direct" ownership qualifier? That is, is it written like "__strong id", as opposed to something like "typeof(foo)", where that happens to be strong? More...
 
static NullabilityKind mapNullabilityAttrKind (AttributeList::Kind kind)
 Map a nullability attribute kind to a nullability kind. More...
 
static bool distributeNullabilityTypeAttr (TypeProcessingState &state, QualType type, AttributeList &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. More...
 
static AttributedType::Kind getCCTypeAttrKind (AttributeList &Attr)
 
static void HandleVectorSizeAttr (QualType &CurType, const AttributeList &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. More...
 
static void HandleExtVectorTypeAttr (QualType &CurType, const AttributeList &Attr, Sema &S)
 Process the OpenCL-like ext_vector_type attribute when it occurs on a type. More...
 
static bool isPermittedNeonBaseType (QualType &Ty, VectorType::VectorKind VecKind, Sema &S)
 
static void HandleNeonVectorTypeAttr (QualType &CurType, const AttributeList &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. More...
 
static void HandleOpenCLAccessAttr (QualType &CurType, const AttributeList &Attr, Sema &S)
 Handle OpenCL Access Qualifier Attribute. More...
 
static void deduceOpenCLImplicitAddrSpace (TypeProcessingState &State, QualType &T, TypeAttrLocation TAL)
 
static void assignInheritanceModel (Sema &S, CXXRecordDecl *RD)
 Locks in the inheritance model for the given class and all of its bases. More...
 
static unsigned getLiteralDiagFromTagKind (TagTypeKind Tag)
 Get diagnostic select index for tag kind for literal type diagnostic message. More...
 
static QualType getDecltypeForExpr (Sema &S, Expr *E)
 getDecltypeForExpr - Given an expr, will return the decltype for that expression, according to the rules in C++11 [dcl.type.simple]p4 and C++11 [expr.lambda.prim]p18. More...
 

Macro Definition Documentation

◆ CALLING_CONV_ATTRS_CASELIST

#define CALLING_CONV_ATTRS_CASELIST
Value:
case AttributeList::AT_CDecl: \
case AttributeList::AT_FastCall: \
case AttributeList::AT_StdCall: \
case AttributeList::AT_ThisCall: \
case AttributeList::AT_RegCall: \
case AttributeList::AT_Pascal: \
case AttributeList::AT_SwiftCall: \
case AttributeList::AT_VectorCall: \
case AttributeList::AT_MSABI: \
case AttributeList::AT_SysVABI: \
case AttributeList::AT_Pcs: \
case AttributeList::AT_IntelOclBicc: \
case AttributeList::AT_PreserveMost: \
case AttributeList::AT_PreserveAll

Definition at line 105 of file SemaType.cpp.

Referenced by getCCForDeclaratorChunk().

◆ FUNCTION_TYPE_ATTRS_CASELIST

#define FUNCTION_TYPE_ATTRS_CASELIST
Value:
case AttributeList::AT_NSReturnsRetained: \
case AttributeList::AT_NoReturn: \
case AttributeList::AT_Regparm: \
case AttributeList::AT_AnyX86NoCallerSavedRegisters: \
CALLING_CONV_ATTRS_CASELIST

Definition at line 122 of file SemaType.cpp.

Referenced by distributeTypeAttrsFromDeclarator(), and processTypeAttrs().

◆ GENERIC_IMAGE_TYPE

#define GENERIC_IMAGE_TYPE (   ImgType,
  Id 
)
Value:
case DeclSpec::TST_##ImgType##_t: \
switch (getImageAccess(DS.getAttributes().getList())) { \
case OpenCLAccessAttr::Keyword_write_only: \
Result = Context.Id##WOTy; break; \
case OpenCLAccessAttr::Keyword_read_write: \
Result = Context.Id##RWTy; break; \
case OpenCLAccessAttr::Keyword_read_only: \
Result = Context.Id##ROTy; break; \
} \
break;
static OpenCLAccessAttr::Spelling getImageAccess(const AttributeList *Attrs)
Definition: SemaType.cpp:1211

◆ IMAGE_TYPE

#define IMAGE_TYPE (   ImgType,
  Id,
  SingletonId,
  Access,
  Suffix 
)
Value:
PrevAccessQual = #Access; \
break;
int Id
Definition: ASTDiff.cpp:191

◆ MS_TYPE_ATTRS_CASELIST

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

Definition at line 130 of file SemaType.cpp.

Referenced by distributeTypeAttrsFromDeclarator(), and processTypeAttrs().

◆ NULLABILITY_TYPE_ATTRS_CASELIST

#define NULLABILITY_TYPE_ATTRS_CASELIST
Value:
case AttributeList::AT_TypeNonNull: \
case AttributeList::AT_TypeNullable: \
case AttributeList::AT_TypeNullUnspecified

Definition at line 137 of file SemaType.cpp.

Referenced by distributeTypeAttrsFromDeclarator(), and processTypeAttrs().

◆ OBJC_POINTER_TYPE_ATTRS_CASELIST

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

Definition at line 100 of file SemaType.cpp.

Referenced by distributeTypeAttrsFromDeclarator(), and processTypeAttrs().

Enumeration Type Documentation

◆ PointerDeclaratorKind

enum PointerDeclaratorKind
strong

Describes the kind of a pointer a declarator describes.

Definition at line 3353 of file SemaType.cpp.

◆ PointerWrappingDeclaratorKind

Describes a declarator chunk wrapping a pointer that marks inference as unexpected.

Definition at line 3371 of file SemaType.cpp.

◆ QualifiedFunctionKind

Kinds of declarator that cannot contain a qualified function type.

C++98 [dcl.fct]p4 / C++11 [dcl.fct]p6: a function type with a cv-qualifier or a ref-qualifier can only appear at the topmost level of a type.

Parens and member pointers are permitted. We don't diagnose array and function declarators, because they don't allow function types at all.

The values of this enum are used in diagnostics.

Definition at line 1842 of file SemaType.cpp.

◆ SimplePointerKind

enum SimplePointerKind
strong

A simple notion of pointer kinds, which matches up with the various pointer declarators.

Definition at line 3301 of file SemaType.cpp.

◆ 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 285 of file SemaType.cpp.

◆ TypeDiagSelector

Enumerator
TDS_Function 
TDS_Pointer 
TDS_ObjCObjOrBlock 

Definition at line 41 of file SemaType.cpp.

Function Documentation

◆ applyObjCTypeArgs()

static QualType applyObjCTypeArgs ( Sema S,
SourceLocation  loc,
QualType  type,
ArrayRef< TypeSourceInfo *>  typeArgs,
SourceRange  typeArgsRange,
bool  failOnError = false 
)
static

Apply Objective-C type arguments to the given type.

Definition at line 796 of file SemaType.cpp.

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

◆ assignInheritanceModel()

static void assignInheritanceModel ( Sema S,
CXXRecordDecl RD 
)
static

◆ checkExtParameterInfos()

static void checkExtParameterInfos ( Sema S,
ArrayRef< QualType paramTypes,
const FunctionProtoType::ExtProtoInfo EPI,
llvm::function_ref< SourceLocation(unsigned)>  getParamLoc 
)
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 2311 of file SemaType.cpp.

◆ checkNullabilityConsistency()

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

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

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

Definition at line 3645 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.

◆ checkOmittedBlockReturnType()

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

Return true if this is omitted block return type.

Also check type attributes and type qualifiers when returning true.

Definition at line 756 of file SemaType.cpp.

◆ checkQualifiedFunction()

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

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

Definition at line 1847 of file SemaType.cpp.

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

◆ classifyPointerDeclarator()

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

◆ ConvertDeclSpecToType()

static QualType ConvertDeclSpecToType ( TypeProcessingState &  state)
static

Convert the specified declspec to the appropriate type object.

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

Definition at line 1232 of file SemaType.cpp.

Referenced by GetDeclSpecTypeForDeclarator().

◆ deduceOpenCLImplicitAddrSpace()

static void deduceOpenCLImplicitAddrSpace ( TypeProcessingState &  State,
QualType T,
TypeAttrLocation  TAL 
)
static

◆ diagnoseAndRemoveTypeQualifiers()

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

Definition at line 728 of file SemaType.cpp.

◆ diagnoseBadTypeAttribute()

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

diagnoseBadTypeAttribute - Diagnoses a type attribute which doesn't apply to the given type.

Definition at line 66 of file SemaType.cpp.

Referenced by distributeFunctionTypeAttr(), and distributeObjCPointerTypeAttr().

◆ diagnoseRedundantReturnTypeQualifiers()

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

Definition at line 2650 of file SemaType.cpp.

References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::PointerTypeInfo::AtomicQualLoc, clang::DeclaratorChunk::BlockPointer, clang::DeclaratorChunk::PointerTypeInfo::ConstQualLoc, clang::Sema::diagnoseIgnoredQualifiers(), End, clang::DeclaratorChunk::Fun, clang::DeclaratorChunk::Function, clang::DeclSpec::getAtomicSpecLoc(), clang::DeclSpec::getConstSpecLoc(), clang::QualType::getCVRQualifiers(), clang::Declarator::getDeclSpec(), clang::SourceLocation::getFromRawEncoding(), clang::Declarator::getIdentifierLoc(), clang::UnqualifiedId::getKind(), clang::QualType::getLocalCVRQualifiers(), clang::Declarator::getName(), clang::Declarator::getNumTypeObjects(), clang::DeclSpec::getRestrictSpecLoc(), clang::Declarator::getTypeObject(), clang::DeclSpec::getTypeQualifiers(), clang::DeclSpec::getUnalignedSpecLoc(), clang::DeclSpec::getVolatileSpecLoc(), clang::DeclaratorChunk::FunctionTypeInfo::hasTrailingReturnType(), clang::UnqualifiedId::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.

◆ distributeFunctionTypeAttr()

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

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

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

Definition at line 517 of file SemaType.cpp.

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

Referenced by processTypeAttrs().

◆ distributeFunctionTypeAttrFromDeclarator()

static void distributeFunctionTypeAttrFromDeclarator ( TypeProcessingState &  state,
AttributeList attr,
QualType declSpecType 
)
static

A function type attribute was written on the declarator.

Try to apply it somewhere.

Definition at line 599 of file SemaType.cpp.

References distributeFunctionTypeAttrToInnermost(), clang::Declarator::getAttrListRef(), and spliceAttrOutOfList().

Referenced by distributeTypeAttrsFromDeclarator().

◆ distributeFunctionTypeAttrFromDeclSpec()

static void distributeFunctionTypeAttrFromDeclSpec ( TypeProcessingState &  state,
AttributeList attr,
QualType declSpecType 
)
static

A function type attribute was written in the decl spec.

Try to apply it somewhere.

Definition at line 571 of file SemaType.cpp.

References distributeFunctionTypeAttrToInnermost(), clang::AttributeList::isCXX11Attribute(), and moveAttrFromListToList().

Referenced by processTypeAttrs().

◆ distributeFunctionTypeAttrToInnermost()

static bool distributeFunctionTypeAttrToInnermost ( TypeProcessingState &  state,
AttributeList attr,
AttributeList *&  attrList,
QualType declSpecType 
)
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 550 of file SemaType.cpp.

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

Referenced by distributeFunctionTypeAttrFromDeclarator(), and distributeFunctionTypeAttrFromDeclSpec().

◆ distributeNullabilityTypeAttr()

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

◆ distributeObjCPointerTypeAttr()

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

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

Definition at line 397 of file SemaType.cpp.

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

Referenced by processTypeAttrs().

◆ distributeObjCPointerTypeAttrFromDeclarator()

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

◆ distributeTypeAttrsFromDeclarator()

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

Given that there are attributes written on the declarator 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;

Definition at line 625 of file SemaType.cpp.

References distributeFunctionTypeAttrFromDeclarator(), distributeObjCPointerTypeAttrFromDeclarator(), FUNCTION_TYPE_ATTRS_CASELIST, clang::AttributeList::getNext(), MS_TYPE_ATTRS_CASELIST, NULLABILITY_TYPE_ATTRS_CASELIST, and OBJC_POINTER_TYPE_ATTRS_CASELIST.

Referenced by GetDeclSpecTypeForDeclarator().

◆ emitNullabilityConsistencyWarning()

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

◆ fillAtomicQualLoc()

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

◆ fillAttributedTypeLoc()

static void fillAttributedTypeLoc ( AttributedTypeLoc  TL,
const AttributeList attrs,
const AttributeList DeclAttrs = nullptr 
)
static

◆ fillDependentAddressSpaceTypeLoc()

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

◆ fixItNullability()

static void fixItNullability ( Sema S,
DiagnosticBuilder Diag,
SourceLocation  PointerLoc,
NullabilityKind  Nullability 
)
static

◆ getAttrListKind()

static AttributeList::Kind getAttrListKind ( AttributedType::Kind  kind)
static

Map an AttributedType::Kind to an AttributeList::Kind.

Definition at line 5081 of file SemaType.cpp.

References clang::AttributedType::attr_address_space, clang::AttributedType::attr_cdecl, clang::AttributedType::attr_fastcall, clang::AttributedType::attr_inteloclbicc, clang::AttributedType::attr_ms_abi, clang::AttributedType::attr_neon_polyvector_type, clang::AttributedType::attr_neon_vector_type, clang::AttributedType::attr_nonnull, clang::AttributedType::attr_noreturn, clang::AttributedType::attr_ns_returns_retained, clang::AttributedType::attr_null_unspecified, clang::AttributedType::attr_nullable, clang::AttributedType::attr_objc_gc, clang::AttributedType::attr_objc_inert_unsafe_unretained, clang::AttributedType::attr_objc_kindof, clang::AttributedType::attr_objc_ownership, clang::AttributedType::attr_pascal, clang::AttributedType::attr_pcs, clang::AttributedType::attr_pcs_vfp, clang::AttributedType::attr_preserve_all, clang::AttributedType::attr_preserve_most, clang::AttributedType::attr_ptr32, clang::AttributedType::attr_ptr64, clang::AttributedType::attr_regcall, clang::AttributedType::attr_regparm, clang::AttributedType::attr_sptr, clang::AttributedType::attr_stdcall, clang::AttributedType::attr_swiftcall, clang::AttributedType::attr_sysv_abi, clang::AttributedType::attr_thiscall, clang::AttributedType::attr_uptr, clang::AttributedType::attr_vector_size, and clang::AttributedType::attr_vectorcall.

Referenced by fillAttributedTypeLoc(), and handleMSPointerTypeQualifierAttr().

◆ getCCForDeclaratorChunk()

static CallingConv getCCForDeclaratorChunk ( Sema S,
Declarator D,
const DeclaratorChunk::FunctionTypeInfo FTI,
unsigned  ChunkIndex 
)
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 3217 of file SemaType.cpp.

References clang::DeclaratorChunk::TypeInfoCommon::AttrList, CALLING_CONV_ATTRS_CASELIST, clang::Sema::CheckCallingConvAttr(), clang::DeclaratorChunk::Function, clang::Attr::getKind(), clang::Sema::getLangOpts(), clang::Declarator::getTypeObject(), clang::DeclaratorChunk::FunctionTypeInfo::isVariadic, clang::DeclaratorChunk::Kind, and clang::supportsVariadicCall().

◆ getCCTypeAttrKind()

static AttributedType::Kind getCCTypeAttrKind ( AttributeList Attr)
static

◆ GetDeclSpecTypeForDeclarator()

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

Definition at line 2720 of file SemaType.cpp.

References clang::Declarator::AliasDeclContext, clang::Declarator::AliasTemplateContext, clang::Auto, clang::sema::LambdaScopeInfo::AutoTemplateParameterDepth, clang::sema::LambdaScopeInfo::AutoTemplateParams, clang::Declarator::BlockContext, clang::Declarator::BlockLiteralContext, clang::Declarator::ConditionContext, clang::Sema::Context, clang::UnqualifiedId::ConversionFunctionId, clang::Declarator::ConversionIdContext, ConvertDeclSpecToType(), clang::TemplateTypeParmDecl::Create(), clang::Sema::CurContext, clang::Declarator::CXXCatchContext, clang::Declarator::CXXNewContext, clang::DecltypeAuto, clang::ASTContext::DependentTy, clang::Sema::Diag(), distributeTypeAttrsFromDeclarator(), clang::Error, clang::Declarator::FileContext, clang::Declarator::ForContext, clang::Declarator::FunctionalCastContext, clang::DeclSpec::getAttributes(), clang::Declarator::getAttributes(), clang::SourceRange::getBegin(), clang::Type::getContainedDeducedType(), clang::Declarator::getContext(), clang::Sema::getCurLambda(), clang::Declarator::getDeclSpec(), clang::AutoType::getKeyword(), clang::UnqualifiedId::getKind(), clang::Sema::getLangOpts(), clang::ParsedAttributes::getList(), clang::Decl::getLocation(), clang::Declarator::getLocStart(), clang::Declarator::getName(), clang::DeclSpec::getRepAsDecl(), clang::UnqualifiedId::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::Sema::getTemplateNameKindForDiagnostics(), clang::ASTContext::getTranslationUnitDecl(), clang::ASTContext::getTypeDeclType(), clang::TypeDecl::getTypeForDecl(), clang::Sema::GetTypeFromParser(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::GNUAutoType, clang::Declarator::hasEllipsis(), clang::Declarator::hasTrailingReturnType(), clang::UnqualifiedId::IK_ConstructorName, clang::UnqualifiedId::IK_ConstructorTemplateId, clang::UnqualifiedId::IK_ConversionFunctionId, clang::UnqualifiedId::IK_DeductionGuideName, clang::UnqualifiedId::IK_DestructorName, clang::UnqualifiedId::IK_Identifier, clang::UnqualifiedId::IK_ImplicitSelfParam, clang::UnqualifiedId::IK_LiteralOperatorId, clang::UnqualifiedId::IK_OperatorFunctionId, clang::UnqualifiedId::IK_TemplateId, clang::Declarator::InitStmtContext, clang::ASTContext::IntTy, clang::TagDecl::isCompleteDefinition(), clang::DeclSpec::isFriendSpecified(), clang::Declarator::isFunctionDeclarator(), clang::Declarator::isInvalidType(), clang::QualType::isNull(), clang::DeclSpec::isTypeSpecOwned(), clang::Declarator::KNRTypeListContext, clang::Declarator::LambdaExprContext, clang::Declarator::LambdaExprParameterContext, clang::Declarator::MemberContext, clang::Declarator::ObjCCatchContext, clang::Declarator::ObjCParameterContext, clang::Declarator::ObjCResultContext, processTypeAttrs(), clang::Declarator::PrototypeContext, clang::Sema::ReplaceAutoType(), clang::DeclSpec::SCS_static, clang::DeclSpec::SCS_typedef, clang::TagDecl::setEmbeddedInDeclarator(), clang::Declarator::setInvalidType(), clang::T, TAL_DeclSpec, clang::Declarator::TemplateParamContext, clang::Declarator::TemplateTypeArgContext, clang::Declarator::TrailingReturnContext, clang::TTK_Class, clang::TTK_Enum, clang::TTK_Interface, clang::TTK_Struct, clang::TTK_Union, clang::Declarator::TypeNameContext, and clang::ASTContext::VoidTy.

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

◆ getDecltypeForExpr()

static QualType getDecltypeForExpr ( Sema S,
Expr E 
)
static

getDecltypeForExpr - Given an expr, will return the decltype for that expression, according to the rules in C++11 [dcl.type.simple]p4 and C++11 [expr.lambda.prim]p18.

Definition at line 7810 of file SemaType.cpp.

◆ GetFullTypeForDeclarator()

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

Never complain.

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

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

Definition at line 3739 of file SemaType.cpp.

References clang::T.

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

◆ getFunctionQualifiersAsString()

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

◆ getImageAccess()

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

Definition at line 1211 of file SemaType.cpp.

◆ getLiteralDiagFromTagKind()

static unsigned getLiteralDiagFromTagKind ( TagTypeKind  Tag)
static

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

WARNING: Indexes apply to particular diagnostics only!

Returns
diagnostic select index.

Definition at line 7667 of file SemaType.cpp.

References clang::TTK_Class, clang::TTK_Interface, and clang::TTK_Struct.

◆ getNullabilityCompletenessCheckFileID()

static FileID getNullabilityCompletenessCheckFileID ( Sema S,
SourceLocation  loc 
)
static

◆ getPrintableNameForEntity()

static std::string getPrintableNameForEntity ( DeclarationName  Entity)
static

◆ HandleAddressSpaceTypeAttribute()

static void HandleAddressSpaceTypeAttribute ( QualType Type,
const AttributeList Attr,
Sema S 
)
static

◆ HandleExtVectorTypeAttr()

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

◆ handleFunctionTypeAttr()

static bool handleFunctionTypeAttr ( TypeProcessingState &  state,
AttributeList attr,
QualType type 
)
static

◆ handleMSPointerTypeQualifierAttr()

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

◆ HandleNeonVectorTypeAttr()

static void HandleNeonVectorTypeAttr ( QualType CurType,
const AttributeList Attr,
Sema S,
VectorType::VectorKind  VecKind 
)
static

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

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

Definition at line 6924 of file SemaType.cpp.

References clang::AANT_ArgumentIntegerConstant, clang::Sema::Context, clang::Sema::Diag(), clang::AttributeList::getArgAsExpr(), clang::AttributeList::getLoc(), clang::AttributeList::getName(), clang::AttributeList::getNumArgs(), clang::Stmt::getSourceRange(), clang::ASTContext::getTargetInfo(), clang::ASTContext::getTypeSize(), clang::ASTContext::getVectorType(), clang::TargetInfo::hasFeature(), clang::Expr::isIntegerConstantExpr(), isPermittedNeonBaseType(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::AttributeList::setInvalid().

Referenced by processTypeAttrs().

◆ handleObjCGCTypeAttr()

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

◆ handleObjCOwnershipTypeAttr()

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

handleObjCOwnershipTypeAttr - Process an objc_ownership attribute on the specified type.

Returns 'true' if the attribute was handled.

Definition at line 5815 of file SemaType.cpp.

References clang::AANT_ArgumentString, clang::Qualifiers::addObjCLifetime(), clang::AttributedType::attr_objc_inert_unsafe_unretained, clang::AttributedType::attr_objc_ownership, clang::Sema::Context, clang::Sema::Diag(), clang::AttributeList::getArgAsIdent(), clang::Type::getAs(), clang::ASTContext::getAttributedType(), clang::SourceManager::getImmediateExpansionRange(), clang::Sema::getLangOpts(), clang::AttributeList::getLoc(), clang::IdentifierInfo::getName(), clang::AttributeList::getName(), clang::Declarator::getNumTypeObjects(), clang::Qualifiers::getObjCLifetime(), clang::Type::getPointeeType(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::SplitQualType::getSingleStepDesugaredType(), clang::Sema::getSourceManager(), hasDirectOwnershipQualifier(), clang::IdentifierLoc::Ident, clang::AttributeList::isArgIdent(), clang::Type::isDependentType(), clang::SourceLocation::isMacroID(), clang::Type::isObjCRetainableType(), clang::Type::isPointerType(), clang::IdentifierInfo::isStr(), clang::Type::isUndeducedType(), clang::SourceLocation::isValid(), 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::AttributeList::setInvalid(), clang::QualType::split(), TDS_ObjCObjOrBlock, clang::SplitQualType::Ty, and clang::ast_matchers::type.

Referenced by handleObjCPointerTypeAttr().

◆ handleObjCPointerTypeAttr()

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

◆ HandleOpenCLAccessAttr()

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

◆ HandleVectorSizeAttr()

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

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

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

Definition at line 6775 of file SemaType.cpp.

References clang::AANT_ArgumentIntegerConstant, clang::Sema::Context, clang::Sema::Diag(), clang::VectorType::GenericVector, clang::AttributeList::getArgAsExpr(), clang::AttributeList::getLoc(), clang::AttributeList::getName(), clang::AttributeList::getNumArgs(), clang::Stmt::getSourceRange(), clang::ASTContext::getTypeSize(), clang::ASTContext::getVectorType(), clang::Type::isBooleanType(), clang::Type::isBuiltinType(), clang::Expr::isIntegerConstantExpr(), clang::Type::isIntegerType(), clang::Type::isRealFloatingType(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::VectorType::isVectorSizeTooLarge(), and clang::AttributeList::setInvalid().

Referenced by processTypeAttrs().

◆ hasDirectOwnershipQualifier()

static bool hasDirectOwnershipQualifier ( QualType  type)
static

Does this type have a "direct" ownership qualifier? That is, is it written like "__strong id", as opposed to something like "typeof(foo)", where that happens to be strong?

Definition at line 5784 of file SemaType.cpp.

References clang::AttributedType::attr_objc_ownership, clang::QualType::getQualifiers(), and clang::Qualifiers::hasObjCLifetime().

Referenced by handleObjCOwnershipTypeAttr().

◆ hasNullabilityAttr()

static bool hasNullabilityAttr ( const AttributeList attrs)
static

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

Definition at line 3339 of file SemaType.cpp.

References clang::AttributeList::getNext().

Referenced by distributeNullabilityTypeAttr().

◆ hasOuterPointerLikeChunk()

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

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

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

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

Definition at line 3715 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 processTypeAttrs().

◆ inferARCLifetimeForPointee()

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

Given that we're building a pointer or reference to the given.

Definition at line 1756 of file SemaType.cpp.

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

◆ inferARCWriteback()

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

◆ isArraySizeVLA()

static bool isArraySizeVLA ( Sema S,
Expr ArraySize,
llvm::APSInt &  SizeVal 
)
static

Check whether the specified array size makes the array type a VLA.

If so, return true, if not, return the size of the array in SizeVal.

Definition at line 1988 of file SemaType.cpp.

◆ isOmittedBlockReturnType()

static bool isOmittedBlockReturnType ( const Declarator D)
static

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

Definition at line 49 of file SemaType.cpp.

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

◆ isPermittedNeonBaseType()

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

◆ mapNullabilityAttrKind()

static NullabilityKind mapNullabilityAttrKind ( AttributeList::Kind  kind)
static

Map a nullability attribute kind to a nullability kind.

Definition at line 6403 of file SemaType.cpp.

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

Referenced by distributeNullabilityTypeAttr(), and processTypeAttrs().

◆ maybeMovePastReturnType()

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

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

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

Definition at line 329 of file SemaType.cpp.

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

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

◆ maybeSynthesizeBlockSignature()

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

◆ moveAttrFromListToList()

static void moveAttrFromListToList ( AttributeList attr,
AttributeList *&  fromList,
AttributeList *&  toList 
)
static

◆ processTypeAttrs()

static void processTypeAttrs ( TypeProcessingState &  state,
QualType type,
TypeAttrLocation  TAL,
AttributeList attrs 
)
static

Definition at line 7092 of file SemaType.cpp.

References clang::Type::canHaveNullability(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), deduceOpenCLImplicitAddrSpace(), clang::Default, distributeFunctionTypeAttr(), distributeFunctionTypeAttrFromDeclSpec(), distributeNullabilityTypeAttr(), distributeObjCPointerTypeAttr(), FUNCTION_TYPE_ATTRS_CASELIST, clang::QualType::getAddressSpace(), clang::AttributeList::getKind(), clang::AttributeList::getLoc(), clang::AttributeList::getName(), clang::AttributeList::getNext(), clang::AttributeList::getScopeName(), HandleAddressSpaceTypeAttribute(), HandleExtVectorTypeAttr(), handleFunctionTypeAttr(), handleMSPointerTypeQualifierAttr(), HandleNeonVectorTypeAttr(), handleObjCPointerTypeAttr(), HandleOpenCLAccessAttr(), HandleVectorSizeAttr(), hasOuterPointerLikeChunk(), clang::AttributeList::IgnoredAttribute, clang::Type::isArrayType(), clang::AttributeList::isContextSensitiveKeywordAttribute(), clang::AttributeList::isCXX11Attribute(), clang::Type::isDependentType(), clang::AttributeList::isInvalid(), clang::IdentifierInfo::isStr(), mapNullabilityAttrKind(), MS_TYPE_ATTRS_CASELIST, clang::VectorType::NeonPolyVector, clang::VectorType::NeonVector, NULLABILITY_TYPE_ATTRS_CASELIST, OBJC_POINTER_TYPE_ATTRS_CASELIST, clang::AttributeList::setInvalid(), clang::AttributeList::setUsedAsTypeAttr(), TAL_DeclChunk, TAL_DeclName, TAL_DeclSpec, and clang::AttributeList::UnknownAttribute.

Referenced by GetDeclSpecTypeForDeclarator().

◆ recordNullabilitySeen()

static void recordNullabilitySeen ( Sema S,
SourceLocation  loc 
)
static

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

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

See also
checkNullabilityConsistency

Definition at line 3686 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 clang::Sema::checkNullabilityTypeSpecifier().

◆ spliceAttrIntoList()

static void spliceAttrIntoList ( AttributeList attr,
AttributeList *&  head 
)
static

◆ spliceAttrOutOfList()

static void spliceAttrOutOfList ( AttributeList attr,
AttributeList *&  head 
)
static

◆ transferARCOwnership()

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

◆ transferARCOwnershipToDeclaratorChunk()

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

◆ transferARCOwnershipToDeclSpec()

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

◆ warnAboutAmbiguousFunction()

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

◆ warnAboutRedundantParens()

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