clang 19.0.0git
Namespaces | Enumerations | Functions
SemaDeclAttr.cpp File Reference
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTMutationListener.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/Mangle.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/Type.h"
#include "clang/Basic/CharInfo.h"
#include "clang/Basic/Cuda.h"
#include "clang/Basic/DarwinSDKInfo.h"
#include "clang/Basic/HLSLRuntime.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetBuiltins.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/DeclSpec.h"
#include "clang/Sema/DelayedDiagnostic.h"
#include "clang/Sema/Initialization.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/ParsedAttr.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/SemaInternal.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/IR/Assumptions.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>
#include "clang/Basic/arm_mve_builtin_aliases.inc"
#include "clang/Basic/arm_cde_builtin_aliases.inc"

Go to the source code of this file.

Namespaces

namespace  AttributeLangSupport
 

Enumerations

enum  AttributeLangSupport::LANG { AttributeLangSupport::C , AttributeLangSupport::Cpp , AttributeLangSupport::ObjC }
 
enum  FormatAttrKind {
  CFStringFormat , NSStringFormat , StrftimeFormat , SupportedFormat ,
  IgnoredFormat , InvalidFormat
}
 

Functions

static bool isFunctionOrMethod (const Decl *D)
 isFunctionOrMethod - Return true if the given decl has function type (function or function-typed variable) or an Objective-C method.
 
static bool isFunctionOrMethodOrBlock (const Decl *D)
 Return true if the given decl has function type (function or function-typed variable) or an Objective-C method or a block.
 
static bool hasDeclarator (const Decl *D)
 Return true if the given decl has a declarator that should have been processed by Sema::GetTypeForDeclarator.
 
static bool hasFunctionProto (const Decl *D)
 hasFunctionProto - Return true if the given decl has a argument information.
 
static unsigned getFunctionOrMethodNumParams (const Decl *D)
 getFunctionOrMethodNumParams - Return number of function or method parameters.
 
static const ParmVarDeclgetFunctionOrMethodParam (const Decl *D, unsigned Idx)
 
static QualType getFunctionOrMethodParamType (const Decl *D, unsigned Idx)
 
static SourceRange getFunctionOrMethodParamRange (const Decl *D, unsigned Idx)
 
static QualType getFunctionOrMethodResultType (const Decl *D)
 
static SourceRange getFunctionOrMethodResultSourceRange (const Decl *D)
 
static bool isFunctionOrMethodVariadic (const Decl *D)
 
static bool isInstanceMethod (const Decl *D)
 
static bool isNSStringType (QualType T, ASTContext &Ctx, bool AllowNSAttributedString=false)
 
static bool isCFStringType (QualType T, ASTContext &Ctx)
 
static unsigned getNumAttributeArgs (const ParsedAttr &AL)
 
template<typename AttrInfo >
static std::enable_if_t< std::is_base_of_v< Attr, AttrInfo >, SourceLocationgetAttrLoc (const AttrInfo &AL)
 A helper function to provide Attribute Location for the Attr types AND the ParsedAttr.
 
static SourceLocation getAttrLoc (const ParsedAttr &AL)
 
template<typename AttrInfo >
static bool checkUInt32Argument (Sema &S, const AttrInfo &AI, const Expr *Expr, uint32_t &Val, unsigned Idx=UINT_MAX, bool StrictlyUnsigned=false)
 If Expr is a valid integer constant, get the value of the integer expression and return success or failure.
 
template<typename AttrInfo >
static bool checkPositiveIntArgument (Sema &S, const AttrInfo &AI, const Expr *Expr, int &Val, unsigned Idx=UINT_MAX)
 Wrapper around checkUInt32Argument, with an extra check to be sure that the result will fit into a regular (signed) int.
 
template<typename AttrTy >
static bool checkAttrMutualExclusion (Sema &S, Decl *D, const ParsedAttr &AL)
 Diagnose mutually exclusive attributes when present on a given declaration.
 
template<typename AttrTy >
static bool checkAttrMutualExclusion (Sema &S, Decl *D, const Attr &AL)
 
template<typename AttrInfo >
static bool checkFunctionOrMethodParameterIndex (Sema &S, const Decl *D, const AttrInfo &AI, unsigned AttrArgNum, const Expr *IdxExpr, ParamIdx &Idx, bool CanIndexImplicitThis=false)
 Check if IdxExpr is a valid parameter index for a function or instance method D.
 
template<typename AttrType >
static void handleSimpleAttribute (Sema &S, Decl *D, const AttributeCommonInfo &CI)
 Applies the given attribute to the Decl without performing any additional semantic checking.
 
template<typename... DiagnosticArgs>
static const Sema::SemaDiagnosticBuilderappendDiagnostics (const Sema::SemaDiagnosticBuilder &Bldr)
 
template<typename T , typename... DiagnosticArgs>
static const Sema::SemaDiagnosticBuilderappendDiagnostics (const Sema::SemaDiagnosticBuilder &Bldr, T &&ExtraArg, DiagnosticArgs &&... ExtraArgs)
 
template<typename AttrType , typename... DiagnosticArgs>
static void handleSimpleAttributeOrDiagnose (Sema &S, Decl *D, const AttributeCommonInfo &CI, bool PassesCheck, unsigned DiagID, DiagnosticArgs &&... ExtraArgs)
 Add an attribute AttrType to declaration D, provided that PassesCheck is true.
 
static bool isIntOrBool (Expr *Exp)
 Check if the passed-in expression is of type int or bool.
 
static bool threadSafetyCheckIsSmartPointer (Sema &S, const RecordType *RT)
 
static bool threadSafetyCheckIsPointer (Sema &S, const Decl *D, const ParsedAttr &AL)
 Check if passed in Decl is a pointer type.
 
static const RecordTypegetRecordType (QualType QT)
 Checks that the passed in QualType either is of RecordType or points to RecordType.
 
template<typename AttrType >
static bool checkRecordDeclForAttr (const RecordDecl *RD)
 
static bool checkRecordTypeForCapability (Sema &S, QualType Ty)
 
static bool checkTypedefTypeForCapability (QualType Ty)
 
static bool typeHasCapability (Sema &S, QualType Ty)
 
static bool isCapabilityExpr (Sema &S, const Expr *Ex)
 
static void checkAttrArgsAreCapabilityObjs (Sema &S, Decl *D, const ParsedAttr &AL, SmallVectorImpl< Expr * > &Args, unsigned Sidx=0, bool ParamIdxOk=false)
 Checks that all attribute arguments, starting from Sidx, resolve to a capability object.
 
static void handlePtGuardedVarAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool checkGuardedByAttrCommon (Sema &S, Decl *D, const ParsedAttr &AL, Expr *&Arg)
 
static void handleGuardedByAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handlePtGuardedByAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool checkAcquireOrderAttrCommon (Sema &S, Decl *D, const ParsedAttr &AL, SmallVectorImpl< Expr * > &Args)
 
static void handleAcquiredAfterAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAcquiredBeforeAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool checkLockFunAttrCommon (Sema &S, Decl *D, const ParsedAttr &AL, SmallVectorImpl< Expr * > &Args)
 
static void handleAssertSharedLockAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAssertExclusiveLockAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
template<typename AttrInfo >
static bool checkParamIsIntegerType (Sema &S, const Decl *D, const AttrInfo &AI, unsigned AttrArgNo)
 Checks to be sure that the given parameter number is in bounds, and is an integral type.
 
static void handleAllocSizeAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool checkTryLockFunAttrCommon (Sema &S, Decl *D, const ParsedAttr &AL, SmallVectorImpl< Expr * > &Args)
 
static void handleSharedTrylockFunctionAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleExclusiveTrylockFunctionAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleLockReturnedAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleLocksExcludedAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool checkFunctionConditionAttr (Sema &S, Decl *D, const ParsedAttr &AL, Expr *&Cond, StringRef &Msg)
 
static void handleEnableIfAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleErrorAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleDiagnoseAsBuiltinAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleDiagnoseIfAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleNoBuiltinAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handlePassObjectSizeAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleConsumableAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool checkForConsumableClass (Sema &S, const CXXMethodDecl *MD, const ParsedAttr &AL)
 
static void handleCallableWhenAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleParamTypestateAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleReturnTypestateAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleSetTypestateAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleTestTypestateAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleExtVectorTypeAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handlePackedAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handlePreferredName (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool checkIBOutletCommon (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleIBOutlet (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleIBOutletCollection (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool attrNonNullArgCheck (Sema &S, QualType T, const ParsedAttr &AL, SourceRange AttrParmRange, SourceRange TypeRange, bool isReturnValue=false)
 
static void handleNonNullAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleNonNullAttrParameter (Sema &S, ParmVarDecl *D, const ParsedAttr &AL)
 
static void handleReturnsNonNullAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleNoEscapeAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAssumeAlignedAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAllocAlignAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void checkOMPAssumeAttr (Sema &S, SourceLocation Loc, StringRef AssumptionStr)
 Check if AssumptionStr is a known assumption and warn if not.
 
static void handleOMPAssumeAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool normalizeName (StringRef &AttrName)
 Normalize the attribute, foo becomes foo.
 
static void handleOwnershipAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleWeakRefAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleIFuncAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAliasAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleTLSModelAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleRestrictAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleCPUSpecificAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleCommonAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleCmseNSEntryAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleNakedAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleNoReturnAttr (Sema &S, Decl *D, const ParsedAttr &Attrs)
 
static void handleStandardNoReturnAttr (Sema &S, Decl *D, const ParsedAttr &A)
 
static void handleNoCfCheckAttr (Sema &S, Decl *D, const ParsedAttr &Attrs)
 
static void handleAnalyzerNoReturnAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleVecReturnAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleDependencyAttr (Sema &S, Scope *Scope, Decl *D, const ParsedAttr &AL)
 
static void handleUnusedAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleConstructorAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleDestructorAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
template<typename AttrTy >
static void handleAttrWithMessage (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleObjCSuppresProtocolAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool checkAvailabilityAttr (Sema &S, SourceRange Range, IdentifierInfo *Platform, VersionTuple Introduced, VersionTuple Deprecated, VersionTuple Obsoleted)
 
static bool versionsMatch (const VersionTuple &X, const VersionTuple &Y, bool BeforeIsOkay)
 Check whether the two versions match.
 
static void handleAvailabilityAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleExternalSourceSymbolAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
template<class T >
static T * mergeVisibilityAttr (Sema &S, Decl *D, const AttributeCommonInfo &CI, typename T::VisibilityType value)
 
static void handleVisibilityAttr (Sema &S, Decl *D, const ParsedAttr &AL, bool isTypeVisibility)
 
static void handleObjCDirectAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleObjCDirectMembersAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleObjCMethodFamilyAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleObjCNSObject (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleObjCIndependentClass (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleBlocksAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleSentinelAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleWarnUnusedResult (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleWeakImportAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
template<typename WorkGroupAttr >
static void handleWorkGroupSize (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleSubGroupSize (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleVecTypeHint (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleSectionAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleCodeModelAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool checkCodeSegName (Sema &S, SourceLocation LiteralLoc, StringRef CodeSegName)
 
static void handleCodeSegAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool hasArmStreamingInterface (const FunctionDecl *FD)
 
static void handleTargetVersionAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleTargetAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleTargetClonesAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleMinVectorWidthAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleCleanupAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleEnumExtensibilityAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleFormatArgAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 Handle attribute((format_arg((idx)))) attribute based on http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html.
 
static FormatAttrKind getFormatAttrKind (StringRef Format)
 getFormatAttrKind - Map from format attribute names to supported format types.
 
static void handleInitPriorityAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 Handle attribute((init_priority(priority))) attributes based on http://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Attributes.html.
 
static void handleFormatAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 Handle attribute((format(type,idx,firstarg))) attributes based on http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html.
 
static void handleCallbackAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 Handle attribute((callback(CalleeIdx, PayloadIdx0, ...))) attributes.
 
static bool isFunctionLike (const Type &T)
 
static void handleCalledOnceAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 Handle 'called_once' attribute.
 
static void handleTransparentUnionAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAnnotateAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAlignValueAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAlignedAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool validateAlignasAppliedType (Sema &S, Decl *D, const AlignedAttr &Attr, SourceLocation AttrLoc)
 Perform checking of type validity.
 
static void parseModeAttrArg (Sema &S, StringRef Str, unsigned &DestWidth, bool &IntegerMode, bool &ComplexMode, FloatModeKind &ExplicitType)
 parseModeAttrArg - Parses attribute mode string and returns parsed type attribute.
 
static void handleModeAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 handleModeAttr - This attribute modifies the width of a decl with primitive type.
 
static void handleNoDebugAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAlwaysInlineAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleMinSizeAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleOptimizeNoneAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleConstantAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleSharedAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleGlobalAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleDeviceAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleManagedAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleGNUInlineAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleCallConvAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleSuppressAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleLifetimeCategoryAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleRandomizeLayoutAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleNoRandomizeLayoutAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool isValidSwiftContextType (QualType Ty)
 Pointer-like types in the default address space.
 
static bool isValidSwiftIndirectResultType (QualType Ty)
 Pointers and references in the default address space.
 
static bool isValidSwiftErrorResultType (QualType Ty)
 Pointers and references to pointers in the default address space.
 
static CudaArch getCudaArch (const TargetInfo &TI)
 
static ExprmakeLaunchBoundsArgExpr (Sema &S, Expr *E, const CUDALaunchBoundsAttr &AL, const unsigned Idx)
 
static void handleLaunchBoundsAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleArgumentWithTypeTagAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleTypeTagForDatatypeAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleXRayLogArgsAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handlePatchableFunctionEntryAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool ArmBuiltinAliasValid (unsigned BuiltinID, StringRef AliasName, ArrayRef< IntrinToName > Map, const char *IntrinNames)
 
static bool ArmMveAliasValid (unsigned BuiltinID, StringRef AliasName)
 
static bool ArmCdeAliasValid (unsigned BuiltinID, StringRef AliasName)
 
static bool ArmSveAliasValid (ASTContext &Context, unsigned BuiltinID, StringRef AliasName)
 
static bool ArmSmeAliasValid (ASTContext &Context, unsigned BuiltinID, StringRef AliasName)
 
static void handleArmBuiltinAliasAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool RISCVAliasValid (unsigned BuiltinID, StringRef AliasName)
 
static void handleBuiltinAliasAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handlePreferredTypeAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool isValidSubjectOfNSReturnsRetainedAttribute (QualType QT)
 
static bool isValidSubjectOfNSAttribute (QualType QT)
 
static bool isValidSubjectOfCFAttribute (QualType QT)
 
static bool isValidSubjectOfOSAttribute (QualType QT)
 
static Sema::RetainOwnershipKind parsedAttrToRetainOwnershipKind (const ParsedAttr &AL)
 
static bool isValidOSObjectOutParameter (const Decl *D)
 
static void handleXReturnsXRetainedAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleObjCReturnsInnerPointerAttr (Sema &S, Decl *D, const ParsedAttr &Attrs)
 
static void handleObjCRequiresSuperAttr (Sema &S, Decl *D, const ParsedAttr &Attrs)
 
static void handleNSErrorDomain (Sema &S, Decl *D, const ParsedAttr &Attr)
 
static void handleObjCBridgeAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleObjCBridgeMutableAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleObjCBridgeRelatedAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleObjCDesignatedInitializer (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleObjCRuntimeName (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleObjCBoxable (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleObjCOwnershipAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleObjCPreciseLifetimeAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleSwiftAttrAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleSwiftBridge (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool isErrorParameter (Sema &S, QualType QT)
 
static void handleSwiftError (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void checkSwiftAsyncErrorBlock (Sema &S, Decl *D, const SwiftAsyncErrorAttr *ErrorAttr, const SwiftAsyncAttr *AsyncAttr)
 
static void handleSwiftAsyncError (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool validateSwiftFunctionName (Sema &S, const ParsedAttr &AL, SourceLocation Loc, StringRef Name, unsigned &SwiftParamCount, bool &IsSingleParamInit)
 
static void handleSwiftName (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleSwiftAsyncName (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleSwiftNewType (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleSwiftAsyncAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleUuidAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleHLSLNumThreadsAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool isLegalTypeForHLSLSV_DispatchThreadID (QualType T)
 
static void handleHLSLSV_DispatchThreadIDAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleHLSLShaderAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleHLSLResourceBindingAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleHLSLParamModifierAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleMSInheritanceAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleDeclspecThreadAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleMSConstexprAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAbiTagAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleARMInterruptAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleMSP430InterruptAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleMipsInterruptAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleM68kInterruptAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAnyX86InterruptAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAVRInterruptAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAVRSignalAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleBPFPreserveAIRecord (Sema &S, RecordDecl *RD)
 
static void handleBPFPreserveAccessIndexAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool hasBTFDeclTagAttr (Decl *D, StringRef Tag)
 
static void handleBTFDeclTagAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleWebAssemblyExportNameAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleWebAssemblyImportModuleAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleWebAssemblyImportNameAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleRISCVInterruptAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleInterruptAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool checkAMDGPUFlatWorkGroupSizeArguments (Sema &S, Expr *MinExpr, Expr *MaxExpr, const AMDGPUFlatWorkGroupSizeAttr &Attr)
 
static void handleAMDGPUFlatWorkGroupSizeAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool checkAMDGPUWavesPerEUArguments (Sema &S, Expr *MinExpr, Expr *MaxExpr, const AMDGPUWavesPerEUAttr &Attr)
 
static void handleAMDGPUWavesPerEUAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAMDGPUNumSGPRAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAMDGPUNumVGPRAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool checkAMDGPUMaxNumWorkGroupsArguments (Sema &S, Expr *XExpr, Expr *YExpr, Expr *ZExpr, const AMDGPUMaxNumWorkGroupsAttr &Attr)
 
static void handleAMDGPUMaxNumWorkGroupsAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleX86ForceAlignArgPointerAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleLayoutVersion (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleDLLAttr (Sema &S, Decl *D, const ParsedAttr &A)
 
static void handleCapabilityAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAssertCapabilityAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAcquireCapabilityAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleTryAcquireCapabilityAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleReleaseCapabilityAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleRequiresCapabilityAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleDeprecatedAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool isGlobalVar (const Decl *D)
 
static bool isSanitizerAttributeAllowedOnGlobals (StringRef Sanitizer)
 
static void handleNoSanitizeAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleNoSanitizeSpecificAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleInternalLinkageAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleOpenCLNoSVMAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleOpenCLAccessAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleZeroCallUsedRegsAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleCountedByAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static const FieldDeclFindFieldInTopLevelOrAnonymousStruct (const RecordDecl *RD, const IdentifierInfo *FieldName)
 
static void handleFunctionReturnThunksAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAvailableOnlyInDefaultEvalMethod (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleNoMergeAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleNoUniqueAddressAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleSYCLKernelAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleDestroyAttr (Sema &S, Decl *D, const ParsedAttr &A)
 
static void handleUninitializedAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool tryMakeVariablePseudoStrong (Sema &S, VarDecl *VD, bool DiagnoseFailure)
 
static void handleObjCExternallyRetainedAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleMIGServerRoutineAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleMSAllocatorAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleAcquireHandleAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
template<typename Attr >
static void handleHandleAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
template<typename Attr >
static void handleUnsafeBufferUsage (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleCFGuardAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
template<typename AttrTy >
static const AttrTy * findEnforceTCBAttrByName (Decl *D, StringRef Name)
 
template<typename AttrTy , typename ConflictingAttrTy >
static void handleEnforceTCBAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
template<typename AttrTy , typename ConflictingAttrTy >
static AttrTy * mergeEnforceTCBAttrImpl (Sema &S, Decl *D, const AttrTy &AL)
 
static bool MustDelayAttributeArguments (const ParsedAttr &AL)
 
static bool checkArmNewAttrMutualExclusion (Sema &S, const ParsedAttr &AL, const FunctionProtoType *FPT, FunctionType::ArmStateValue CurrentState, StringRef StateName)
 
static void handleArmNewAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void ProcessDeclAttribute (Sema &S, Scope *scope, Decl *D, const ParsedAttr &AL, const Sema::ProcessDeclAttributeOptions &Options)
 ProcessDeclAttribute - Apply the specific attribute to the specified decl if the attribute applies to decls.
 
static void checkUnusedDeclAttributes (Sema &S, const ParsedAttributesView &A)
 checkUnusedDeclAttributes - Check a list of attributes to see if it contains any decl attributes that we should warn about.
 
static bool isForbiddenTypeAllowed (Sema &S, Decl *D, const DelayedDiagnostic &diag, UnavailableAttr::ImplicitReason &reason)
 Is the given declaration allowed to use a forbidden type? If so, it'll still be annotated with an attribute that makes it illegal to actually use.
 
static void handleDelayedForbiddenType (Sema &S, DelayedDiagnostic &DD, Decl *D)
 Handle a delayed forbidden-type diagnostic.
 

Enumeration Type Documentation

◆ FormatAttrKind

Enumerator
CFStringFormat 
NSStringFormat 
StrftimeFormat 
SupportedFormat 
IgnoredFormat 
InvalidFormat 

Definition at line 3879 of file SemaDeclAttr.cpp.

Function Documentation

◆ appendDiagnostics() [1/2]

template<typename... DiagnosticArgs>
static const Sema::SemaDiagnosticBuilder & appendDiagnostics ( const Sema::SemaDiagnosticBuilder Bldr)
static

Definition at line 408 of file SemaDeclAttr.cpp.

Referenced by appendDiagnostics(), and handleSimpleAttributeOrDiagnose().

◆ appendDiagnostics() [2/2]

template<typename T , typename... DiagnosticArgs>
static const Sema::SemaDiagnosticBuilder & appendDiagnostics ( const Sema::SemaDiagnosticBuilder Bldr,
T &&  ExtraArg,
DiagnosticArgs &&...  ExtraArgs 
)
static

Definition at line 414 of file SemaDeclAttr.cpp.

References appendDiagnostics().

◆ ArmBuiltinAliasValid()

static bool ArmBuiltinAliasValid ( unsigned  BuiltinID,
StringRef  AliasName,
ArrayRef< IntrinToName >  Map,
const char *  IntrinNames 
)
static

Definition at line 5875 of file SemaDeclAttr.cpp.

References Id.

Referenced by ArmCdeAliasValid(), and ArmMveAliasValid().

◆ ArmCdeAliasValid()

static bool ArmCdeAliasValid ( unsigned  BuiltinID,
StringRef  AliasName 
)
static

Definition at line 5902 of file SemaDeclAttr.cpp.

References ArmBuiltinAliasValid().

Referenced by handleArmBuiltinAliasAttr(), and handleBuiltinAliasAttr().

◆ ArmMveAliasValid()

static bool ArmMveAliasValid ( unsigned  BuiltinID,
StringRef  AliasName 
)
static

Definition at line 5894 of file SemaDeclAttr.cpp.

References ArmBuiltinAliasValid().

Referenced by handleArmBuiltinAliasAttr(), and handleBuiltinAliasAttr().

◆ ArmSmeAliasValid()

static bool ArmSmeAliasValid ( ASTContext Context,
unsigned  BuiltinID,
StringRef  AliasName 
)
static

◆ ArmSveAliasValid()

static bool ArmSveAliasValid ( ASTContext Context,
unsigned  BuiltinID,
StringRef  AliasName 
)
static

◆ attrNonNullArgCheck()

static bool attrNonNullArgCheck ( Sema S,
QualType  T,
const ParsedAttr AL,
SourceRange  AttrParmRange,
SourceRange  TypeRange,
bool  isReturnValue = false 
)
static

◆ checkAcquireOrderAttrCommon()

static bool checkAcquireOrderAttrCommon ( Sema S,
Decl D,
const ParsedAttr AL,
SmallVectorImpl< Expr * > &  Args 
)
static

◆ checkAMDGPUFlatWorkGroupSizeArguments()

static bool checkAMDGPUFlatWorkGroupSizeArguments ( Sema S,
Expr MinExpr,
Expr MaxExpr,
const AMDGPUFlatWorkGroupSizeAttr &  Attr 
)
static

◆ checkAMDGPUMaxNumWorkGroupsArguments()

static bool checkAMDGPUMaxNumWorkGroupsArguments ( Sema S,
Expr XExpr,
Expr YExpr,
Expr ZExpr,
const AMDGPUMaxNumWorkGroupsAttr &  Attr 
)
static

◆ checkAMDGPUWavesPerEUArguments()

static bool checkAMDGPUWavesPerEUArguments ( Sema S,
Expr MinExpr,
Expr MaxExpr,
const AMDGPUWavesPerEUAttr &  Attr 
)
static

◆ checkArmNewAttrMutualExclusion()

static bool checkArmNewAttrMutualExclusion ( Sema S,
const ParsedAttr AL,
const FunctionProtoType FPT,
FunctionType::ArmStateValue  CurrentState,
StringRef  StateName 
)
static

◆ checkAttrArgsAreCapabilityObjs()

static void checkAttrArgsAreCapabilityObjs ( Sema S,
Decl D,
const ParsedAttr AL,
SmallVectorImpl< Expr * > &  Args,
unsigned  Sidx = 0,
bool  ParamIdxOk = false 
)
static

Checks that all attribute arguments, starting from Sidx, resolve to a capability object.

Parameters
SidxThe attribute argument index to start checking with.
ParamIdxOkWhether an argument can be indexing into a function parameter list.

Definition at line 603 of file SemaDeclAttr.cpp.

References clang::Sema::Diag(), clang::ParsedAttr::getArgAsExpr(), clang::AttributeCommonInfo::getLoc(), clang::ParsedAttr::getNumArgs(), clang::DeclContext::getParent(), getRecordType(), clang::Expr::getType(), isCapabilityExpr(), clang::Expr::isTypeDependent(), and typeHasCapability().

Referenced by checkAcquireOrderAttrCommon(), checkGuardedByAttrCommon(), checkLockFunAttrCommon(), checkTryLockFunAttrCommon(), handleLockReturnedAttr(), handleLocksExcludedAttr(), handleReleaseCapabilityAttr(), and handleRequiresCapabilityAttr().

◆ checkAttrMutualExclusion() [1/2]

template<typename AttrTy >
static bool checkAttrMutualExclusion ( Sema S,
Decl D,
const Attr AL 
)
static

◆ checkAttrMutualExclusion() [2/2]

template<typename AttrTy >
static bool checkAttrMutualExclusion ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

Diagnose mutually exclusive attributes when present on a given declaration.

Returns true if diagnosed.

Definition at line 275 of file SemaDeclAttr.cpp.

References clang::Sema::Diag(), clang::Decl::getAttr(), clang::AttributeCommonInfo::getLoc(), and clang::AttributeCommonInfo::isRegularKeywordAttribute().

◆ checkAvailabilityAttr()

static bool checkAvailabilityAttr ( Sema S,
SourceRange  Range,
IdentifierInfo Platform,
VersionTuple  Introduced,
VersionTuple  Deprecated,
VersionTuple  Obsoleted 
)
static

◆ checkCodeSegName()

static bool checkCodeSegName ( Sema S,
SourceLocation  LiteralLoc,
StringRef  CodeSegName 
)
static

◆ checkForConsumableClass()

static bool checkForConsumableClass ( Sema S,
const CXXMethodDecl MD,
const ParsedAttr AL 
)
static

◆ checkFunctionConditionAttr()

static bool checkFunctionConditionAttr ( Sema S,
Decl D,
const ParsedAttr AL,
Expr *&  Cond,
StringRef &  Msg 
)
static

◆ checkFunctionOrMethodParameterIndex()

template<typename AttrInfo >
static bool checkFunctionOrMethodParameterIndex ( Sema S,
const Decl D,
const AttrInfo &  AI,
unsigned  AttrArgNum,
const Expr IdxExpr,
ParamIdx Idx,
bool  CanIndexImplicitThis = false 
)
static

◆ checkGuardedByAttrCommon()

static bool checkGuardedByAttrCommon ( Sema S,
Decl D,
const ParsedAttr AL,
Expr *&  Arg 
)
static

Definition at line 707 of file SemaDeclAttr.cpp.

References checkAttrArgsAreCapabilityObjs().

Referenced by handleGuardedByAttr(), and handlePtGuardedByAttr().

◆ checkIBOutletCommon()

static bool checkIBOutletCommon ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ checkLockFunAttrCommon()

static bool checkLockFunAttrCommon ( Sema S,
Decl D,
const ParsedAttr AL,
SmallVectorImpl< Expr * > &  Args 
)
static

◆ checkOMPAssumeAttr()

static void checkOMPAssumeAttr ( Sema S,
SourceLocation  Loc,
StringRef  AssumptionStr 
)
static

Check if AssumptionStr is a known assumption and warn if not.

Definition at line 1774 of file SemaDeclAttr.cpp.

References clang::Sema::Diag().

Referenced by handleOMPAssumeAttr().

◆ checkParamIsIntegerType()

template<typename AttrInfo >
static bool checkParamIsIntegerType ( Sema S,
const Decl D,
const AttrInfo &  AI,
unsigned  AttrArgNo 
)
static

Checks to be sure that the given parameter number is in bounds, and is an integral type.

Will emit appropriate diagnostics if this returns false.

AttrArgNo is used to actually retrieve the argument, so it's base-0.

Definition at line 818 of file SemaDeclAttr.cpp.

References checkFunctionOrMethodParameterIndex(), clang::Sema::Diag(), clang::ParamIdx::getASTIndex(), clang::Stmt::getBeginLoc(), getFunctionOrMethodParamRange(), getFunctionOrMethodParamType(), clang::Type::isCharType(), and clang::Type::isIntegerType().

Referenced by handleAllocSizeAttr().

◆ checkPositiveIntArgument()

template<typename AttrInfo >
static bool checkPositiveIntArgument ( Sema S,
const AttrInfo &  AI,
const Expr Expr,
int Val,
unsigned  Idx = UINT_MAX 
)
static

Wrapper around checkUInt32Argument, with an extra check to be sure that the result will fit into a regular (signed) int.

All args have the same purpose as they do in checkUInt32Argument.

Definition at line 254 of file SemaDeclAttr.cpp.

References checkUInt32Argument(), clang::Sema::Diag(), clang::Expr::getExprLoc(), and toString().

Referenced by handleAllocSizeAttr().

◆ checkRecordDeclForAttr()

template<typename AttrType >
static bool checkRecordDeclForAttr ( const RecordDecl RD)
static

Definition at line 518 of file SemaDeclAttr.cpp.

References clang::Decl::hasAttr().

◆ checkRecordTypeForCapability()

static bool checkRecordTypeForCapability ( Sema S,
QualType  Ty 
)
static

◆ checkSwiftAsyncErrorBlock()

static void checkSwiftAsyncErrorBlock ( Sema S,
Decl D,
const SwiftAsyncErrorAttr *  ErrorAttr,
const SwiftAsyncAttr *  AsyncAttr 
)
static

◆ checkTryLockFunAttrCommon()

static bool checkTryLockFunAttrCommon ( Sema S,
Decl D,
const ParsedAttr AL,
SmallVectorImpl< Expr * > &  Args 
)
static

◆ checkTypedefTypeForCapability()

static bool checkTypedefTypeForCapability ( QualType  Ty)
static

Definition at line 551 of file SemaDeclAttr.cpp.

References clang::Type::getAs(), and clang::Decl::hasAttr().

Referenced by typeHasCapability().

◆ checkUInt32Argument()

template<typename AttrInfo >
static bool checkUInt32Argument ( Sema S,
const AttrInfo &  AI,
const Expr Expr,
uint32_t &  Val,
unsigned  Idx = UINT_MAX,
bool  StrictlyUnsigned = false 
)
static

◆ checkUnusedDeclAttributes()

static void checkUnusedDeclAttributes ( Sema S,
const ParsedAttributesView A 
)
static

checkUnusedDeclAttributes - Check a list of attributes to see if it contains any decl attributes that we should warn about.

Definition at line 10060 of file SemaDeclAttr.cpp.

References clang::Sema::Diag(), clang::AttributeCommonInfo::IgnoredAttribute, and clang::AttributeCommonInfo::UnknownAttribute.

◆ findEnforceTCBAttrByName()

template<typename AttrTy >
static const AttrTy * findEnforceTCBAttrByName ( Decl D,
StringRef  Name 
)
static

Definition at line 8948 of file SemaDeclAttr.cpp.

References clang::Decl::specific_attrs().

◆ FindFieldInTopLevelOrAnonymousStruct()

static const FieldDecl * FindFieldInTopLevelOrAnonymousStruct ( const RecordDecl RD,
const IdentifierInfo FieldName 
)
static

◆ getAttrLoc() [1/2]

template<typename AttrInfo >
static std::enable_if_t< std::is_base_of_v< Attr, AttrInfo >, SourceLocation > getAttrLoc ( const AttrInfo &  AL)
static

A helper function to provide Attribute Location for the Attr types AND the ParsedAttr.

Definition at line 207 of file SemaDeclAttr.cpp.

Referenced by checkFunctionOrMethodParameterIndex(), checkUInt32Argument(), and handlePatchableFunctionEntryAttr().

◆ getAttrLoc() [2/2]

static SourceLocation getAttrLoc ( const ParsedAttr AL)
static

Definition at line 210 of file SemaDeclAttr.cpp.

References clang::AttributeCommonInfo::getLoc().

◆ getCudaArch()

static CudaArch getCudaArch ( const TargetInfo TI)
static

◆ getFormatAttrKind()

static FormatAttrKind getFormatAttrKind ( StringRef  Format)
static

getFormatAttrKind - Map from format attribute names to supported format types.

Definition at line 3890 of file SemaDeclAttr.cpp.

References CFStringFormat, IgnoredFormat, InvalidFormat, NSStringFormat, StrftimeFormat, and SupportedFormat.

Referenced by handleFormatAttr().

◆ getFunctionOrMethodNumParams()

static unsigned getFunctionOrMethodNumParams ( const Decl D)
static

getFunctionOrMethodNumParams - Return number of function or method parameters.

It is an error to call this on a K&R function (use hasFunctionProto first).

Definition at line 100 of file SemaDeclAttr.cpp.

References clang::Decl::getFunctionType().

Referenced by checkFunctionOrMethodParameterIndex(), handleAnyX86InterruptAttr(), handleArgumentWithTypeTagAttr(), handleCallbackAttr(), handleFormatAttr(), handleMipsInterruptAttr(), handleMSP430InterruptAttr(), handleNonNullAttr(), handleObjCExternallyRetainedAttr(), handleRISCVInterruptAttr(), handleSwiftError(), and handleSYCLKernelAttr().

◆ getFunctionOrMethodParam()

static const ParmVarDecl * getFunctionOrMethodParam ( const Decl D,
unsigned  Idx 
)
static

◆ getFunctionOrMethodParamRange()

static SourceRange getFunctionOrMethodParamRange ( const Decl D,
unsigned  Idx 
)
static

◆ getFunctionOrMethodParamType()

static QualType getFunctionOrMethodParamType ( const Decl D,
unsigned  Idx 
)
static

◆ getFunctionOrMethodResultSourceRange()

static SourceRange getFunctionOrMethodResultSourceRange ( const Decl D)
static

◆ getFunctionOrMethodResultType()

static QualType getFunctionOrMethodResultType ( const Decl D)
static

◆ getNumAttributeArgs()

static unsigned getNumAttributeArgs ( const ParsedAttr AL)
static

◆ getRecordType()

static const RecordType * getRecordType ( QualType  QT)
static

Checks that the passed in QualType either is of RecordType or points to RecordType.

Returns the relevant RecordType, null if it does not exit.

Definition at line 506 of file SemaDeclAttr.cpp.

References clang::Type::getAs(), and clang::Type::getPointeeType().

Referenced by checkAttrArgsAreCapabilityObjs(), checkRecordTypeForCapability(), and clang::CodeGen::CodeGenModule::EmitTopLevelDecl().

◆ handleAbiTagAttr()

static void handleAbiTagAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAcquireCapabilityAttr()

static void handleAcquireCapabilityAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAcquiredAfterAttr()

static void handleAcquiredAfterAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAcquiredBeforeAttr()

static void handleAcquiredBeforeAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAcquireHandleAttr()

static void handleAcquireHandleAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAliasAttr()

static void handleAliasAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAlignedAttr()

static void handleAlignedAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAlignValueAttr()

static void handleAlignValueAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAllocAlignAttr()

static void handleAllocAlignAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAllocSizeAttr()

static void handleAllocSizeAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAlwaysInlineAttr()

static void handleAlwaysInlineAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAMDGPUFlatWorkGroupSizeAttr()

static void handleAMDGPUFlatWorkGroupSizeAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAMDGPUMaxNumWorkGroupsAttr()

static void handleAMDGPUMaxNumWorkGroupsAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAMDGPUNumSGPRAttr()

static void handleAMDGPUNumSGPRAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAMDGPUNumVGPRAttr()

static void handleAMDGPUNumVGPRAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAMDGPUWavesPerEUAttr()

static void handleAMDGPUWavesPerEUAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAnalyzerNoReturnAttr()

static void handleAnalyzerNoReturnAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAnnotateAttr()

static void handleAnnotateAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAnyX86InterruptAttr()

static void handleAnyX86InterruptAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleArgumentWithTypeTagAttr()

static void handleArgumentWithTypeTagAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleArmBuiltinAliasAttr()

static void handleArmBuiltinAliasAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleARMInterruptAttr()

static void handleARMInterruptAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleArmNewAttr()

static void handleArmNewAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAssertCapabilityAttr()

static void handleAssertCapabilityAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAssertExclusiveLockAttr()

static void handleAssertExclusiveLockAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAssertSharedLockAttr()

static void handleAssertSharedLockAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAssumeAlignedAttr()

static void handleAssumeAlignedAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAttrWithMessage()

template<typename AttrTy >
static void handleAttrWithMessage ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAvailabilityAttr()

static void handleAvailabilityAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAvailableOnlyInDefaultEvalMethod()

static void handleAvailableOnlyInDefaultEvalMethod ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

Definition at line 8708 of file SemaDeclAttr.cpp.

Referenced by ProcessDeclAttribute().

◆ handleAVRInterruptAttr()

static void handleAVRInterruptAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleAVRSignalAttr()

static void handleAVRSignalAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleBlocksAttr()

static void handleBlocksAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleBPFPreserveAccessIndexAttr()

static void handleBPFPreserveAccessIndexAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

Definition at line 7756 of file SemaDeclAttr.cpp.

References clang::Sema::Context, and handleBPFPreserveAIRecord().

Referenced by ProcessDeclAttribute().

◆ handleBPFPreserveAIRecord()

static void handleBPFPreserveAIRecord ( Sema S,
RecordDecl RD 
)
static

◆ handleBTFDeclTagAttr()

static void handleBTFDeclTagAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleBuiltinAliasAttr()

static void handleBuiltinAliasAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleCallableWhenAttr()

static void handleCallableWhenAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleCallbackAttr()

static void handleCallbackAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleCallConvAttr()

static void handleCallConvAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleCalledOnceAttr()

static void handleCalledOnceAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

Handle 'called_once' attribute.

Definition at line 4263 of file SemaDeclAttr.cpp.

References clang::Decl::addAttr(), clang::Sema::Context, clang::Sema::Diag(), clang::AttributeCommonInfo::getLoc(), and isFunctionLike().

Referenced by ProcessDeclAttribute().

◆ handleCapabilityAttr()

static void handleCapabilityAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleCFGuardAttr()

static void handleCFGuardAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleCleanupAttr()

static void handleCleanupAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleCmseNSEntryAttr()

static void handleCmseNSEntryAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleCodeModelAttr()

static void handleCodeModelAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleCodeSegAttr()

static void handleCodeSegAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleCommonAttr()

static void handleCommonAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleConstantAttr()

static void handleConstantAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleConstructorAttr()

static void handleConstructorAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleConsumableAttr()

static void handleConsumableAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleCountedByAttr()

static void handleCountedByAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleCPUSpecificAttr()

static void handleCPUSpecificAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleDeclspecThreadAttr()

static void handleDeclspecThreadAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleDelayedForbiddenType()

static void handleDelayedForbiddenType ( Sema S,
DelayedDiagnostic DD,
Decl D 
)
static

◆ handleDependencyAttr()

static void handleDependencyAttr ( Sema S,
Scope Scope,
Decl D,
const ParsedAttr AL 
)
static

◆ handleDeprecatedAttr()

static void handleDeprecatedAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleDestroyAttr()

static void handleDestroyAttr ( Sema S,
Decl D,
const ParsedAttr A 
)
static

◆ handleDestructorAttr()

static void handleDestructorAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleDeviceAttr()

static void handleDeviceAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleDiagnoseAsBuiltinAttr()

static void handleDiagnoseAsBuiltinAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleDiagnoseIfAttr()

static void handleDiagnoseIfAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleDLLAttr()

static void handleDLLAttr ( Sema S,
Decl D,
const ParsedAttr A 
)
static

◆ handleEnableIfAttr()

static void handleEnableIfAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleEnforceTCBAttr()

template<typename AttrTy , typename ConflictingAttrTy >
static void handleEnforceTCBAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleEnumExtensibilityAttr()

static void handleEnumExtensibilityAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleErrorAttr()

static void handleErrorAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleExclusiveTrylockFunctionAttr()

static void handleExclusiveTrylockFunctionAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleExternalSourceSymbolAttr()

static void handleExternalSourceSymbolAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleExtVectorTypeAttr()

static void handleExtVectorTypeAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleFormatArgAttr()

static void handleFormatArgAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleFormatAttr()

static void handleFormatAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleFunctionReturnThunksAttr()

static void handleFunctionReturnThunksAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleGlobalAttr()

static void handleGlobalAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleGNUInlineAttr()

static void handleGNUInlineAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleGuardedByAttr()

static void handleGuardedByAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleHandleAttr()

template<typename Attr >
static void handleHandleAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleHLSLNumThreadsAttr()

static void handleHLSLNumThreadsAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleHLSLParamModifierAttr()

static void handleHLSLParamModifierAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleHLSLResourceBindingAttr()

static void handleHLSLResourceBindingAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleHLSLShaderAttr()

static void handleHLSLShaderAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleHLSLSV_DispatchThreadIDAttr()

static void handleHLSLSV_DispatchThreadIDAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleIBOutlet()

static void handleIBOutlet ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleIBOutletCollection()

static void handleIBOutletCollection ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleIFuncAttr()

static void handleIFuncAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleInitPriorityAttr()

static void handleInitPriorityAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleInternalLinkageAttr()

static void handleInternalLinkageAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleInterruptAttr()

static void handleInterruptAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleLaunchBoundsAttr()

static void handleLaunchBoundsAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleLayoutVersion()

static void handleLayoutVersion ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleLifetimeCategoryAttr()

static void handleLifetimeCategoryAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleLockReturnedAttr()

static void handleLockReturnedAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleLocksExcludedAttr()

static void handleLocksExcludedAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleM68kInterruptAttr()

static void handleM68kInterruptAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleManagedAttr()

static void handleManagedAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleMIGServerRoutineAttr()

static void handleMIGServerRoutineAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleMinSizeAttr()

static void handleMinSizeAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

Definition at line 5064 of file SemaDeclAttr.cpp.

References clang::Decl::addAttr(), and clang::Sema::mergeMinSizeAttr().

Referenced by ProcessDeclAttribute().

◆ handleMinVectorWidthAttr()

static void handleMinVectorWidthAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleMipsInterruptAttr()

static void handleMipsInterruptAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleModeAttr()

static void handleModeAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

handleModeAttr - This attribute modifies the width of a decl with primitive type.

Despite what would be logical, the mode attribute is a decl attribute, not a type attribute: 'int ** __attribute((mode(HI))) *G;' tries to make 'G' be HImode, not an intermediate pointer.

Definition at line 4789 of file SemaDeclAttr.cpp.

References clang::AANT_ArgumentIdentifier, clang::Sema::AddModeAttr(), clang::Sema::Diag(), clang::ParsedAttr::getArgAsIdent(), clang::AttributeCommonInfo::getLoc(), clang::IdentifierLoc::Ident, and clang::ParsedAttr::isArgIdent().

Referenced by ProcessDeclAttribute().

◆ handleMSAllocatorAttr()

static void handleMSAllocatorAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleMSConstexprAttr()

static void handleMSConstexprAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleMSInheritanceAttr()

static void handleMSInheritanceAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleMSP430InterruptAttr()

static void handleMSP430InterruptAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleNakedAttr()

static void handleNakedAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleNoBuiltinAttr()

static void handleNoBuiltinAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleNoCfCheckAttr()

static void handleNoCfCheckAttr ( Sema S,
Decl D,
const ParsedAttr Attrs 
)
static

◆ handleNoDebugAttr()

static void handleNoDebugAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

Definition at line 4948 of file SemaDeclAttr.cpp.

References clang::Decl::addAttr(), and clang::Sema::Context.

Referenced by ProcessDeclAttribute().

◆ handleNoEscapeAttr()

static void handleNoEscapeAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleNoMergeAttr()

static void handleNoMergeAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleNonNullAttr()

static void handleNonNullAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleNonNullAttrParameter()

static void handleNonNullAttrParameter ( Sema S,
ParmVarDecl D,
const ParsedAttr AL 
)
static

◆ handleNoRandomizeLayoutAttr()

static void handleNoRandomizeLayoutAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleNoReturnAttr()

static void handleNoReturnAttr ( Sema S,
Decl D,
const ParsedAttr Attrs 
)
static

◆ handleNoSanitizeAttr()

static void handleNoSanitizeAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleNoSanitizeSpecificAttr()

static void handleNoSanitizeSpecificAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleNoUniqueAddressAttr()

static void handleNoUniqueAddressAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

Definition at line 8724 of file SemaDeclAttr.cpp.

References clang::Decl::addAttr(), and clang::Sema::Context.

Referenced by ProcessDeclAttribute().

◆ handleNSErrorDomain()

static void handleNSErrorDomain ( Sema S,
Decl D,
const ParsedAttr Attr 
)
static

◆ handleObjCBoxable()

static void handleObjCBoxable ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

Definition at line 6397 of file SemaDeclAttr.cpp.

References clang::Sema::Context, and clang::Sema::getASTMutationListener().

Referenced by ProcessDeclAttribute().

◆ handleObjCBridgeAttr()

static void handleObjCBridgeAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleObjCBridgeMutableAttr()

static void handleObjCBridgeMutableAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleObjCBridgeRelatedAttr()

static void handleObjCBridgeRelatedAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleObjCDesignatedInitializer()

static void handleObjCDesignatedInitializer ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleObjCDirectAttr()

static void handleObjCDirectAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleObjCDirectMembersAttr()

static void handleObjCDirectMembersAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleObjCExternallyRetainedAttr()

static void handleObjCExternallyRetainedAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleObjCIndependentClass()

static void handleObjCIndependentClass ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleObjCMethodFamilyAttr()

static void handleObjCMethodFamilyAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleObjCNSObject()

static void handleObjCNSObject ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleObjCOwnershipAttr()

static void handleObjCOwnershipAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleObjCPreciseLifetimeAttr()

static void handleObjCPreciseLifetimeAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleObjCRequiresSuperAttr()

static void handleObjCRequiresSuperAttr ( Sema S,
Decl D,
const ParsedAttr Attrs 
)
static

◆ handleObjCReturnsInnerPointerAttr()

static void handleObjCReturnsInnerPointerAttr ( Sema S,
Decl D,
const ParsedAttr Attrs 
)
static

◆ handleObjCRuntimeName()

static void handleObjCRuntimeName ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleObjCSuppresProtocolAttr()

static void handleObjCSuppresProtocolAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleOMPAssumeAttr()

static void handleOMPAssumeAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleOpenCLAccessAttr()

static void handleOpenCLAccessAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleOpenCLNoSVMAttr()

static void handleOpenCLNoSVMAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleOptimizeNoneAttr()

static void handleOptimizeNoneAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleOwnershipAttr()

static void handleOwnershipAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handlePackedAttr()

static void handlePackedAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleParamTypestateAttr()

static void handleParamTypestateAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handlePassObjectSizeAttr()

static void handlePassObjectSizeAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handlePatchableFunctionEntryAttr()

static void handlePatchableFunctionEntryAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handlePreferredName()

static void handlePreferredName ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handlePreferredTypeAttr()

static void handlePreferredTypeAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handlePtGuardedByAttr()

static void handlePtGuardedByAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handlePtGuardedVarAttr()

static void handlePtGuardedVarAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleRandomizeLayoutAttr()

static void handleRandomizeLayoutAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleReleaseCapabilityAttr()

static void handleReleaseCapabilityAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleRequiresCapabilityAttr()

static void handleRequiresCapabilityAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleRestrictAttr()

static void handleRestrictAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleReturnsNonNullAttr()

static void handleReturnsNonNullAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleReturnTypestateAttr()

static void handleReturnTypestateAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleRISCVInterruptAttr()

static void handleRISCVInterruptAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleSectionAttr()

static void handleSectionAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleSentinelAttr()

static void handleSentinelAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleSetTypestateAttr()

static void handleSetTypestateAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleSharedAttr()

static void handleSharedAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleSharedTrylockFunctionAttr()

static void handleSharedTrylockFunctionAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleSimpleAttribute()

template<typename AttrType >
static void handleSimpleAttribute ( Sema S,
Decl D,
const AttributeCommonInfo CI 
)
static

Applies the given attribute to the Decl without performing any additional semantic checking.

Definition at line 401 of file SemaDeclAttr.cpp.

References clang::Decl::addAttr(), and clang::Sema::Context.

◆ handleSimpleAttributeOrDiagnose()

template<typename AttrType , typename... DiagnosticArgs>
static void handleSimpleAttributeOrDiagnose ( Sema S,
Decl D,
const AttributeCommonInfo CI,
bool  PassesCheck,
unsigned  DiagID,
DiagnosticArgs &&...  ExtraArgs 
)
static

Add an attribute AttrType to declaration D, provided that PassesCheck is true.

Otherwise, emit diagnostic DiagID, passing in all parameters specified in ExtraArgs.

Definition at line 425 of file SemaDeclAttr.cpp.

References appendDiagnostics(), clang::Sema::Diag(), and clang::Decl::getBeginLoc().

◆ handleStandardNoReturnAttr()

static void handleStandardNoReturnAttr ( Sema S,
Decl D,
const ParsedAttr A 
)
static

◆ handleSubGroupSize()

static void handleSubGroupSize ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleSuppressAttr()

static void handleSuppressAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleSwiftAsyncAttr()

static void handleSwiftAsyncAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleSwiftAsyncError()

static void handleSwiftAsyncError ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleSwiftAsyncName()

static void handleSwiftAsyncName ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleSwiftAttrAttr()

static void handleSwiftAttrAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleSwiftBridge()

static void handleSwiftBridge ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleSwiftError()

static void handleSwiftError ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleSwiftName()

static void handleSwiftName ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleSwiftNewType()

static void handleSwiftNewType ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleSYCLKernelAttr()

static void handleSYCLKernelAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleTargetAttr()

static void handleTargetAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleTargetClonesAttr()

static void handleTargetClonesAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleTargetVersionAttr()

static void handleTargetVersionAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleTestTypestateAttr()

static void handleTestTypestateAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleTLSModelAttr()

static void handleTLSModelAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleTransparentUnionAttr()

static void handleTransparentUnionAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleTryAcquireCapabilityAttr()

static void handleTryAcquireCapabilityAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleTypeTagForDatatypeAttr()

static void handleTypeTagForDatatypeAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleUninitializedAttr()

static void handleUninitializedAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleUnsafeBufferUsage()

template<typename Attr >
static void handleUnsafeBufferUsage ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

Definition at line 8923 of file SemaDeclAttr.cpp.

References clang::Decl::addAttr(), and clang::Sema::Context.

◆ handleUnusedAttr()

static void handleUnusedAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleUuidAttr()

static void handleUuidAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleVecReturnAttr()

static void handleVecReturnAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleVecTypeHint()

static void handleVecTypeHint ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleVisibilityAttr()

static void handleVisibilityAttr ( Sema S,
Decl D,
const ParsedAttr AL,
bool  isTypeVisibility 
)
static

◆ handleWarnUnusedResult()

static void handleWarnUnusedResult ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleWeakImportAttr()

static void handleWeakImportAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleWeakRefAttr()

static void handleWeakRefAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleWebAssemblyExportNameAttr()

static void handleWebAssemblyExportNameAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleWebAssemblyImportModuleAttr()

static void handleWebAssemblyImportModuleAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleWebAssemblyImportNameAttr()

static void handleWebAssemblyImportNameAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleWorkGroupSize()

template<typename WorkGroupAttr >
static void handleWorkGroupSize ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleX86ForceAlignArgPointerAttr()

static void handleX86ForceAlignArgPointerAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleXRayLogArgsAttr()

static void handleXRayLogArgsAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleXReturnsXRetainedAttr()

static void handleXReturnsXRetainedAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ handleZeroCallUsedRegsAttr()

static void handleZeroCallUsedRegsAttr ( Sema S,
Decl D,
const ParsedAttr AL 
)
static

◆ hasArmStreamingInterface()

static bool hasArmStreamingInterface ( const FunctionDecl FD)
static

◆ hasBTFDeclTagAttr()

static bool hasBTFDeclTagAttr ( Decl D,
StringRef  Tag 
)
static

◆ hasDeclarator()

static bool hasDeclarator ( const Decl D)
static

Return true if the given decl has a declarator that should have been processed by Sema::GetTypeForDeclarator.

Definition at line 82 of file SemaDeclAttr.cpp.

Referenced by handleCallConvAttr(), handleNoReturnAttr(), handleObjCOwnershipAttr(), and handleXReturnsXRetainedAttr().

◆ hasFunctionProto()

static bool hasFunctionProto ( const Decl D)
static

hasFunctionProto - Return true if the given decl has a argument information.

This decl should have already passed isFunctionOrMethod or isFunctionOrMethodOrBlock.

Definition at line 91 of file SemaDeclAttr.cpp.

References clang::Decl::getFunctionType().

Referenced by checkFunctionOrMethodParameterIndex(), handleAllocSizeAttr(), handleAnyX86InterruptAttr(), handleMipsInterruptAttr(), handleMSP430InterruptAttr(), handleObjCExternallyRetainedAttr(), and handleRISCVInterruptAttr().

◆ isCapabilityExpr()

static bool isCapabilityExpr ( Sema S,
const Expr Ex 
)
static

◆ isCFStringType()

static bool isCFStringType ( QualType  T,
ASTContext Ctx 
)
inlinestatic

◆ isErrorParameter()

static bool isErrorParameter ( Sema S,
QualType  QT 
)
static

◆ isForbiddenTypeAllowed()

static bool isForbiddenTypeAllowed ( Sema S,
Decl D,
const DelayedDiagnostic diag,
UnavailableAttr::ImplicitReason &  reason 
)
static

Is the given declaration allowed to use a forbidden type? If so, it'll still be annotated with an attribute that makes it illegal to actually use.

Definition at line 10240 of file SemaDeclAttr.cpp.

References clang::Sema::Context, clang::sema::DelayedDiagnostic::getForbiddenTypeDiagnostic(), clang::Decl::getLocation(), clang::ASTContext::getSourceManager(), and clang::SourceManager::isInSystemHeader().

Referenced by handleDelayedForbiddenType().

◆ isFunctionLike()

static bool isFunctionLike ( const Type T)
static

◆ isFunctionOrMethod()

static bool isFunctionOrMethod ( const Decl D)
static

◆ isFunctionOrMethodOrBlock()

static bool isFunctionOrMethodOrBlock ( const Decl D)
static

Return true if the given decl has function type (function or function-typed variable) or an Objective-C method or a block.

Definition at line 76 of file SemaDeclAttr.cpp.

References isFunctionOrMethod().

Referenced by checkFunctionOrMethodParameterIndex(), and handleAnalyzerNoReturnAttr().

◆ isFunctionOrMethodVariadic()

static bool isFunctionOrMethodVariadic ( const Decl D)
static

◆ isGlobalVar()

static bool isGlobalVar ( const Decl D)
static

Definition at line 8411 of file SemaDeclAttr.cpp.

Referenced by handleNoSanitizeAttr(), and handleNoSanitizeSpecificAttr().

◆ isInstanceMethod()

static bool isInstanceMethod ( const Decl D)
static

◆ isIntOrBool()

static bool isIntOrBool ( Expr Exp)
static

Check if the passed-in expression is of type int or bool.

Definition at line 438 of file SemaDeclAttr.cpp.

References clang::Expr::getType(), clang::Type::isBooleanType(), and clang::Type::isIntegerType().

Referenced by checkTryLockFunAttrCommon().

◆ isLegalTypeForHLSLSV_DispatchThreadID()

static bool isLegalTypeForHLSLSV_DispatchThreadID ( QualType  T)
static

◆ isNSStringType()

static bool isNSStringType ( QualType  T,
ASTContext Ctx,
bool  AllowNSAttributedString = false 
)
inlinestatic

◆ isSanitizerAttributeAllowedOnGlobals()

static bool isSanitizerAttributeAllowedOnGlobals ( StringRef  Sanitizer)
static

Definition at line 8417 of file SemaDeclAttr.cpp.

Referenced by handleNoSanitizeAttr().

◆ isValidOSObjectOutParameter()

static bool isValidOSObjectOutParameter ( const Decl D)
static
Returns
whether the parameter is a pointer to OSObject pointer.

Definition at line 6086 of file SemaDeclAttr.cpp.

References clang::Type::getPointeeType(), clang::QualType::isNull(), and isValidSubjectOfOSAttribute().

Referenced by ProcessDeclAttribute().

◆ isValidSubjectOfCFAttribute()

static bool isValidSubjectOfCFAttribute ( QualType  QT)
static

◆ isValidSubjectOfNSAttribute()

static bool isValidSubjectOfNSAttribute ( QualType  QT)
static

◆ isValidSubjectOfNSReturnsRetainedAttribute()

static bool isValidSubjectOfNSReturnsRetainedAttribute ( QualType  QT)
static

◆ isValidSubjectOfOSAttribute()

static bool isValidSubjectOfOSAttribute ( QualType  QT)
static

◆ isValidSwiftContextType()

static bool isValidSwiftContextType ( QualType  Ty)
static

◆ isValidSwiftErrorResultType()

static bool isValidSwiftErrorResultType ( QualType  Ty)
static

◆ isValidSwiftIndirectResultType()

static bool isValidSwiftIndirectResultType ( QualType  Ty)
static

Pointers and references in the default address space.

Definition at line 5562 of file SemaDeclAttr.cpp.

References clang::Default, clang::QualType::getAddressSpace(), clang::Type::getAs(), clang::Type::getPointeeType(), and clang::Type::isDependentType().

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

◆ makeLaunchBoundsArgExpr()

static Expr * makeLaunchBoundsArgExpr ( Sema S,
Expr E,
const CUDALaunchBoundsAttr &  AL,
const unsigned  Idx 
)
static

◆ mergeEnforceTCBAttrImpl()

template<typename AttrTy , typename ConflictingAttrTy >
static AttrTy * mergeEnforceTCBAttrImpl ( Sema S,
Decl D,
const AttrTy &  AL 
)
static

◆ mergeVisibilityAttr()

template<class T >
static T * mergeVisibilityAttr ( Sema S,
Decl D,
const AttributeCommonInfo CI,
typename T::VisibilityType  value 
)
static

◆ MustDelayAttributeArguments()

static bool MustDelayAttributeArguments ( const ParsedAttr AL)
static

◆ normalizeName()

static bool normalizeName ( StringRef &  AttrName)
static

Normalize the attribute, foo becomes foo.

Returns true if normalization was applied.

Definition at line 1812 of file SemaDeclAttr.cpp.

◆ parsedAttrToRetainOwnershipKind()

static Sema::RetainOwnershipKind parsedAttrToRetainOwnershipKind ( const ParsedAttr AL)
static

◆ parseModeAttrArg()

static void parseModeAttrArg ( Sema S,
StringRef  Str,
unsigned DestWidth,
bool IntegerMode,
bool ComplexMode,
FloatModeKind ExplicitType 
)
static

◆ ProcessDeclAttribute()

static void ProcessDeclAttribute ( Sema S,
Scope scope,
Decl D,
const ParsedAttr AL,
const Sema::ProcessDeclAttributeOptions Options 
)
static

ProcessDeclAttribute - Apply the specific attribute to the specified decl if the attribute applies to decls.

If the attribute is a type attribute, just silently ignore it if a GNU attribute.

Definition at line 9130 of file SemaDeclAttr.cpp.

References clang::Sema::AddParameterABIAttr(), clang::Sema::AddXConsumedAttr(), clang::Sema::checkCommonAttributeFeatures(), clang::Sema::Context, clang::Sema::Diag(), clang::ParsedAttr::existsInTarget(), clang::ParsedAttr::getInfo(), clang::ParsedAttr::getKind(), clang::AttributeCommonInfo::getLoc(), clang::Decl::getLocation(), clang::AttributeCommonInfo::getRange(), clang::ASTContext::getTargetInfo(), handleAbiTagAttr(), handleAcquireCapabilityAttr(), handleAcquiredAfterAttr(), handleAcquiredBeforeAttr(), handleAcquireHandleAttr(), handleAliasAttr(), handleAlignedAttr(), handleAlignValueAttr(), handleAllocAlignAttr(), handleAllocSizeAttr(), handleAlwaysInlineAttr(), handleAMDGPUFlatWorkGroupSizeAttr(), handleAMDGPUMaxNumWorkGroupsAttr(), handleAMDGPUNumSGPRAttr(), handleAMDGPUNumVGPRAttr(), handleAMDGPUWavesPerEUAttr(), handleAnalyzerNoReturnAttr(), handleAnnotateAttr(), handleArgumentWithTypeTagAttr(), handleArmBuiltinAliasAttr(), handleArmNewAttr(), handleAssertCapabilityAttr(), handleAssertExclusiveLockAttr(), handleAssertSharedLockAttr(), handleAssumeAlignedAttr(), clang::ParsedAttr::handleAttrWithDelayedArgs(), handleAvailabilityAttr(), handleAvailableOnlyInDefaultEvalMethod(), handleAVRSignalAttr(), handleBlocksAttr(), handleBPFPreserveAccessIndexAttr(), handleBTFDeclTagAttr(), handleBuiltinAliasAttr(), handleCallableWhenAttr(), handleCallbackAttr(), handleCallConvAttr(), handleCalledOnceAttr(), handleCapabilityAttr(), handleCFGuardAttr(), handleCleanupAttr(), handleCmseNSEntryAttr(), handleCodeModelAttr(), handleCodeSegAttr(), handleCommonAttr(), handleConstantAttr(), handleConstructorAttr(), handleConsumableAttr(), handleCountedByAttr(), handleCPUSpecificAttr(), clang::ParsedAttrInfo::handleDeclAttribute(), handleDeclspecThreadAttr(), handleDependencyAttr(), handleDeprecatedAttr(), handleDestroyAttr(), handleDestructorAttr(), handleDeviceAttr(), handleDiagnoseAsBuiltinAttr(), handleDiagnoseIfAttr(), handleDLLAttr(), handleEnableIfAttr(), handleEnumExtensibilityAttr(), handleErrorAttr(), handleExclusiveTrylockFunctionAttr(), handleExternalSourceSymbolAttr(), handleExtVectorTypeAttr(), handleFormatArgAttr(), handleFormatAttr(), handleFunctionReturnThunksAttr(), handleGlobalAttr(), handleGNUInlineAttr(), handleGuardedByAttr(), handleHLSLNumThreadsAttr(), handleHLSLParamModifierAttr(), handleHLSLResourceBindingAttr(), handleHLSLShaderAttr(), handleHLSLSV_DispatchThreadIDAttr(), handleIBOutlet(), handleIBOutletCollection(), handleIFuncAttr(), handleInitPriorityAttr(), handleInternalLinkageAttr(), handleInterruptAttr(), handleLaunchBoundsAttr(), handleLayoutVersion(), handleLifetimeCategoryAttr(), handleLockReturnedAttr(), handleLocksExcludedAttr(), handleManagedAttr(), handleMIGServerRoutineAttr(), handleMinSizeAttr(), handleMinVectorWidthAttr(), handleModeAttr(), handleMSAllocatorAttr(), handleMSConstexprAttr(), handleMSInheritanceAttr(), handleNakedAttr(), handleNoBuiltinAttr(), handleNoCfCheckAttr(), handleNoDebugAttr(), handleNoEscapeAttr(), handleNoMergeAttr(), handleNonNullAttr(), handleNonNullAttrParameter(), handleNoRandomizeLayoutAttr(), handleNoReturnAttr(), handleNoSanitizeAttr(), handleNoSanitizeSpecificAttr(), handleNoUniqueAddressAttr(), handleNSErrorDomain(), handleObjCBoxable(), handleObjCBridgeAttr(), handleObjCBridgeMutableAttr(), handleObjCBridgeRelatedAttr(), handleObjCDesignatedInitializer(), handleObjCDirectAttr(), handleObjCDirectMembersAttr(), handleObjCExternallyRetainedAttr(), handleObjCIndependentClass(), handleObjCMethodFamilyAttr(), handleObjCNSObject(), handleObjCOwnershipAttr(), handleObjCPreciseLifetimeAttr(), handleObjCRequiresSuperAttr(), handleObjCReturnsInnerPointerAttr(), handleObjCRuntimeName(), handleObjCSuppresProtocolAttr(), handleOMPAssumeAttr(), handleOpenCLAccessAttr(), handleOpenCLNoSVMAttr(), handleOptimizeNoneAttr(), handleOwnershipAttr(), handlePackedAttr(), handleParamTypestateAttr(), handlePassObjectSizeAttr(), handlePatchableFunctionEntryAttr(), handlePreferredName(), handlePreferredTypeAttr(), handlePtGuardedByAttr(), handlePtGuardedVarAttr(), handleRandomizeLayoutAttr(), handleReleaseCapabilityAttr(), handleRequiresCapabilityAttr(), handleRestrictAttr(), handleReturnsNonNullAttr(), handleReturnTypestateAttr(), handleSectionAttr(), handleSentinelAttr(), handleSetTypestateAttr(), handleSharedAttr(), handleSharedTrylockFunctionAttr(), handleStandardNoReturnAttr(), handleSubGroupSize(), handleSuppressAttr(), handleSwiftAsyncAttr(), handleSwiftAsyncError(), handleSwiftAsyncName(), handleSwiftAttrAttr(), handleSwiftBridge(), handleSwiftError(), handleSwiftName(), handleSwiftNewType(), handleSYCLKernelAttr(), handleTargetAttr(), handleTargetClonesAttr(), handleTargetVersionAttr(), handleTestTypestateAttr(), handleTLSModelAttr(), handleTransparentUnionAttr(), handleTryAcquireCapabilityAttr(), handleTypeTagForDatatypeAttr(), handleUninitializedAttr(), handleUnusedAttr(), handleUuidAttr(), handleVecReturnAttr(), handleVecTypeHint(), handleVisibilityAttr(), handleWarnUnusedResult(), handleWeakImportAttr(), handleWeakRefAttr(), handleWebAssemblyExportNameAttr(), handleWebAssemblyImportModuleAttr(), handleWebAssemblyImportNameAttr(), handleX86ForceAlignArgPointerAttr(), handleXRayLogArgsAttr(), handleXReturnsXRetainedAttr(), handleZeroCallUsedRegsAttr(), clang::AttributeCommonInfo::IgnoredAttribute, clang::AttributeCommonInfo::isClangScope(), clang::AttributeCommonInfo::isCXX11Attribute(), clang::AttributeCommonInfo::isDeclspecAttribute(), clang::ParsedAttr::isInvalid(), clang::AttributeCommonInfo::isRegularKeywordAttribute(), clang::AttributeCommonInfo::isStandardAttributeSyntax(), clang::ParsedAttr::isStmtAttr(), clang::ParsedAttr::isTypeAttr(), clang::ParsedAttr::isUsedAsTypeAttr(), isValidOSObjectOutParameter(), MustDelayAttributeArguments(), clang::ParsedAttrInfo::NotHandled, parsedAttrToRetainOwnershipKind(), clang::ParsedAttr::slidesFromDeclToDeclSpecLegacyBehavior(), clang::SwiftAsyncContext, clang::SwiftContext, clang::SwiftErrorResult, clang::SwiftIndirectResult, and clang::AttributeCommonInfo::UnknownAttribute.

Referenced by clang::Sema::ProcessAccessDeclAttributeList(), and clang::Sema::ProcessDeclAttributeList().

◆ RISCVAliasValid()

static bool RISCVAliasValid ( unsigned  BuiltinID,
StringRef  AliasName 
)
static

◆ threadSafetyCheckIsPointer()

static bool threadSafetyCheckIsPointer ( Sema S,
const Decl D,
const ParsedAttr AL 
)
static

Check if passed in Decl is a pointer type.

Note that this function may produce an error message.

Returns
true if the Decl is a pointer type; false otherwise

Definition at line 482 of file SemaDeclAttr.cpp.

References clang::Sema::Diag(), clang::Type::getAs(), clang::AttributeCommonInfo::getLoc(), clang::Type::isAnyPointerType(), and threadSafetyCheckIsSmartPointer().

Referenced by handlePtGuardedByAttr(), and handlePtGuardedVarAttr().

◆ threadSafetyCheckIsSmartPointer()

static bool threadSafetyCheckIsSmartPointer ( Sema S,
const RecordType RT 
)
static

◆ tryMakeVariablePseudoStrong()

static bool tryMakeVariablePseudoStrong ( Sema S,
VarDecl VD,
bool  DiagnoseFailure 
)
static

◆ typeHasCapability()

static bool typeHasCapability ( Sema S,
QualType  Ty 
)
static

◆ validateAlignasAppliedType()

static bool validateAlignasAppliedType ( Sema S,
Decl D,
const AlignedAttr &  Attr,
SourceLocation  AttrLoc 
)
static

Perform checking of type validity.

C++11 [dcl.align]p1: An alignment-specifier may be applied to a variable or to a class data member, but it shall not be applied to a bit-field, a function parameter, the formal parameter of a catch clause, or a variable declared with the register storage class specifier. An alignment-specifier may also be applied to the declaration of a class or enumeration type. CWG 2354: CWG agreed to remove permission for alignas to be applied to enumerations. C11 6.7.5/2: An alignment attribute shall not be specified in a declaration of a typedef, or a bit-field, or a function, or a parameter, or an object declared with the register storage-class specifier.

Definition at line 4478 of file SemaDeclAttr.cpp.

References clang::Sema::Diag(), clang::ExpectedVariableFieldOrTag, clang::ExpectedVariableOrField, clang::AttributeCommonInfo::isRegularKeywordAttribute(), and clang::SC_Register.

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

◆ validateSwiftFunctionName()

static bool validateSwiftFunctionName ( Sema S,
const ParsedAttr AL,
SourceLocation  Loc,
StringRef  Name,
unsigned SwiftParamCount,
bool IsSingleParamInit 
)
static

◆ versionsMatch()

static bool versionsMatch ( const VersionTuple &  X,
const VersionTuple &  Y,
bool  BeforeIsOkay 
)
static

Check whether the two versions match.

If either version tuple is empty, then they are assumed to match. If BeforeIsOkay is true, then X can be less than or equal to Y.

Definition at line 2436 of file SemaDeclAttr.cpp.

References X.