Home | History | Annotate | Download | only in Sema

Lines Matching refs:decl

10 //  This file implements decl-related attribute processing.
52 /// isFunctionOrMethod - Return true if the given decl has function
55 static bool isFunctionOrMethod(const Decl *D) {
59 /// \brief Return true if the given decl has function type (function or
61 static bool isFunctionOrMethodOrBlock(const Decl *D) {
65 /// Return true if the given decl has a declarator that should have
67 static bool hasDeclarator(const Decl *D) {
73 /// hasFunctionProto - Return true if the given decl has a argument
74 /// information. This decl should have already passed
76 static bool hasFunctionProto(const Decl *D) {
85 static unsigned getFunctionOrMethodNumParams(const Decl *D) {
93 static QualType getFunctionOrMethodParamType(const Decl *D, unsigned Idx) {
102 static SourceRange getFunctionOrMethodParamRange(const Decl *D, unsigned Idx) {
112 static QualType getFunctionOrMethodResultType(const Decl *D) {
118 static SourceRange getFunctionOrMethodResultSourceRange(const Decl *D) {
126 static bool isFunctionOrMethodVariadic(const Decl *D) {
137 static bool isInstanceMethod(const Decl *D) {
251 static bool checkAttrMutualExclusion(Sema &S, Decl *D, SourceRange Range,
266 static bool checkFunctionOrMethodParameterIndex(Sema &S, const Decl *D,
346 /// \brief Applies the given attribute to the Decl without performing any
349 static void handleSimpleAttribute(Sema &S, Decl *D,
356 static void handleSimpleAttributeWithExclusions(Sema &S, Decl *D,
361 /// \brief Applies the given attribute to the Decl so long as the Decl doesn't
365 static void handleSimpleAttributeWithExclusions(Sema &S, Decl *D,
397 /// \brief Check if passed in Decl is a pointer type.
399 /// \return true if the Decl is a pointer type; false otherwise
400 static bool threadSafetyCheckIsPointer(Sema &S, const Decl *D,
521 static void checkAttrArgsAreCapabilityObjs(Sema &S, Decl *D,
599 static void handlePtGuardedVarAttr(Sema &S, Decl *D,
609 static bool checkGuardedByAttrCommon(Sema &S, Decl *D,
624 static void handleGuardedByAttr(Sema &S, Decl *D, const AttributeList &Attr) {
633 static void handlePtGuardedByAttr(Sema &S, Decl *D,
647 static bool checkAcquireOrderAttrCommon(Sema &S, Decl *D,
669 static void handleAcquiredAfterAttr(Sema &S, Decl *D,
682 static void handleAcquiredBeforeAttr(Sema &S, Decl *D,
695 static bool checkLockFunAttrCommon(Sema &S, Decl *D,
705 static void handleAssertSharedLockAttr(Sema &S, Decl *D,
718 static void handleAssertExclusiveLockAttr(Sema &S, Decl *D,
733 static bool checkTryLockFunAttrCommon(Sema &S, Decl *D,
751 static void handleSharedTrylockFunctionAttr(Sema &S, Decl *D,
764 static void handleExclusiveTrylockFunctionAttr(Sema &S, Decl *D,
775 static void handleLockReturnedAttr(Sema &S, Decl *D,
789 static void handleLocksExcludedAttr(Sema &S, Decl *D,
807 static void handleEnableIfAttr(Sema &S, Decl *D, const AttributeList &Attr) {
837 static void handlePassObjectSizeAttr(Sema &S, Decl *D,
874 static void handleConsumableAttr(Sema &S, Decl *D, const AttributeList &Attr) {
913 static void handleCallableWhenAttr(Sema &S, Decl *D,
951 static void handleParamTypestateAttr(Sema &S, Decl *D,
988 static void handleReturnTypestateAttr(Sema &S, Decl *D,
1036 static void handleSetTypestateAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1060 static void handleTestTypestateAttr(Sema &S, Decl *D,
1085 static void handleExtVectorTypeAttr(Sema &S, Scope *scope, Decl *D,
1087 // Remember this typedef decl, we will need it later for diagnostics.
1091 static void handlePackedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1108 static bool checkIBOutletCommon(Sema &S, Decl *D, const AttributeList &Attr) {
1134 static void handleIBOutlet(Sema &S, Decl *D, const AttributeList &Attr) {
1143 static void handleIBOutletCollection(Sema &S, Decl *D,
1230 static void handleNonNullAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1296 static void handleReturnsNonNullAttr(Sema &S, Decl *D,
1309 static void handleAssumeAlignedAttr(Sema &S, Decl *D,
1317 void Sema::AddAssumeAlignedAttr(SourceRange AttrRange, Decl *D, Expr *E,
1379 static void handleOwnershipAttr(Sema &S, Decl *D, const AttributeList &AL) {
1488 static void handleWeakRefAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1543 // check for an existing decl?
1552 static void handleIFuncAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1574 static void handleAliasAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1607 static void handleColdAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1615 static void handleHotAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1623 static void handleTLSModelAttr(Sema &S, Decl *D,
1643 static void handleRestrictAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1655 static void handleCommonAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1667 static void handleNakedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1676 static void handleNoReturnAttr(Sema &S, Decl *D, const AttributeList &attr) {
1701 static void handleAnalyzerNoReturnAttr(Sema &S, Decl *D,
1724 static void handleVecReturnAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1779 static void handleDependencyAttr(Sema &S, Scope *Scope, Decl *D,
1796 static void handleNotTailCalledAttr(Sema &S, Decl *D,
1806 static void handleDisableTailCallsAttr(Sema &S, Decl *D,
1816 static void handleUsedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1833 static void handleUnusedAttr(Sema &S, Decl
1855 static void handleConstructorAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1866 static void handleDestructorAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1878 static void handleAttrWithMessage(Sema &S, Decl *D,
1889 static void handleObjCSuppresProtocolAttr(Sema &S, Decl *D,
2123 static void handleAvailabilityAttr(Sema &S, Decl *D,
2243 static T *mergeVisibilityAttr(Sema &S, Decl *D, SourceRange range,
2258 VisibilityAttr *Sema::mergeVisibilityAttr(Decl *D, SourceRange Range,
2265 TypeVisibilityAttr *Sema::mergeTypeVisibilityAttr(Decl *D, SourceRange Range,
2272 static void handleVisibilityAttr(Sema &S, Decl *D, const AttributeList &Attr,
2325 static void handleObjCMethodFamilyAttr(Sema &S, Decl *decl,
2327 ObjCMethodDecl *method = cast<ObjCMethodDecl>(decl);
2355 static void handleObjCNSObject(Sema &S, Decl *D, const AttributeList &Attr) {
2384 static void handleObjCIndependentClass(Sema &S, Decl *D, const AttributeList &Attr) {
2400 static void handleBlocksAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2420 static void handleSentinelAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2511 static void handleWarnUnusedResult(Sema &S, Decl *D, const AttributeList &Attr) {
2536 static void handleWeakImportAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2561 static void handleWorkGroupSize(Sema &S, Decl *D,
2586 static void handleVecTypeHint(Sema &S, Decl *D, const AttributeList &Attr) {
2617 SectionAttr *Sema::mergeSectionAttr(Decl *D, SourceRange Range,
2640 static void handleSectionAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2675 static void handleTargetAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2687 static void handleCleanupAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2752 static void handleFormatArgAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2824 static void handleInitPriorityAttr(Sema &S, Decl *D,
2863 FormatAttr *Sema::mergeFormatAttr(Decl *D, SourceRange Range,
2886 static void handleFormatAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3008 static void handleTransparentUnionAttr(Sema &S, Decl *D,
3077 static void handleAnnotateAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3095 static void handleAlignValueAttr(Sema &S, Decl *D,
3101 void Sema::AddAlignValueAttr(SourceRange AttrRange, Decl *D, Expr *E,
3112 llvm_unreachable("Unknown decl type for align_value");
3146 static void handleAlignedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3184 void Sema::AddAlignedAttr(SourceRange AttrRange, Decl *D, Expr *E,
3287 void Sema::AddAlignedAttr(SourceRange AttrRange, Decl *D, TypeSourceInfo *TS,
3297 void Sema::CheckAlignasUnderalignment(Decl *D) {
3298 assert(D->hasAttrs() && "no attributes on decl");
3419 /// handleModeAttr - This attribute modifies the width of a decl with primitive
3422 /// Despite what would be logical, the mode attribute is a decl attribute, not a
3425 static void handleModeAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3439 void Sema::AddModeAttr(SourceRange AttrRange, Decl *D, IdentifierInfo *Name,
3581 static void handleNoDebugAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3587 AlwaysInlineAttr *Sema::mergeAlwaysInlineAttr(Decl *D, SourceRange Range,
3603 CommonAttr *Sema::mergeCommonAttr(Decl *D, SourceRange Range,
3613 Sema::mergeInternalLinkageAttr(Decl *D, SourceRange Range,
3619 if (VD->getKind() != Decl::Var) {
3639 MinSizeAttr *Sema::mergeMinSizeAttr(Decl *D, SourceRange Range,
3653 OptimizeNoneAttr *Sema::mergeOptimizeNoneAttr(Decl *D, SourceRange Range,
3673 static void handleAlwaysInlineAttr(Sema &S, Decl *D,
3685 static void handleMinSizeAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3691 static void handleOptimizeNoneAttr(Sema &S, Decl *D,
3698 static void handleGlobalAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3731 static void handleGNUInlineAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3743 static void handleCallConvAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3747 // in the Decl node for syntactic reasoning, e.g., pretty-printing.
3950 static void handleParameterABIAttr(Sema &S, Decl *D, const AttributeList &attr,
3956 void Sema::AddParameterABIAttr(SourceRange range, Decl *D, ParameterABI abi,
4084 void Sema::AddLaunchBoundsAttr(SourceRange AttrRange, Decl *D, Expr *MaxThreads,
4102 static void handleLaunchBoundsAttr(Sema &S, Decl *D,
4113 static void handleArgumentWithTypeTagAttr(Sema &S, Decl *D,
4158 static void handleTypeTagForDatatypeAttr(Sema &S, Decl *D,
4209 static void handleNSConsumedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
4215 void Sema::AddNSConsumedAttr(SourceRange attrRange, Decl *D,
4251 static void handleNSReturnsRetainedAttr(Sema &S, Decl *D,
4363 static void handleObjCReturnsInnerPointerAttr(Sema &S, Decl *D,
4391 static void handleObjCRequiresSuperAttr(Sema &S, Decl *D,
4413 static void handleCFAuditedTransferAttr(Sema &S, Decl *D,
4424 static void handleCFUnknownTransferAttr(Sema &S, Decl *D,
4435 static void handleObjCBridgeAttr(Sema &S, Scope *Sc, Decl *D,
4465 static void handleObjCBridgeMutableAttr(Sema &S, Scope *Sc, Decl *D,
4479 static void handleObjCBridgeRelatedAttr(Sema &S, Scope *Sc, Decl *D,
4497 static void handleObjCDesignatedInitializer(Sema &S, Decl *D,
4515 static void handleObjCRuntimeName(Sema &S, Decl *D,
4530 static void handleObjCBoxable(Sema &S, Decl *D, const AttributeList &Attr) {
4553 static void handleObjCOwnershipAttr(Sema &S, Decl *D,
4561 static void handleObjCPreciseLifetimeAttr(Sema &S, Decl *D,
4606 static void handleUuidAttr(Sema &S, Decl *D, const AttributeList &Attr) {
4651 static void handleMSInheritanceAttr(Sema &S, Decl *D, const AttributeList &Attr) {
4667 static void handleDeclspecThreadAttr(Sema &S, Decl *D,
4686 static void handleAbiTagAttr(Sema &S, Decl *D, const AttributeList &Attr) {
4718 static void handleARMInterruptAttr(Sema &S, Decl *D,
4747 static void handleMSP430InterruptAttr(Sema &S, Decl *D,
4758 // FIXME: Check for decl - it should be void ()(void).
4783 static void handleMipsInterruptAttr(Sema &S, Decl *D,
4842 static void handleAnyX86InterruptAttr(Sema &S, Decl *D,
4908 static void handleInterruptAttr(Sema &S, Decl *D, const AttributeList &Attr) {
4928 static void handleAMDGPUNumVGPRAttr(Sema &S, Decl *D,
4941 static void handleAMDGPUNumSGPRAttr(Sema &S, Decl *D,
4954 static void handleX86ForceAlignArgPointerAttr(Sema &S, Decl *D,
4979 static void handleLayoutVersion(Sema &S, Decl *D, const AttributeList &Attr) {
4997 DLLImportAttr *Sema::mergeDLLImportAttr(Decl *D, SourceRange Range,
5010 DLLExportAttr *Sema::mergeDLLExportAttr(Decl *D, SourceRange Range,
5023 static void handleDLLAttr(Sema &S, Decl *D, const AttributeList &A) {
5058 Sema::mergeMSInheritanceAttr(Decl *D, SourceRange Range, bool BestCase,
5093 static void handleCapabilityAttr(Sema &S, Decl *D, const AttributeList &Attr) {
5117 static void handleAssertCapabilityAttr(Sema &S, Decl *D,
5124 static void handleAcquireCapabilityAttr(Sema &S, Decl *D,
5136 static void handleTryAcquireCapabilityAttr(Sema &S, Decl *D,
5150 static void handleReleaseCapabilityAttr(Sema &S, Decl *D,
5161 static void handleRequiresCapabilityAttr(Sema &S, Decl *D,
5179 static void handleDeprecatedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
5213 static void handleNoSanitizeAttr(Sema &S, Decl *D, const AttributeList &Attr) {
5237 static void handleNoSanitizeSpecificAttr(Sema &S, Decl *D,
5252 static void handleInternalLinkageAttr(Sema &S, Decl *D,
5260 static void handleOpenCLNoSVMAttr(Sema &S, Decl *D, const AttributeList &Attr) {
5272 static bool handleCommonAttributeFeatures(Sema &S, Scope *scope, Decl *D,
5310 static void handleOpenCLAccessAttr(Sema &S, Decl *D,
5348 /// ProcessDeclAttribute - Apply the specific attribute to the specified decl if
5351 static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
5922 /// ProcessDeclAttributeList - Apply all the decl attributes in the specified
5923 /// attribute list to the specified decl, ignoring any type attributes.
5924 void Sema::ProcessDeclAttributeList(Scope *S, Decl *D,
5987 /// contains any decl attributes that we should warn about.
6005 /// used to build a declaration, complain about any decl attributes
6014 /// DeclClonePragmaWeak - clone existing decl (maybe definition),
6015 /// \#pragma weak needs a non-definition decl and source may not have one.
6067 if (W.getAlias()) { // clone decl, impersonate __attribute(weak,alias(...))
6075 // to insert Decl at TU scope, sorry.
6087 void Sema::ProcessPragmaWeak(Scope *S, Decl *D) {
6115 void Sema::ProcessDeclAttributes(Scope *S, Decl *D, const Declarator &PD) {
6116 // Apply decl attributes from the DeclSpec if present.
6120 // Walk the declarator structure, applying decl attributes that were in a type
6121 // position to the decl itself. This handles cases like:
6123 // when X is a decl attribute.
6128 // Finally, apply any attributes on the decl itself.
6136 static bool isForbiddenTypeAllowed(Sema &S, Decl *decl,
6142 if (!isa<FieldDecl>(decl) && !isa<ObjCPropertyDecl>(decl) &&
6143 !isa<FunctionDecl>(decl))
6151 if ((isa<ObjCIvarDecl>(decl) || isa<ObjCPropertyDecl>(decl))) {
6160 if (S.Context.getSourceManager().isInSystemHeader(decl->getLocation())) {
6172 Decl *decl) {
6174 if (decl && isForbiddenTypeAllowed(S, decl, diag, reason)) {
6176 decl->addAttr(UnavailableAttr::CreateImplicit(S.Context, "", reason,
6181 if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(decl)) {
6197 static bool isDeclDeprecated(Decl *D) {
6205 } while ((D = cast_or_null<Decl>(D->getDeclContext())));
6209 static bool isDeclUnavailable(Decl *D) {
6217 } while ((D = cast_or_null<Decl>(D->getDeclContext())));
6222 const Decl *D) {
6250 Decl *Ctx, const NamedDecl *D,
6379 for (const Decl *Redecl = D->getMostRecentDecl(); Redecl;
6401 Decl *Ctx) {
6413 void Sema::PopParsingDeclaration(ParsingDeclState state, Decl *decl) {
6421 if (!decl) return;
6424 // parents. In general, we'll get one pool for the decl spec
6425 // and a child pool for each declarator; in a decl group like:
6428 // we really do need to consider delayed diagnostics from the decl spec
6443 // the decl is invalid.
6444 if (!decl->isInvalidDecl())
6445 handleDelayedAvailabilityCheck(*this, diag, decl);
6449 HandleDelayedAccessCheck(diag, decl);
6453 handleDelayedForbiddenType(*this, diag, decl);
6483 Decl *Ctx = cast<Decl>(getCurLexicalContext());