clang  7.0.0svn
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/Basic/CharInfo.h"
#include "clang/Basic/SourceManager.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/Scope.h"
#include "clang/Sema/SemaInternal.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/MathExtras.h"
Include dependency graph for SemaDeclAttr.cpp:

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 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. More...
 
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. More...
 
static bool hasDeclarator (const Decl *D)
 Return true if the given decl has a declarator that should have been processed by Sema::GetTypeForDeclarator. More...
 
static bool hasFunctionProto (const Decl *D)
 hasFunctionProto - Return true if the given decl has a argument information. More...
 
static unsigned getFunctionOrMethodNumParams (const Decl *D)
 getFunctionOrMethodNumParams - Return number of function or method parameters. More...
 
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)
 
static bool isCFStringType (QualType T, ASTContext &Ctx)
 
static unsigned getNumAttributeArgs (const AttributeList &AL)
 
template<typename Compare >
static bool checkAttributeNumArgsImpl (Sema &S, const AttributeList &AL, unsigned Num, unsigned Diag, Compare Comp)
 
static bool checkAttributeNumArgs (Sema &S, const AttributeList &AL, unsigned Num)
 Check if the attribute has exactly as many args as Num. More...
 
static bool checkAttributeAtLeastNumArgs (Sema &S, const AttributeList &AL, unsigned Num)
 Check if the attribute has at least as many args as Num. More...
 
static bool checkAttributeAtMostNumArgs (Sema &S, const AttributeList &AL, unsigned Num)
 Check if the attribute has at most as many args as Num. More...
 
template<typename AttrInfo >
static std::enable_if< std::is_base_of< Attr, AttrInfo >::value, SourceLocation >::type getAttrLoc (const AttrInfo &AL)
 A helper function to provide Attribute Location for the Attr types AND the AttributeList. More...
 
static SourceLocation getAttrLoc (const AttributeList &AL)
 
template<typename AttrInfo >
static std::enable_if< std::is_base_of< Attr, AttrInfo >::value, const AttrInfo * >::type getAttrName (const AttrInfo &AL)
 A helper function to provide Attribute Name for the Attr types AND the AttributeList. More...
 
static const IdentifierInfogetAttrName (const AttributeList &AL)
 
template<typename AttrInfo >
static bool checkUInt32Argument (Sema &S, const AttrInfo &AI, const Expr *Expr, uint32_t &Val, unsigned Idx=UINT_MAX)
 If Expr is a valid integer constant, get the value of the integer expression and return success or failure. More...
 
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 AttrTy >
static bool checkAttrMutualExclusion (Sema &S, Decl *D, SourceRange Range, IdentifierInfo *Ident)
 Diagnose mutually exclusive attributes when present on a given declaration. More...
 
template<typename AttrInfo >
static bool checkFunctionOrMethodParameterIndex (Sema &S, const Decl *D, const AttrInfo &AI, unsigned AttrArgNum, const Expr *IdxExpr, uint64_t &Idx, bool AllowImplicitThis=false)
 Check if IdxExpr is a valid parameter index for a function or instance method D. More...
 
template<typename AttrType >
static void handleSimpleAttribute (Sema &S, Decl *D, const AttributeList &AL)
 Applies the given attribute to the Decl without performing any additional semantic checking. More...
 
template<typename AttrType >
static void handleSimpleAttributeWithExclusions (Sema &S, Decl *D, const AttributeList &AL)
 
template<typename AttrType , typename IncompatibleAttrType , typename... IncompatibleAttrTypes>
static void handleSimpleAttributeWithExclusions (Sema &S, Decl *D, const AttributeList &AL)
 Applies the given attribute to the Decl so long as the Decl doesn't already have one of the given incompatible attributes. 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 AttributeList &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...
 
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 AttributeList &AL, SmallVectorImpl< Expr *> &Args, int 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 AttributeList &AL)
 
static bool checkGuardedByAttrCommon (Sema &S, Decl *D, const AttributeList &AL, Expr *&Arg)
 
static void handleGuardedByAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handlePtGuardedByAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static bool checkAcquireOrderAttrCommon (Sema &S, Decl *D, const AttributeList &AL, SmallVectorImpl< Expr *> &Args)
 
static void handleAcquiredAfterAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAcquiredBeforeAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static bool checkLockFunAttrCommon (Sema &S, Decl *D, const AttributeList &AL, SmallVectorImpl< Expr *> &Args)
 
static void handleAssertSharedLockAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAssertExclusiveLockAttr (Sema &S, Decl *D, const AttributeList &AL)
 
template<typename AttrInfo >
static bool checkParamIsIntegerType (Sema &S, const FunctionDecl *FD, const AttrInfo &AI, Expr *AttrArg, unsigned FuncParamNo, unsigned AttrArgNo, bool AllowDependentType=false)
 Checks to be sure that the given parameter number is in bounds, and is an integral type. More...
 
static bool checkParamIsIntegerType (Sema &S, const FunctionDecl *FD, const AttributeList &AL, unsigned FuncParamNo, unsigned AttrArgNo, bool AllowDependentType=false)
 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 AttributeList &AL)
 
static bool checkTryLockFunAttrCommon (Sema &S, Decl *D, const AttributeList &AL, SmallVectorImpl< Expr *> &Args)
 
static void handleSharedTrylockFunctionAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleExclusiveTrylockFunctionAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleLockReturnedAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleLocksExcludedAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static bool checkFunctionConditionAttr (Sema &S, Decl *D, const AttributeList &AL, Expr *&Cond, StringRef &Msg)
 
static void handleEnableIfAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleDiagnoseIfAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handlePassObjectSizeAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleConsumableAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static bool checkForConsumableClass (Sema &S, const CXXMethodDecl *MD, const AttributeList &AL)
 
static void handleCallableWhenAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleParamTypestateAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleReturnTypestateAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleSetTypestateAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleTestTypestateAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleExtVectorTypeAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handlePackedAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static bool checkIBOutletCommon (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleIBOutlet (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleIBOutletCollection (Sema &S, Decl *D, const AttributeList &AL)
 
static bool attrNonNullArgCheck (Sema &S, QualType T, const AttributeList &AL, SourceRange AttrParmRange, SourceRange TypeRange, bool isReturnValue=false)
 
static void handleNonNullAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleNonNullAttrParameter (Sema &S, ParmVarDecl *D, const AttributeList &AL)
 
static void handleReturnsNonNullAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleNoEscapeAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAssumeAlignedAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAllocAlignAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static bool normalizeName (StringRef &AttrName)
 Normalize the attribute, foo becomes foo. More...
 
static void handleOwnershipAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleWeakRefAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleIFuncAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAliasAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleColdAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleHotAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleTLSModelAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleRestrictAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleCommonAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleNakedAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleNoReturnAttr (Sema &S, Decl *D, const AttributeList &Attrs)
 
static void handleNoCallerSavedRegsAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAnalyzerNoReturnAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleVecReturnAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleDependencyAttr (Sema &S, Scope *Scope, Decl *D, const AttributeList &AL)
 
static void handleNotTailCalledAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleDisableTailCallsAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleUsedAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleUnusedAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleConstructorAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleDestructorAttr (Sema &S, Decl *D, const AttributeList &AL)
 
template<typename AttrTy >
static void handleAttrWithMessage (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleObjCSuppresProtocolAttr (Sema &S, Decl *D, const AttributeList &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 AttributeList &AL)
 
static void handleExternalSourceSymbolAttr (Sema &S, Decl *D, const AttributeList &AL)
 
template<class T >
static T * mergeVisibilityAttr (Sema &S, Decl *D, SourceRange range, typename T::VisibilityType value, unsigned attrSpellingListIndex)
 
static void handleVisibilityAttr (Sema &S, Decl *D, const AttributeList &AL, bool isTypeVisibility)
 
static void handleObjCMethodFamilyAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleObjCNSObject (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleObjCIndependentClass (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleBlocksAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleSentinelAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleWarnUnusedResult (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleWeakImportAttr (Sema &S, Decl *D, const AttributeList &AL)
 
template<typename WorkGroupAttr >
static void handleWorkGroupSize (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleSubGroupSize (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleVecTypeHint (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleSectionAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleTargetAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleCleanupAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleEnumExtensibilityAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleFormatArgAttr (Sema &S, Decl *D, const AttributeList &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 AttributeList &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 AttributeList &AL)
 Handle attribute((format(type,idx,firstarg))) attributes based on http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html. More...
 
static void handleTransparentUnionAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAnnotateAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAlignValueAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAlignedAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void parseModeAttrArg (Sema &S, StringRef Str, unsigned &DestWidth, bool &IntegerMode, bool &ComplexMode)
 parseModeAttrArg - Parses attribute mode string and returns parsed type attribute. More...
 
static void handleModeAttr (Sema &S, Decl *D, const AttributeList &AL)
 handleModeAttr - This attribute modifies the width of a decl with primitive type. More...
 
static void handleNoDebugAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAlwaysInlineAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleMinSizeAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleOptimizeNoneAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleConstantAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleSharedAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleGlobalAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleGNUInlineAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleCallConvAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleSuppressAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static bool isValidSwiftContextType (QualType Ty)
 Pointer-like types in the default address space. More...
 
static bool isValidSwiftIndirectResultType (QualType Ty)
 Pointers and references in the default address space. More...
 
static bool isValidSwiftErrorResultType (QualType Ty)
 Pointers and references to pointers in the default address space. More...
 
static void handleParameterABIAttr (Sema &S, Decl *D, const AttributeList &Attrs, ParameterABI Abi)
 
static ExprmakeLaunchBoundsArgExpr (Sema &S, Expr *E, const CUDALaunchBoundsAttr &AL, const unsigned Idx)
 
static void handleLaunchBoundsAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleArgumentWithTypeTagAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleTypeTagForDatatypeAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleXRayLogArgsAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static bool isValidSubjectOfNSReturnsRetainedAttribute (QualType QT)
 
static bool isValidSubjectOfNSAttribute (Sema &S, QualType QT)
 
static bool isValidSubjectOfCFAttribute (Sema &S, QualType QT)
 
static void handleNSConsumedAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleNSReturnsRetainedAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleObjCReturnsInnerPointerAttr (Sema &S, Decl *D, const AttributeList &Attrs)
 
static void handleObjCRequiresSuperAttr (Sema &S, Decl *D, const AttributeList &Attrs)
 
static void handleCFAuditedTransferAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleCFUnknownTransferAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleObjCBridgeAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleObjCBridgeMutableAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleObjCBridgeRelatedAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleObjCDesignatedInitializer (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleObjCRuntimeName (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleObjCBoxable (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleObjCOwnershipAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleObjCPreciseLifetimeAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleUuidAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleMSInheritanceAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleDeclspecThreadAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAbiTagAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleARMInterruptAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleMSP430InterruptAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleMipsInterruptAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAnyX86InterruptAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAVRInterruptAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAVRSignalAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleInterruptAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAMDGPUFlatWorkGroupSizeAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAMDGPUWavesPerEUAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAMDGPUNumSGPRAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAMDGPUNumVGPRAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleX86ForceAlignArgPointerAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleLayoutVersion (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleDLLAttr (Sema &S, Decl *D, const AttributeList &A)
 
static void handleCapabilityAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAssertCapabilityAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleAcquireCapabilityAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleTryAcquireCapabilityAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleReleaseCapabilityAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleRequiresCapabilityAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleDeprecatedAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static bool isGlobalVar (const Decl *D)
 
static void handleNoSanitizeAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleNoSanitizeSpecificAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleInternalLinkageAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void handleOpenCLNoSVMAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static bool handleCommonAttributeFeatures (Sema &S, Decl *D, const AttributeList &AL)
 Handles semantic checking for features that are common to all attributes, such as checking whether a parameter was properly specified, or the correct number of arguments were passed, etc. More...
 
static void handleOpenCLAccessAttr (Sema &S, Decl *D, const AttributeList &AL)
 
static void ProcessDeclAttribute (Sema &S, Scope *scope, Decl *D, const AttributeList &AL, bool IncludeCXX11Attributes)
 ProcessDeclAttribute - Apply the specific attribute to the specified decl if the attribute applies to decls. More...
 
static void checkUnusedDeclAttributes (Sema &S, const AttributeList *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...
 
static const AvailabilityAttr * getAttrForPlatform (ASTContext &Context, const Decl *D)
 
static std::pair< AvailabilityResult, const NamedDecl * > ShouldDiagnoseAvailabilityOfDecl (const NamedDecl *D, std::string *Message)
 The diagnostic we should emit for D, and the declaration that originated it, or AR_Available. More...
 
static bool ShouldDiagnoseAvailabilityInContext (Sema &S, AvailabilityResult K, VersionTuple DeclVersion, Decl *Ctx)
 whether we should emit a diagnostic for K and DeclVersion in the context of Ctx. More...
 
static bool shouldDiagnoseAvailabilityByDefault (const ASTContext &Context, const VersionTuple &DeploymentVersion, const VersionTuple &DeclVersion)
 
static NamedDeclfindEnclosingDeclToAnnotate (Decl *OrigCtx)
 
static Optional< AttributeInsertion > createAttributeInsertion (const NamedDecl *D, const SourceManager &SM, const LangOptions &LangOpts)
 Returns a source location in which it's appropriate to insert a new attribute for the given declaration . More...
 
static void DoEmitAvailabilityWarning (Sema &S, AvailabilityResult K, Decl *Ctx, const NamedDecl *ReferringDecl, const NamedDecl *OffendingDecl, StringRef Message, SourceLocation Loc, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, bool ObjCPropertyAccess)
 Actually emit an availability diagnostic for a reference to an unavailable decl. More...
 
static void handleDelayedAvailabilityCheck (Sema &S, DelayedDiagnostic &DD, Decl *Ctx)
 
static void EmitAvailabilityWarning (Sema &S, AvailabilityResult AR, const NamedDecl *ReferringDecl, const NamedDecl *OffendingDecl, StringRef Message, SourceLocation Loc, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, bool ObjCPropertyAccess)
 

Enumeration Type Documentation

◆ FormatAttrKind

Enumerator
CFStringFormat 
NSStringFormat 
StrftimeFormat 
SupportedFormat 
IgnoredFormat 
InvalidFormat 

Definition at line 3165 of file SemaDeclAttr.cpp.

Function Documentation

◆ attrNonNullArgCheck()

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

Definition at line 1424 of file SemaDeclAttr.cpp.

◆ checkAcquireOrderAttrCommon()

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

Definition at line 686 of file SemaDeclAttr.cpp.

◆ checkAttrArgsAreCapabilityObjs()

static void checkAttrArgsAreCapabilityObjs ( Sema S,
Decl D,
const AttributeList AL,
SmallVectorImpl< Expr *> &  Args,
int  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 563 of file SemaDeclAttr.cpp.

◆ checkAttributeAtLeastNumArgs()

static bool checkAttributeAtLeastNumArgs ( Sema S,
const AttributeList AL,
unsigned  Num 
)
static

Check if the attribute has at least as many args as Num.

May output an error.

Definition at line 202 of file SemaDeclAttr.cpp.

◆ checkAttributeAtMostNumArgs()

static bool checkAttributeAtMostNumArgs ( Sema S,
const AttributeList AL,
unsigned  Num 
)
static

Check if the attribute has at most as many args as Num.

May output an error.

Definition at line 211 of file SemaDeclAttr.cpp.

◆ checkAttributeNumArgs()

static bool checkAttributeNumArgs ( Sema S,
const AttributeList AL,
unsigned  Num 
)
static

Check if the attribute has exactly as many args as Num.

May output an error.

Definition at line 193 of file SemaDeclAttr.cpp.

Referenced by clang::Sema::CheckCallingConvAttr(), clang::Sema::CheckNoReturnAttr(), and clang::Sema::CheckRegparmAttr().

◆ checkAttributeNumArgsImpl()

template<typename Compare >
static bool checkAttributeNumArgsImpl ( Sema S,
const AttributeList AL,
unsigned  Num,
unsigned  Diag,
Compare  Comp 
)
static

Definition at line 180 of file SemaDeclAttr.cpp.

◆ checkAttrMutualExclusion()

template<typename AttrTy >
static bool checkAttrMutualExclusion ( Sema S,
Decl D,
SourceRange  Range,
IdentifierInfo Ident 
)
static

Diagnose mutually exclusive attributes when present on a given declaration.

Returns true if diagnosed.

Definition at line 296 of file SemaDeclAttr.cpp.

◆ checkAvailabilityAttr()

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

Definition at line 2199 of file SemaDeclAttr.cpp.

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

◆ checkForConsumableClass()

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

Definition at line 1093 of file SemaDeclAttr.cpp.

◆ checkFunctionConditionAttr()

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

Definition at line 921 of file SemaDeclAttr.cpp.

◆ checkFunctionOrMethodParameterIndex()

template<typename AttrInfo >
static bool checkFunctionOrMethodParameterIndex ( Sema S,
const Decl D,
const AttrInfo &  AI,
unsigned  AttrArgNum,
const Expr IdxExpr,
uint64_t &  Idx,
bool  AllowImplicitThis = 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 312 of file SemaDeclAttr.cpp.

◆ checkGuardedByAttrCommon()

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

Definition at line 650 of file SemaDeclAttr.cpp.

◆ checkIBOutletCommon()

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

Definition at line 1318 of file SemaDeclAttr.cpp.

◆ checkLockFunAttrCommon()

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

Definition at line 732 of file SemaDeclAttr.cpp.

◆ checkParamIsIntegerType() [1/2]

template<typename AttrInfo >
static bool checkParamIsIntegerType ( Sema S,
const FunctionDecl FD,
const AttrInfo &  AI,
Expr AttrArg,
unsigned  FuncParamNo,
unsigned  AttrArgNo,
bool  AllowDependentType = false 
)
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.

FuncParamNo is expected to be from the user, so is base-1. AttrArgNo is used to actually retrieve the argument, so it's base-0.

Definition at line 775 of file SemaDeclAttr.cpp.

◆ checkParamIsIntegerType() [2/2]

static bool checkParamIsIntegerType ( Sema S,
const FunctionDecl FD,
const AttributeList AL,
unsigned  FuncParamNo,
unsigned  AttrArgNo,
bool  AllowDependentType = false 
)
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.

FuncParamNo is expected to be from the user, so is base-1. AttrArgNo is used to actually retrieve the argument, so it's base-0.

Definition at line 801 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 275 of file SemaDeclAttr.cpp.

◆ checkRecordTypeForCapability()

static bool checkRecordTypeForCapability ( Sema S,
QualType  Ty 
)
static

Definition at line 479 of file SemaDeclAttr.cpp.

◆ checkTryLockFunAttrCommon()

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

Definition at line 849 of file SemaDeclAttr.cpp.

◆ checkTypedefTypeForCapability()

static bool checkTypedefTypeForCapability ( QualType  Ty)
static

Definition at line 511 of file SemaDeclAttr.cpp.

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

◆ checkUInt32Argument()

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

If Expr is a valid integer constant, get the value of the integer expression and return success or failure.

May output an error.

Definition at line 245 of file SemaDeclAttr.cpp.

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

◆ checkUnusedDeclAttributes()

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

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

Definition at line 6647 of file SemaDeclAttr.cpp.

Referenced by clang::Sema::ActOnCastExpr(), clang::Sema::ActOnTypeName(), clang::Sema::checkUnusedDeclAttributes(), and clang::Sema::CorrectDelayedTyposInExpr().

◆ createAttributeInsertion()

static Optional<AttributeInsertion> createAttributeInsertion ( const NamedDecl D,
const SourceManager SM,
const LangOptions LangOpts 
)
static

Returns a source location in which it's appropriate to insert a new attribute for the given declaration .

Definition at line 7057 of file SemaDeclAttr.cpp.

References clang::Lexer::getLocForEndOfToken(), clang::SourceLocation::isInvalid(), and SM.

◆ DoEmitAvailabilityWarning()

static void DoEmitAvailabilityWarning ( Sema S,
AvailabilityResult  K,
Decl Ctx,
const NamedDecl ReferringDecl,
const NamedDecl OffendingDecl,
StringRef  Message,
SourceLocation  Loc,
const ObjCInterfaceDecl UnknownObjCClass,
const ObjCPropertyDecl ObjCProperty,
bool  ObjCPropertyAccess 
)
static

Actually emit an availability diagnostic for a reference to an unavailable decl.

Parameters
CtxThe context that the reference occurred in
ReferringDeclThe exact declaration that was referenced.
OffendingDeclA related decl to ReferringDecl that has an availability attribute corrisponding to K attached to it. Note that this may not be the same as ReferringDecl, i.e. if an EnumDecl is annotated and we refer to a member EnumConstantDecl, ReferringDecl is the EnumConstantDecl and OffendingDecl is the EnumDecl.

Definition at line 7087 of file SemaDeclAttr.cpp.

◆ EmitAvailabilityWarning()

static void EmitAvailabilityWarning ( Sema S,
AvailabilityResult  AR,
const NamedDecl ReferringDecl,
const NamedDecl OffendingDecl,
StringRef  Message,
SourceLocation  Loc,
const ObjCInterfaceDecl UnknownObjCClass,
const ObjCPropertyDecl ObjCProperty,
bool  ObjCPropertyAccess 
)
static

Definition at line 7362 of file SemaDeclAttr.cpp.

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

◆ findEnclosingDeclToAnnotate()

static NamedDecl* findEnclosingDeclToAnnotate ( Decl OrigCtx)
static

Definition at line 7019 of file SemaDeclAttr.cpp.

References clang::Decl::getLocEnd(), and clang::Decl::getLocStart().

◆ getAttrForPlatform()

static const AvailabilityAttr* getAttrForPlatform ( ASTContext Context,
const Decl D 
)
static

Definition at line 6856 of file SemaDeclAttr.cpp.

◆ getAttrLoc() [1/2]

template<typename AttrInfo >
static std::enable_if<std::is_base_of<Attr, AttrInfo>::value, SourceLocation>::type getAttrLoc ( const AttrInfo &  AL)
static

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

Definition at line 223 of file SemaDeclAttr.cpp.

◆ getAttrLoc() [2/2]

static SourceLocation getAttrLoc ( const AttributeList AL)
static

Definition at line 226 of file SemaDeclAttr.cpp.

References clang::AttributeList::getLoc().

◆ getAttrName() [1/2]

template<typename AttrInfo >
static std::enable_if<std::is_base_of<Attr, AttrInfo>::value, const AttrInfo *>::type getAttrName ( const AttrInfo &  AL)
static

A helper function to provide Attribute Name for the Attr types AND the AttributeList.

Definition at line 235 of file SemaDeclAttr.cpp.

◆ getAttrName() [2/2]

static const IdentifierInfo* getAttrName ( const AttributeList AL)
static

Definition at line 238 of file SemaDeclAttr.cpp.

References clang::AttributeList::getName().

◆ getFormatAttrKind()

static FormatAttrKind getFormatAttrKind ( StringRef  Format)
static

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

Definition at line 3176 of file SemaDeclAttr.cpp.

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

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

References clang::Decl::getFunctionType().

◆ getFunctionOrMethodParamRange()

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

Definition at line 104 of file SemaDeclAttr.cpp.

◆ getFunctionOrMethodParamType()

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

Definition at line 95 of file SemaDeclAttr.cpp.

References clang::Decl::getFunctionType().

◆ getFunctionOrMethodResultSourceRange()

static SourceRange getFunctionOrMethodResultSourceRange ( const Decl D)
static

Definition at line 120 of file SemaDeclAttr.cpp.

◆ getFunctionOrMethodResultType()

static QualType getFunctionOrMethodResultType ( const Decl D)
static

Definition at line 114 of file SemaDeclAttr.cpp.

References clang::Decl::getFunctionType().

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

◆ getNumAttributeArgs()

static unsigned getNumAttributeArgs ( const AttributeList 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 468 of file SemaDeclAttr.cpp.

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

Referenced by clang::CodeGen::CodeGenFunction::EmitLambdaBlockInvokeBody(), clang::CodeGen::CodeGenFunction::EmitLambdaDelegatingInvokeBody(), and clang::ASTContext::getTypeDeclType().

◆ handleAbiTagAttr()

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

Definition at line 5160 of file SemaDeclAttr.cpp.

◆ handleAcquireCapabilityAttr()

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

Definition at line 5687 of file SemaDeclAttr.cpp.

◆ handleAcquiredAfterAttr()

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

Definition at line 708 of file SemaDeclAttr.cpp.

◆ handleAcquiredBeforeAttr()

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

Definition at line 720 of file SemaDeclAttr.cpp.

◆ handleAliasAttr()

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

Definition at line 1836 of file SemaDeclAttr.cpp.

◆ handleAlignedAttr()

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

Definition at line 3524 of file SemaDeclAttr.cpp.

◆ handleAlignValueAttr()

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

Definition at line 3473 of file SemaDeclAttr.cpp.

◆ handleAllocAlignAttr()

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

Definition at line 1543 of file SemaDeclAttr.cpp.

◆ handleAllocSizeAttr()

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

Definition at line 810 of file SemaDeclAttr.cpp.

◆ handleAlwaysInlineAttr()

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

Definition at line 4051 of file SemaDeclAttr.cpp.

◆ handleAMDGPUFlatWorkGroupSizeAttr()

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

Definition at line 5431 of file SemaDeclAttr.cpp.

◆ handleAMDGPUNumSGPRAttr()

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

Definition at line 5489 of file SemaDeclAttr.cpp.

◆ handleAMDGPUNumVGPRAttr()

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

Definition at line 5501 of file SemaDeclAttr.cpp.

◆ handleAMDGPUWavesPerEUAttr()

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

Definition at line 5459 of file SemaDeclAttr.cpp.

◆ handleAnalyzerNoReturnAttr()

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

Definition at line 1999 of file SemaDeclAttr.cpp.

◆ handleAnnotateAttr()

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

Definition at line 3455 of file SemaDeclAttr.cpp.

◆ handleAnyX86InterruptAttr()

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

Definition at line 5316 of file SemaDeclAttr.cpp.

◆ handleArgumentWithTypeTagAttr()

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

Definition at line 4549 of file SemaDeclAttr.cpp.

◆ handleARMInterruptAttr()

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

Definition at line 5192 of file SemaDeclAttr.cpp.

◆ handleAssertCapabilityAttr()

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

Definition at line 5676 of file SemaDeclAttr.cpp.

◆ handleAssertExclusiveLockAttr()

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

Definition at line 755 of file SemaDeclAttr.cpp.

◆ handleAssertSharedLockAttr()

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

Definition at line 742 of file SemaDeclAttr.cpp.

◆ handleAssumeAlignedAttr()

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

Definition at line 1535 of file SemaDeclAttr.cpp.

◆ handleAttrWithMessage()

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

Definition at line 2175 of file SemaDeclAttr.cpp.

◆ handleAvailabilityAttr()

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

Definition at line 2420 of file SemaDeclAttr.cpp.

◆ handleAVRInterruptAttr()

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

Definition at line 5382 of file SemaDeclAttr.cpp.

◆ handleAVRSignalAttr()

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

Definition at line 5395 of file SemaDeclAttr.cpp.

◆ handleBlocksAttr()

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

Definition at line 2712 of file SemaDeclAttr.cpp.

◆ handleCallableWhenAttr()

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

Definition at line 1110 of file SemaDeclAttr.cpp.

◆ handleCallConvAttr()

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

Definition at line 4154 of file SemaDeclAttr.cpp.

◆ handleCapabilityAttr()

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

Definition at line 5652 of file SemaDeclAttr.cpp.

◆ handleCFAuditedTransferAttr()

static void handleCFAuditedTransferAttr ( Sema S,
Decl D,
const AttributeList AL 
)
static

Definition at line 4871 of file SemaDeclAttr.cpp.

◆ handleCFUnknownTransferAttr()

static void handleCFUnknownTransferAttr ( Sema S,
Decl D,
const AttributeList AL 
)
static

Definition at line 4882 of file SemaDeclAttr.cpp.

◆ handleCleanupAttr()

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

Definition at line 3043 of file SemaDeclAttr.cpp.

◆ handleColdAttr()

static void handleColdAttr ( Sema S,
Decl D,
const AttributeList AL 
)
static

Definition at line 1869 of file SemaDeclAttr.cpp.

◆ handleCommonAttr()

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

Definition at line 1917 of file SemaDeclAttr.cpp.

◆ handleCommonAttributeFeatures()

static bool handleCommonAttributeFeatures ( Sema S,
Decl D,
const AttributeList AL 
)
static

Handles semantic checking for features that are common to all attributes, such as checking whether a parameter was properly specified, or the correct number of arguments were passed, etc.

Definition at line 5845 of file SemaDeclAttr.cpp.

◆ handleConstantAttr()

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

Definition at line 4076 of file SemaDeclAttr.cpp.

◆ handleConstructorAttr()

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

Definition at line 2152 of file SemaDeclAttr.cpp.

◆ handleConsumableAttr()

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

Definition at line 1071 of file SemaDeclAttr.cpp.

◆ handleDeclspecThreadAttr()

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

Definition at line 5141 of file SemaDeclAttr.cpp.

◆ handleDelayedAvailabilityCheck()

static void handleDelayedAvailabilityCheck ( Sema S,
DelayedDiagnostic DD,
Decl Ctx 
)
static

Definition at line 7295 of file SemaDeclAttr.cpp.

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

◆ handleDelayedForbiddenType()

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

Handle a delayed forbidden-type diagnostic.

Definition at line 6831 of file SemaDeclAttr.cpp.

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

◆ handleDependencyAttr()

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

Definition at line 2076 of file SemaDeclAttr.cpp.

◆ handleDeprecatedAttr()

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

Definition at line 5742 of file SemaDeclAttr.cpp.

◆ handleDestructorAttr()

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

Definition at line 2163 of file SemaDeclAttr.cpp.

◆ handleDiagnoseIfAttr()

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

Definition at line 1008 of file SemaDeclAttr.cpp.

◆ handleDisableTailCallsAttr()

static void handleDisableTailCallsAttr ( Sema S,
Decl D,
const AttributeList AL 
)
static

Definition at line 2103 of file SemaDeclAttr.cpp.

◆ handleDLLAttr()

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

Definition at line 5582 of file SemaDeclAttr.cpp.

◆ handleEnableIfAttr()

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

Definition at line 951 of file SemaDeclAttr.cpp.

◆ handleEnumExtensibilityAttr()

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

Definition at line 3100 of file SemaDeclAttr.cpp.

◆ handleExclusiveTrylockFunctionAttr()

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

Definition at line 878 of file SemaDeclAttr.cpp.

◆ handleExternalSourceSymbolAttr()

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

Definition at line 2535 of file SemaDeclAttr.cpp.

◆ handleExtVectorTypeAttr()

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

Definition at line 1282 of file SemaDeclAttr.cpp.

◆ handleFormatArgAttr()

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

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

Definition at line 3124 of file SemaDeclAttr.cpp.

◆ handleFormatAttr()

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

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

Definition at line 3259 of file SemaDeclAttr.cpp.

◆ handleGlobalAttr()

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

Definition at line 4109 of file SemaDeclAttr.cpp.

◆ handleGNUInlineAttr()

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

Definition at line 4142 of file SemaDeclAttr.cpp.

◆ handleGuardedByAttr()

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

Definition at line 664 of file SemaDeclAttr.cpp.

◆ handleHotAttr()

static void handleHotAttr ( Sema S,
Decl D,
const AttributeList AL 
)
static

Definition at line 1877 of file SemaDeclAttr.cpp.

◆ handleIBOutlet()

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

Definition at line 1344 of file SemaDeclAttr.cpp.

◆ handleIBOutletCollection()

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

Definition at line 1353 of file SemaDeclAttr.cpp.

◆ handleIFuncAttr()

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

Definition at line 1820 of file SemaDeclAttr.cpp.

◆ handleInitPriorityAttr()

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

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

Definition at line 3197 of file SemaDeclAttr.cpp.

◆ handleInternalLinkageAttr()

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

Definition at line 5825 of file SemaDeclAttr.cpp.

◆ handleInterruptAttr()

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

Definition at line 5408 of file SemaDeclAttr.cpp.

◆ handleLaunchBoundsAttr()

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

Definition at line 4538 of file SemaDeclAttr.cpp.

◆ handleLayoutVersion()

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

Definition at line 5538 of file SemaDeclAttr.cpp.

◆ handleLockReturnedAttr()

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

Definition at line 889 of file SemaDeclAttr.cpp.

◆ handleLocksExcludedAttr()

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

Definition at line 903 of file SemaDeclAttr.cpp.

◆ handleMinSizeAttr()

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

Definition at line 4063 of file SemaDeclAttr.cpp.

◆ handleMipsInterruptAttr()

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

Definition at line 5257 of file SemaDeclAttr.cpp.

◆ handleModeAttr()

static void handleModeAttr ( Sema S,
Decl D,
const AttributeList 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 3803 of file SemaDeclAttr.cpp.

◆ handleMSInheritanceAttr()

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

Definition at line 5125 of file SemaDeclAttr.cpp.

◆ handleMSP430InterruptAttr()

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

Definition at line 5221 of file SemaDeclAttr.cpp.

◆ handleNakedAttr()

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

Definition at line 1929 of file SemaDeclAttr.cpp.

◆ handleNoCallerSavedRegsAttr()

static void handleNoCallerSavedRegsAttr ( Sema S,
Decl D,
const AttributeList AL 
)
static

Definition at line 1965 of file SemaDeclAttr.cpp.

◆ handleNoDebugAttr()

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

Definition at line 3959 of file SemaDeclAttr.cpp.

◆ handleNoEscapeAttr()

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

Definition at line 1519 of file SemaDeclAttr.cpp.

◆ handleNonNullAttr()

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

Definition at line 1440 of file SemaDeclAttr.cpp.

◆ handleNonNullAttrParameter()

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

Definition at line 1484 of file SemaDeclAttr.cpp.

◆ handleNoReturnAttr()

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

Definition at line 1949 of file SemaDeclAttr.cpp.

◆ handleNoSanitizeAttr()

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

Definition at line 5782 of file SemaDeclAttr.cpp.

◆ handleNoSanitizeSpecificAttr()

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

Definition at line 5808 of file SemaDeclAttr.cpp.

◆ handleNotTailCalledAttr()

static void handleNotTailCalledAttr ( Sema S,
Decl D,
const AttributeList AL 
)
static

Definition at line 2093 of file SemaDeclAttr.cpp.

◆ handleNSConsumedAttr()

static void handleNSConsumedAttr ( Sema S,
Decl D,
const AttributeList AL 
)
static

Definition at line 4657 of file SemaDeclAttr.cpp.

◆ handleNSReturnsRetainedAttr()

static void handleNSReturnsRetainedAttr ( Sema S,
Decl D,
const AttributeList AL 
)
static

Definition at line 4705 of file SemaDeclAttr.cpp.

◆ handleObjCBoxable()

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

Definition at line 4986 of file SemaDeclAttr.cpp.

◆ handleObjCBridgeAttr()

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

Definition at line 4893 of file SemaDeclAttr.cpp.

◆ handleObjCBridgeMutableAttr()

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

Definition at line 4922 of file SemaDeclAttr.cpp.

◆ handleObjCBridgeRelatedAttr()

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

Definition at line 4936 of file SemaDeclAttr.cpp.

◆ handleObjCDesignatedInitializer()

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

Definition at line 4954 of file SemaDeclAttr.cpp.

◆ handleObjCIndependentClass()

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

Definition at line 2696 of file SemaDeclAttr.cpp.

◆ handleObjCMethodFamilyAttr()

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

Definition at line 2638 of file SemaDeclAttr.cpp.

◆ handleObjCNSObject()

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

Definition at line 2667 of file SemaDeclAttr.cpp.

◆ handleObjCOwnershipAttr()

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

Definition at line 5009 of file SemaDeclAttr.cpp.

◆ handleObjCPreciseLifetimeAttr()

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

Definition at line 5017 of file SemaDeclAttr.cpp.

◆ handleObjCRequiresSuperAttr()

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

Definition at line 4850 of file SemaDeclAttr.cpp.

◆ handleObjCReturnsInnerPointerAttr()

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

Definition at line 4822 of file SemaDeclAttr.cpp.

◆ handleObjCRuntimeName()

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

Definition at line 4971 of file SemaDeclAttr.cpp.

◆ handleObjCSuppresProtocolAttr()

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

Definition at line 2186 of file SemaDeclAttr.cpp.

◆ handleOpenCLAccessAttr()

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

Definition at line 5882 of file SemaDeclAttr.cpp.

◆ handleOpenCLNoSVMAttr()

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

Definition at line 5833 of file SemaDeclAttr.cpp.

◆ handleOptimizeNoneAttr()

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

Definition at line 4069 of file SemaDeclAttr.cpp.

◆ handleOwnershipAttr()

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

Definition at line 1649 of file SemaDeclAttr.cpp.

◆ handlePackedAttr()

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

Definition at line 1287 of file SemaDeclAttr.cpp.

◆ handleParameterABIAttr()

static void handleParameterABIAttr ( Sema S,
Decl D,
const AttributeList Attrs,
ParameterABI  Abi 
)
static

Definition at line 4386 of file SemaDeclAttr.cpp.

◆ handleParamTypestateAttr()

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

Definition at line 1148 of file SemaDeclAttr.cpp.

◆ handlePassObjectSizeAttr()

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

Definition at line 1035 of file SemaDeclAttr.cpp.

◆ handlePtGuardedByAttr()

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

Definition at line 673 of file SemaDeclAttr.cpp.

◆ handlePtGuardedVarAttr()

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

Definition at line 640 of file SemaDeclAttr.cpp.

◆ handleReleaseCapabilityAttr()

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

Definition at line 5713 of file SemaDeclAttr.cpp.

◆ handleRequiresCapabilityAttr()

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

Definition at line 5724 of file SemaDeclAttr.cpp.

◆ handleRestrictAttr()

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

Definition at line 1905 of file SemaDeclAttr.cpp.

◆ handleReturnsNonNullAttr()

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

Definition at line 1506 of file SemaDeclAttr.cpp.

◆ handleReturnTypestateAttr()

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

Definition at line 1185 of file SemaDeclAttr.cpp.

◆ handleSectionAttr()

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

Definition at line 2974 of file SemaDeclAttr.cpp.

◆ handleSentinelAttr()

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

Definition at line 2732 of file SemaDeclAttr.cpp.

◆ handleSetTypestateAttr()

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

Definition at line 1233 of file SemaDeclAttr.cpp.

◆ handleSharedAttr()

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

Definition at line 4089 of file SemaDeclAttr.cpp.

◆ handleSharedTrylockFunctionAttr()

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

Definition at line 867 of file SemaDeclAttr.cpp.

◆ handleSimpleAttribute()

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

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

Definition at line 393 of file SemaDeclAttr.cpp.

◆ handleSimpleAttributeWithExclusions() [1/2]

template<typename AttrType >
static void handleSimpleAttributeWithExclusions ( Sema S,
Decl D,
const AttributeList AL 
)
static

Definition at line 399 of file SemaDeclAttr.cpp.

◆ handleSimpleAttributeWithExclusions() [2/2]

template<typename AttrType , typename IncompatibleAttrType , typename... IncompatibleAttrTypes>
static void handleSimpleAttributeWithExclusions ( Sema S,
Decl D,
const AttributeList AL 
)
static

Applies the given attribute to the Decl so long as the Decl doesn't already have one of the given incompatible attributes.

Definition at line 408 of file SemaDeclAttr.cpp.

◆ handleSubGroupSize()

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

Definition at line 2899 of file SemaDeclAttr.cpp.

◆ handleSuppressAttr()

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

Definition at line 4255 of file SemaDeclAttr.cpp.

◆ handleTargetAttr()

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

Definition at line 3030 of file SemaDeclAttr.cpp.

◆ handleTestTypestateAttr()

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

Definition at line 1257 of file SemaDeclAttr.cpp.

◆ handleTLSModelAttr()

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

Definition at line 1885 of file SemaDeclAttr.cpp.

◆ handleTransparentUnionAttr()

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

Definition at line 3381 of file SemaDeclAttr.cpp.

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

◆ handleTryAcquireCapabilityAttr()

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

Definition at line 5699 of file SemaDeclAttr.cpp.

◆ handleTypeTagForDatatypeAttr()

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

Definition at line 4594 of file SemaDeclAttr.cpp.

◆ handleUnusedAttr()

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

Definition at line 2130 of file SemaDeclAttr.cpp.

◆ handleUsedAttr()

static void handleUsedAttr ( Sema S,
Decl D,
const AttributeList AL 
)
static

Definition at line 2113 of file SemaDeclAttr.cpp.

◆ handleUuidAttr()

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

Definition at line 5075 of file SemaDeclAttr.cpp.

◆ handleVecReturnAttr()

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

Definition at line 2022 of file SemaDeclAttr.cpp.

◆ handleVecTypeHint()

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

Definition at line 2920 of file SemaDeclAttr.cpp.

◆ handleVisibilityAttr()

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

Definition at line 2585 of file SemaDeclAttr.cpp.

◆ handleWarnUnusedResult()

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

Definition at line 2823 of file SemaDeclAttr.cpp.

◆ handleWeakImportAttr()

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

Definition at line 2848 of file SemaDeclAttr.cpp.

◆ handleWeakRefAttr()

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

Definition at line 1758 of file SemaDeclAttr.cpp.

◆ handleWorkGroupSize()

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

Definition at line 2873 of file SemaDeclAttr.cpp.

◆ handleX86ForceAlignArgPointerAttr()

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

Definition at line 5513 of file SemaDeclAttr.cpp.

◆ handleXRayLogArgsAttr()

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

Definition at line 4624 of file SemaDeclAttr.cpp.

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

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

References clang::Decl::getFunctionType().

◆ isCapabilityExpr()

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

Definition at line 533 of file SemaDeclAttr.cpp.

◆ isCFStringType()

static bool isCFStringType ( QualType  T,
ASTContext Ctx 
)
inlinestatic

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

◆ isFunctionOrMethod()

static bool isFunctionOrMethod ( const Decl D)
static

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

Definition at line 57 of file SemaDeclAttr.cpp.

References clang::Decl::getFunctionType().

Referenced by isFunctionOrMethodOrBlock(), clang::DeclContext::isLookupContext(), and LookupVisibleDecls().

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

References isFunctionOrMethod().

◆ isFunctionOrMethodVariadic()

static bool isFunctionOrMethodVariadic ( const Decl D)
static

Definition at line 128 of file SemaDeclAttr.cpp.

References clang::Decl::getFunctionType().

◆ isGlobalVar()

static bool isGlobalVar ( const Decl D)
static

Definition at line 5776 of file SemaDeclAttr.cpp.

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

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

◆ isNSStringType()

static bool isNSStringType ( QualType  T,
ASTContext Ctx 
)
inlinestatic

◆ isValidSubjectOfCFAttribute()

static bool isValidSubjectOfCFAttribute ( Sema S,
QualType  QT 
)
static

Definition at line 4652 of file SemaDeclAttr.cpp.

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

◆ isValidSubjectOfNSAttribute()

static bool isValidSubjectOfNSAttribute ( Sema S,
QualType  QT 
)
static

Definition at line 4647 of file SemaDeclAttr.cpp.

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

◆ isValidSubjectOfNSReturnsRetainedAttribute()

static bool isValidSubjectOfNSReturnsRetainedAttribute ( QualType  QT)
static

◆ isValidSwiftContextType()

static bool isValidSwiftContextType ( QualType  Ty)
static

◆ isValidSwiftErrorResultType()

static bool isValidSwiftErrorResultType ( QualType  Ty)
static

Pointers and references to pointers in the default address space.

Definition at line 4373 of file SemaDeclAttr.cpp.

References clang::Qualifiers::empty(), clang::Type::getAs(), clang::Type::getPointeeType(), clang::QualType::getQualifiers(), clang::Type::isDependentType(), and isValidSwiftContextType().

◆ isValidSwiftIndirectResultType()

static bool isValidSwiftIndirectResultType ( QualType  Ty)
static

Pointers and references in the default address space.

Definition at line 4361 of file SemaDeclAttr.cpp.

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

◆ makeLaunchBoundsArgExpr()

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

Definition at line 4483 of file SemaDeclAttr.cpp.

◆ mergeVisibilityAttr()

template<class T >
static T* mergeVisibilityAttr ( Sema S,
Decl D,
SourceRange  range,
typename T::VisibilityType  value,
unsigned  attrSpellingListIndex 
)
static

Definition at line 2556 of file SemaDeclAttr.cpp.

◆ normalizeName()

static bool normalizeName ( StringRef &  AttrName)
static

Normalize the attribute, foo becomes foo.

Returns true if normalization was applied.

Definition at line 1640 of file SemaDeclAttr.cpp.

◆ parseModeAttrArg()

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

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

Definition at line 3743 of file SemaDeclAttr.cpp.

◆ ProcessDeclAttribute()

static void ProcessDeclAttribute ( Sema S,
Scope scope,
Decl D,
const AttributeList AL,
bool  IncludeCXX11Attributes 
)
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 5923 of file SemaDeclAttr.cpp.

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

◆ shouldDiagnoseAvailabilityByDefault()

static bool shouldDiagnoseAvailabilityByDefault ( const ASTContext Context,
const VersionTuple DeploymentVersion,
const VersionTuple DeclVersion 
)
static

Definition at line 6994 of file SemaDeclAttr.cpp.

◆ ShouldDiagnoseAvailabilityInContext()

static bool ShouldDiagnoseAvailabilityInContext ( Sema S,
AvailabilityResult  K,
VersionTuple  DeclVersion,
Decl Ctx 
)
static

whether we should emit a diagnostic for K and DeclVersion in the context of Ctx.

For example, we should emit an unavailable diagnostic in a deprecated context, but not the other way around.

Definition at line 6931 of file SemaDeclAttr.cpp.

◆ ShouldDiagnoseAvailabilityOfDecl()

static std::pair<AvailabilityResult, const NamedDecl *> ShouldDiagnoseAvailabilityOfDecl ( const NamedDecl D,
std::string *  Message 
)
static

The diagnostic we should emit for D, and the declaration that originated it, or AR_Available.

Parameters
DThe declaration to check.
MessageIf non-null, this will be populated with the message from the availability attribute that is selected.

Definition at line 6891 of file SemaDeclAttr.cpp.

References clang::AR_Available, and clang::Decl::getAvailability().

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

◆ threadSafetyCheckIsPointer()

static bool threadSafetyCheckIsPointer ( Sema S,
const Decl D,
const AttributeList 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 443 of file SemaDeclAttr.cpp.

◆ threadSafetyCheckIsSmartPointer()

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

Definition at line 426 of file SemaDeclAttr.cpp.

◆ typeHasCapability()

static bool typeHasCapability ( Sema S,
QualType  Ty 
)
static

Definition at line 523 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 2242 of file SemaDeclAttr.cpp.

References clang::VersionTuple::empty().

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