clang  20.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/IdentifierTable.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/Attr.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/SemaAMDGPU.h"
#include "clang/Sema/SemaARM.h"
#include "clang/Sema/SemaAVR.h"
#include "clang/Sema/SemaBPF.h"
#include "clang/Sema/SemaCUDA.h"
#include "clang/Sema/SemaHLSL.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/SemaM68k.h"
#include "clang/Sema/SemaMIPS.h"
#include "clang/Sema/SemaMSP430.h"
#include "clang/Sema/SemaObjC.h"
#include "clang/Sema/SemaOpenCL.h"
#include "clang/Sema/SemaOpenMP.h"
#include "clang/Sema/SemaRISCV.h"
#include "clang/Sema/SemaSYCL.h"
#include "clang/Sema/SemaSwift.h"
#include "clang/Sema/SemaWasm.h"
#include "clang/Sema/SemaX86.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/STLForwardCompat.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Demangle/Demangle.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 "llvm/TargetParser/Triple.h"
#include <optional>

Go to the source code of this file.

Namespaces

 AttributeLangSupport
 

Enumerations

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

Functions

static unsigned getNumAttributeArgs (const ParsedAttr &AL)
 
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. More...
 
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. More...
 
static bool isIntOrBool (Expr *Exp)
 Check if the passed-in expression is of type int or bool. More...
 
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. More...
 
static const RecordTypegetRecordType (QualType QT)
 Checks that the passed in QualType either is of RecordType or points to RecordType. More...
 
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. More...
 
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. More...
 
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 handleExcludeFromExplicitInstantiationAttr (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 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 bool normalizeName (StringRef &AttrName)
 Normalize the attribute, foo becomes foo. More...
 
static void handleOwnershipAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleWeakRefAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void markUsedForAliasOrIfunc (Sema &S, Decl *D, const ParsedAttr &AL, StringRef Str)
 
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 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 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. More...
 
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 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 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 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. More...
 
static FormatAttrKind getFormatAttrKind (StringRef Format)
 getFormatAttrKind - Map from format attribute names to supported format types. More...
 
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. More...
 
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. More...
 
static void handleCallbackAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 Handle attribute((callback(CalleeIdx, PayloadIdx0, ...))) attributes. More...
 
static bool isFunctionLike (const Type &T)
 
static void handleCalledOnceAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 Handle 'called_once' attribute. More...
 
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. More...
 
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. More...
 
static void handleModeAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 handleModeAttr - This attribute modifies the width of a decl with primitive type. More...
 
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 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 SYCLAliasValid (ASTContext &Context, unsigned BuiltinID)
 
static void handleBuiltinAliasAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleNullableTypeAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handlePreferredTypeAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleUuidAttr (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 bool hasBTFDeclTagAttr (Decl *D, StringRef Tag)
 
static void handleBTFDeclTagAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleInterruptAttr (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 handleZeroCallUsedRegsAttr (Sema &S, Decl *D, const ParsedAttr &AL)
 
static void handleCountedByAttrField (Sema &S, Decl *D, const ParsedAttr &AL)
 
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 handleDestroyAttr (Sema &S, Decl *D, const ParsedAttr &A)
 
static void handleUninitializedAttr (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 void handleVTablePointerAuthentication (Sema &S, Decl *D, const ParsedAttr &AL)
 
static bool IsDeclLambdaCallOperator (Decl *D)
 
static bool MustDelayAttributeArguments (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. More...
 
static bool isKernelDecl (Decl *D)
 
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. More...
 
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. More...
 
static void handleDelayedForbiddenType (Sema &S, DelayedDiagnostic &DD, Decl *D)
 Handle a delayed forbidden-type diagnostic. More...
 

Enumeration Type Documentation

◆ FormatAttrKind

Enumerator
CFStringFormat 
NSStringFormat 
StrftimeFormat 
SupportedFormat 
IgnoredFormat 
InvalidFormat 

Definition at line 3451 of file SemaDeclAttr.cpp.

Function Documentation

◆ attrNonNullArgCheck()

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

Definition at line 1288 of file SemaDeclAttr.cpp.

◆ checkAcquireOrderAttrCommon()

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

Definition at line 511 of file SemaDeclAttr.cpp.

◆ 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 374 of file SemaDeclAttr.cpp.

◆ checkAvailabilityAttr()

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

Definition at line 2084 of file SemaDeclAttr.cpp.

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

◆ checkCodeSegName()

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

Definition at line 2977 of file SemaDeclAttr.cpp.

◆ checkForConsumableClass()

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

Definition at line 1021 of file SemaDeclAttr.cpp.

◆ checkFunctionConditionAttr()

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

Definition at line 709 of file SemaDeclAttr.cpp.

◆ 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

Check if IdxExpr is a valid parameter index for a function or instance method D.

May output an error.

Returns
true if IdxExpr is a valid index.

Definition at line 119 of file SemaDeclAttr.cpp.

◆ checkGuardedByAttrCommon()

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

Definition at line 478 of file SemaDeclAttr.cpp.

◆ checkLockFunAttrCommon()

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

Definition at line 551 of file SemaDeclAttr.cpp.

◆ 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 589 of file SemaDeclAttr.cpp.

◆ 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 96 of file SemaDeclAttr.cpp.

◆ checkRecordDeclForAttr()

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

Definition at line 289 of file SemaDeclAttr.cpp.

References clang::Decl::hasAttr().

◆ checkRecordTypeForCapability()

static bool checkRecordTypeForCapability ( Sema S,
QualType  Ty 
)
static

Definition at line 304 of file SemaDeclAttr.cpp.

◆ checkTryLockFunAttrCommon()

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

Definition at line 645 of file SemaDeclAttr.cpp.

◆ checkTypedefTypeForCapability()

static bool checkTypedefTypeForCapability ( QualType  Ty)
static

Definition at line 322 of file SemaDeclAttr.cpp.

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

◆ 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 7454 of file SemaDeclAttr.cpp.

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

◆ findEnforceTCBAttrByName()

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

Definition at line 6116 of file SemaDeclAttr.cpp.

◆ getFormatAttrKind()

static FormatAttrKind getFormatAttrKind ( StringRef  Format)
static

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

Definition at line 3462 of file SemaDeclAttr.cpp.

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

◆ 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 277 of file SemaDeclAttr.cpp.

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

Referenced by clang::CodeGen::CodeGenFunction::EmitCXXConstructorCall(), clang::CodeGen::CodeGenFunction::EmitDecl(), clang::CodeGen::CodeGenFunction::EmitLambdaBlockInvokeBody(), clang::CodeGen::CodeGenFunction::EmitLValueForField(), and clang::CodeGen::CodeGenModule::EmitTopLevelDecl().

◆ handleAbiTagAttr()

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

Definition at line 5531 of file SemaDeclAttr.cpp.

◆ handleAcquireCapabilityAttr()

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

Definition at line 5757 of file SemaDeclAttr.cpp.

◆ handleAcquiredAfterAttr()

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

Definition at line 531 of file SemaDeclAttr.cpp.

◆ handleAcquiredBeforeAttr()

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

Definition at line 541 of file SemaDeclAttr.cpp.

◆ handleAcquireHandleAttr()

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

Definition at line 6065 of file SemaDeclAttr.cpp.

◆ handleAliasAttr()

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

Definition at line 1722 of file SemaDeclAttr.cpp.

◆ handleAlignedAttr()

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

Definition at line 3987 of file SemaDeclAttr.cpp.

◆ handleAlignValueAttr()

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

Definition at line 3943 of file SemaDeclAttr.cpp.

◆ handleAllocAlignAttr()

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

Definition at line 1398 of file SemaDeclAttr.cpp.

◆ handleAllocSizeAttr()

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

Definition at line 608 of file SemaDeclAttr.cpp.

◆ handleAlwaysInlineAttr()

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

Definition at line 4613 of file SemaDeclAttr.cpp.

◆ handleAnalyzerNoReturnAttr()

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

Definition at line 1951 of file SemaDeclAttr.cpp.

◆ handleAnnotateAttr()

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

Definition at line 3926 of file SemaDeclAttr.cpp.

◆ handleArgumentWithTypeTagAttr()

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

Definition at line 5240 of file SemaDeclAttr.cpp.

◆ handleAssertCapabilityAttr()

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

Definition at line 5748 of file SemaDeclAttr.cpp.

◆ handleAssertExclusiveLockAttr()

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

Definition at line 571 of file SemaDeclAttr.cpp.

◆ handleAssertSharedLockAttr()

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

Definition at line 560 of file SemaDeclAttr.cpp.

◆ handleAssumeAlignedAttr()

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

Definition at line 1392 of file SemaDeclAttr.cpp.

◆ handleAttrWithMessage()

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

Definition at line 2075 of file SemaDeclAttr.cpp.

◆ handleAvailabilityAttr()

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

Definition at line 2311 of file SemaDeclAttr.cpp.

◆ handleAvailableOnlyInDefaultEvalMethod()

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

Definition at line 5990 of file SemaDeclAttr.cpp.

◆ handleBTFDeclTagAttr()

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

Definition at line 5570 of file SemaDeclAttr.cpp.

◆ handleBuiltinAliasAttr()

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

Definition at line 5340 of file SemaDeclAttr.cpp.

◆ handleCallableWhenAttr()

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

Definition at line 1036 of file SemaDeclAttr.cpp.

◆ handleCallbackAttr()

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

Handle attribute((callback(CalleeIdx, PayloadIdx0, ...))) attributes.

Definition at line 3688 of file SemaDeclAttr.cpp.

◆ handleCallConvAttr()

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

Definition at line 4739 of file SemaDeclAttr.cpp.

◆ handleCalledOnceAttr()

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

Handle 'called_once' attribute.

Definition at line 3834 of file SemaDeclAttr.cpp.

◆ handleCapabilityAttr()

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

Definition at line 5730 of file SemaDeclAttr.cpp.

◆ handleCFGuardAttr()

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

Definition at line 6095 of file SemaDeclAttr.cpp.

◆ handleCleanupAttr()

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

Definition at line 3312 of file SemaDeclAttr.cpp.

◆ handleCodeModelAttr()

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

Definition at line 2959 of file SemaDeclAttr.cpp.

◆ handleCodeSegAttr()

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

Definition at line 3007 of file SemaDeclAttr.cpp.

◆ handleCommonAttr()

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

Definition at line 1857 of file SemaDeclAttr.cpp.

◆ handleConstantAttr()

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

Definition at line 4629 of file SemaDeclAttr.cpp.

◆ handleConstructorAttr()

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

Definition at line 2052 of file SemaDeclAttr.cpp.

◆ handleConsumableAttr()

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

Definition at line 1001 of file SemaDeclAttr.cpp.

◆ handleCountedByAttrField()

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

Definition at line 5931 of file SemaDeclAttr.cpp.

◆ handleCPUSpecificAttr()

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

Definition at line 1785 of file SemaDeclAttr.cpp.

◆ handleDeclspecThreadAttr()

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

Definition at line 5492 of file SemaDeclAttr.cpp.

◆ handleDelayedForbiddenType()

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

Handle a delayed forbidden-type diagnostic.

Definition at line 7670 of file SemaDeclAttr.cpp.

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

◆ handleDependencyAttr()

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

Definition at line 2026 of file SemaDeclAttr.cpp.

◆ handleDeprecatedAttr()

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

Definition at line 5804 of file SemaDeclAttr.cpp.

◆ handleDestroyAttr()

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

Definition at line 6010 of file SemaDeclAttr.cpp.

◆ handleDestructorAttr()

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

Definition at line 2065 of file SemaDeclAttr.cpp.

◆ handleDeviceAttr()

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

Definition at line 4697 of file SemaDeclAttr.cpp.

◆ handleDiagnoseAsBuiltinAttr()

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

Definition at line 815 of file SemaDeclAttr.cpp.

◆ handleDiagnoseIfAttr()

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

Definition at line 893 of file SemaDeclAttr.cpp.

◆ handleDLLAttr()

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

Definition at line 5663 of file SemaDeclAttr.cpp.

◆ handleEnableIfAttr()

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

Definition at line 737 of file SemaDeclAttr.cpp.

◆ handleEnforceTCBAttr()

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

Definition at line 6126 of file SemaDeclAttr.cpp.

◆ handleEnumExtensibilityAttr()

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

Definition at line 3391 of file SemaDeclAttr.cpp.

◆ handleErrorAttr()

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

Definition at line 746 of file SemaDeclAttr.cpp.

◆ handleExcludeFromExplicitInstantiationAttr()

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

Definition at line 754 of file SemaDeclAttr.cpp.

◆ handleExclusiveTrylockFunctionAttr()

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

Definition at line 672 of file SemaDeclAttr.cpp.

◆ handleExternalSourceSymbolAttr()

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

Definition at line 2575 of file SemaDeclAttr.cpp.

◆ handleExtVectorTypeAttr()

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

Definition at line 1194 of file SemaDeclAttr.cpp.

◆ handleFormatArgAttr()

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

Handle attribute((format_arg((idx)))) attribute based on http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html.

Definition at line 3413 of file SemaDeclAttr.cpp.

◆ handleFormatAttr()

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

Handle attribute((format(type,idx,firstarg))) attributes based on http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html.

Definition at line 3574 of file SemaDeclAttr.cpp.

◆ handleFunctionReturnThunksAttr()

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

Definition at line 5970 of file SemaDeclAttr.cpp.

◆ handleGlobalAttr()

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

Definition at line 4661 of file SemaDeclAttr.cpp.

◆ handleGNUInlineAttr()

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

Definition at line 4726 of file SemaDeclAttr.cpp.

◆ handleGuardedByAttr()

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

Definition at line 492 of file SemaDeclAttr.cpp.

◆ handleHandleAttr()

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

Definition at line 6083 of file SemaDeclAttr.cpp.

◆ handleIFuncAttr()

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

Definition at line 1706 of file SemaDeclAttr.cpp.

◆ handleInitPriorityAttr()

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

Handle attribute((init_priority(priority))) attributes based on http://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Attributes.html.

Definition at line 3483 of file SemaDeclAttr.cpp.

◆ handleInternalLinkageAttr()

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

Definition at line 5908 of file SemaDeclAttr.cpp.

◆ handleInterruptAttr()

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

Definition at line 5586 of file SemaDeclAttr.cpp.

◆ handleLaunchBoundsAttr()

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

Definition at line 5231 of file SemaDeclAttr.cpp.

◆ handleLayoutVersion()

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

Definition at line 5616 of file SemaDeclAttr.cpp.

◆ handleLifetimeCategoryAttr()

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

Definition at line 4859 of file SemaDeclAttr.cpp.

◆ handleLockReturnedAttr()

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

Definition at line 682 of file SemaDeclAttr.cpp.

◆ handleLocksExcludedAttr()

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

Definition at line 693 of file SemaDeclAttr.cpp.

◆ handleManagedAttr()

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

Definition at line 4713 of file SemaDeclAttr.cpp.

◆ handleMIGServerRoutineAttr()

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

Definition at line 6029 of file SemaDeclAttr.cpp.

◆ handleMinSizeAttr()

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

Definition at line 4619 of file SemaDeclAttr.cpp.

◆ handleMinVectorWidthAttr()

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

Definition at line 3295 of file SemaDeclAttr.cpp.

◆ 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 4360 of file SemaDeclAttr.cpp.

◆ handleMSAllocatorAttr()

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

Definition at line 6051 of file SemaDeclAttr.cpp.

◆ handleMSConstexprAttr()

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

Definition at line 5509 of file SemaDeclAttr.cpp.

◆ handleMSInheritanceAttr()

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

Definition at line 5478 of file SemaDeclAttr.cpp.

◆ handleNakedAttr()

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

Definition at line 1867 of file SemaDeclAttr.cpp.

◆ handleNoBuiltinAttr()

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

Definition at line 919 of file SemaDeclAttr.cpp.

◆ handleNoCfCheckAttr()

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

Definition at line 1918 of file SemaDeclAttr.cpp.

◆ handleNoDebugAttr()

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

Definition at line 4519 of file SemaDeclAttr.cpp.

◆ handleNoEscapeAttr()

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

Definition at line 1377 of file SemaDeclAttr.cpp.

◆ handleNoMergeAttr()

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

Definition at line 5996 of file SemaDeclAttr.cpp.

◆ handleNonNullAttr()

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

Definition at line 1304 of file SemaDeclAttr.cpp.

◆ handleNonNullAttrParameter()

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

Definition at line 1347 of file SemaDeclAttr.cpp.

◆ handleNoRandomizeLayoutAttr()

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

Definition at line 4933 of file SemaDeclAttr.cpp.

◆ handleNoReturnAttr()

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

Definition at line 1890 of file SemaDeclAttr.cpp.

◆ handleNoSanitizeAttr()

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

Definition at line 5850 of file SemaDeclAttr.cpp.

◆ handleNoSanitizeSpecificAttr()

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

Definition at line 5877 of file SemaDeclAttr.cpp.

◆ handleNoUniqueAddressAttr()

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

Definition at line 6006 of file SemaDeclAttr.cpp.

◆ handleNullableTypeAttr()

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

Definition at line 5370 of file SemaDeclAttr.cpp.

◆ handleOptimizeNoneAttr()

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

Definition at line 4624 of file SemaDeclAttr.cpp.

◆ handleOwnershipAttr()

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

Definition at line 1494 of file SemaDeclAttr.cpp.

◆ handlePackedAttr()

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

Definition at line 1199 of file SemaDeclAttr.cpp.

◆ handleParamTypestateAttr()

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

Definition at line 1071 of file SemaDeclAttr.cpp.

◆ handlePassObjectSizeAttr()

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

Definition at line 969 of file SemaDeclAttr.cpp.

◆ handlePatchableFunctionEntryAttr()

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

Definition at line 5312 of file SemaDeclAttr.cpp.

◆ handlePreferredName()

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

Definition at line 1227 of file SemaDeclAttr.cpp.

◆ handlePreferredTypeAttr()

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

Definition at line 5384 of file SemaDeclAttr.cpp.

◆ handlePtGuardedByAttr()

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

Definition at line 500 of file SemaDeclAttr.cpp.

◆ handlePtGuardedVarAttr()

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

Definition at line 471 of file SemaDeclAttr.cpp.

◆ handleRandomizeLayoutAttr()

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

Definition at line 4926 of file SemaDeclAttr.cpp.

◆ handleReleaseCapabilityAttr()

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

Definition at line 5777 of file SemaDeclAttr.cpp.

◆ handleRequiresCapabilityAttr()

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

Definition at line 5787 of file SemaDeclAttr.cpp.

◆ handleRestrictAttr()

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

Definition at line 1774 of file SemaDeclAttr.cpp.

◆ handleReturnsNonNullAttr()

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

Definition at line 1367 of file SemaDeclAttr.cpp.

◆ handleReturnTypestateAttr()

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

Definition at line 1105 of file SemaDeclAttr.cpp.

◆ handleSectionAttr()

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

Definition at line 2937 of file SemaDeclAttr.cpp.

◆ handleSentinelAttr()

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

Definition at line 2670 of file SemaDeclAttr.cpp.

◆ handleSetTypestateAttr()

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

Definition at line 1150 of file SemaDeclAttr.cpp.

◆ handleSharedAttr()

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

Definition at line 4645 of file SemaDeclAttr.cpp.

◆ handleSharedTrylockFunctionAttr()

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

Definition at line 662 of file SemaDeclAttr.cpp.

◆ handleStandardNoReturnAttr()

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

Definition at line 1903 of file SemaDeclAttr.cpp.

◆ handleSuppressAttr()

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

Definition at line 4838 of file SemaDeclAttr.cpp.

◆ handleTargetAttr()

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

Definition at line 3118 of file SemaDeclAttr.cpp.

◆ handleTargetClonesAttr()

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

Definition at line 3227 of file SemaDeclAttr.cpp.

◆ handleTargetVersionAttr()

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

Definition at line 3107 of file SemaDeclAttr.cpp.

◆ handleTestTypestateAttr()

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

Definition at line 1172 of file SemaDeclAttr.cpp.

◆ handleTLSModelAttr()

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

Definition at line 1757 of file SemaDeclAttr.cpp.

◆ handleTransparentUnionAttr()

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

Definition at line 3846 of file SemaDeclAttr.cpp.

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

◆ handleTryAcquireCapabilityAttr()

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

Definition at line 5767 of file SemaDeclAttr.cpp.

◆ handleTypeTagForDatatypeAttr()

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

Definition at line 5272 of file SemaDeclAttr.cpp.

◆ handleUninitializedAttr()

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

Definition at line 6023 of file SemaDeclAttr.cpp.

◆ handleUnsafeBufferUsage()

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

Definition at line 6091 of file SemaDeclAttr.cpp.

◆ handleUnusedAttr()

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

Definition at line 2041 of file SemaDeclAttr.cpp.

◆ handleUuidAttr()

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

Definition at line 5418 of file SemaDeclAttr.cpp.

◆ handleVecReturnAttr()

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

Definition at line 1972 of file SemaDeclAttr.cpp.

◆ handleVecTypeHint()

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

Definition at line 2862 of file SemaDeclAttr.cpp.

◆ handleVisibilityAttr()

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

Definition at line 2622 of file SemaDeclAttr.cpp.

◆ handleVTablePointerAuthentication()

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

Definition at line 6183 of file SemaDeclAttr.cpp.

◆ handleWarnUnusedResult()

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

Definition at line 2759 of file SemaDeclAttr.cpp.

◆ handleWeakImportAttr()

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

Definition at line 2812 of file SemaDeclAttr.cpp.

◆ handleWeakRefAttr()

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

Definition at line 1616 of file SemaDeclAttr.cpp.

◆ handleWorkGroupSize()

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

Definition at line 2835 of file SemaDeclAttr.cpp.

◆ handleXRayLogArgsAttr()

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

Definition at line 5299 of file SemaDeclAttr.cpp.

◆ handleZeroCallUsedRegsAttr()

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

Definition at line 5913 of file SemaDeclAttr.cpp.

◆ hasBTFDeclTagAttr()

static bool hasBTFDeclTagAttr ( Decl D,
StringRef  Tag 
)
static

Definition at line 5562 of file SemaDeclAttr.cpp.

References D, and clang::Decl::specific_attrs().

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

◆ isCapabilityExpr()

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

Definition at line 344 of file SemaDeclAttr.cpp.

◆ IsDeclLambdaCallOperator()

static bool IsDeclLambdaCallOperator ( Decl D)
static

Definition at line 6297 of file SemaDeclAttr.cpp.

References D.

◆ 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 7635 of file SemaDeclAttr.cpp.

◆ isFunctionLike()

static bool isFunctionLike ( const Type T)
static

◆ isGlobalVar()

static bool isGlobalVar ( const Decl D)
static

Definition at line 5839 of file SemaDeclAttr.cpp.

◆ isIntOrBool()

static bool isIntOrBool ( Expr Exp)
static

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

Definition at line 209 of file SemaDeclAttr.cpp.

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

◆ isKernelDecl()

static bool isKernelDecl ( Decl D)
static

◆ isSanitizerAttributeAllowedOnGlobals()

static bool isSanitizerAttributeAllowedOnGlobals ( StringRef  Sanitizer)
static

Definition at line 5845 of file SemaDeclAttr.cpp.

◆ makeLaunchBoundsArgExpr()

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

Definition at line 5154 of file SemaDeclAttr.cpp.

◆ markUsedForAliasOrIfunc()

static void markUsedForAliasOrIfunc ( Sema S,
Decl D,
const ParsedAttr AL,
StringRef  Str 
)
static

Definition at line 1678 of file SemaDeclAttr.cpp.

◆ mergeEnforceTCBAttrImpl()

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

Definition at line 6151 of file SemaDeclAttr.cpp.

◆ mergeVisibilityAttr()

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

Definition at line 2596 of file SemaDeclAttr.cpp.

◆ 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 1485 of file SemaDeclAttr.cpp.

◆ parseModeAttrArg()

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

parseModeAttrArg - Parses attribute mode string and returns parsed type attribute.

Definition at line 4289 of file SemaDeclAttr.cpp.

◆ 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 6339 of file SemaDeclAttr.cpp.

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

◆ SYCLAliasValid()

static bool SYCLAliasValid ( ASTContext Context,
unsigned  BuiltinID 
)
static

Definition at line 5335 of file SemaDeclAttr.cpp.

◆ 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 253 of file SemaDeclAttr.cpp.

◆ threadSafetyCheckIsSmartPointer()

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

Definition at line 217 of file SemaDeclAttr.cpp.

◆ typeHasCapability()

static bool typeHasCapability ( Sema S,
QualType  Ty 
)
static

Definition at line 334 of file SemaDeclAttr.cpp.

◆ 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 4049 of file SemaDeclAttr.cpp.

◆ 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 2127 of file SemaDeclAttr.cpp.

References X.

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