Lines Matching refs:decl
10 // This file implements decl-related attribute processing.
49 /// isFunctionOrMethod - Return true if the given decl has function
52 static bool isFunctionOrMethod(const Decl *D) {
55 /// \brief Return true if the given decl has function type (function or
57 static bool isFunctionOrMethodOrBlock(const Decl *D) {
61 /// Return true if the given decl has a declarator that should have
63 static bool hasDeclarator(const Decl *D) {
69 /// hasFunctionProto - Return true if the given decl has a argument
70 /// information. This decl should have already passed
72 static bool hasFunctionProto(const Decl *D) {
81 static unsigned getFunctionOrMethodNumParams(const Decl *D) {
89 static QualType getFunctionOrMethodParamType(const Decl *D, unsigned Idx) {
98 static SourceRange getFunctionOrMethodParamRange(const Decl *D, unsigned Idx) {
108 static QualType getFunctionOrMethodResultType(const Decl *D) {
114 static SourceRange getFunctionOrMethodResultSourceRange(const Decl *D) {
122 static bool isFunctionOrMethodVariadic(const Decl *D) {
133 static bool isInstanceMethod(const Decl *D) {
247 static bool checkAttrMutualExclusion(Sema &S, Decl *D, SourceRange Range,
262 static bool checkFunctionOrMethodParameterIndex(Sema &S, const Decl *D,
342 /// \brief Applies the given attribute to the Decl without performing any
345 static void handleSimpleAttribute(Sema &S, Decl *D,
374 /// \brief Check if passed in Decl is a pointer type.
376 /// \return true if the Decl is a pointer type; false otherwise
377 static bool threadSafetyCheckIsPointer(Sema &S, const Decl *D,
498 static void checkAttrArgsAreCapabilityObjs(Sema &S, Decl *D,
576 static void handlePtGuardedVarAttr(Sema &S, Decl *D,
586 static bool checkGuardedByAttrCommon(Sema &S, Decl *D,
601 static void handleGuardedByAttr(Sema &S, Decl *D, const AttributeList &Attr) {
610 static void handlePtGuardedByAttr(Sema &S, Decl *D,
624 static bool checkAcquireOrderAttrCommon(Sema &S, Decl *D,
646 static void handleAcquiredAfterAttr(Sema &S, Decl *D,
659 static void handleAcquiredBeforeAttr(Sema &S, Decl *D,
672 static bool checkLockFunAttrCommon(Sema &S, Decl *D,
682 static void handleAssertSharedLockAttr(Sema &S, Decl *D,
695 static void handleAssertExclusiveLockAttr(Sema &S, Decl *D,
710 static bool checkTryLockFunAttrCommon(Sema &S, Decl *D,
728 static void handleSharedTrylockFunctionAttr(Sema &S, Decl *D,
741 static void handleExclusiveTrylockFunctionAttr(Sema &S, Decl *D,
752 static void handleLockReturnedAttr(Sema &S, Decl *D,
766 static void handleLocksExcludedAttr(Sema &S, Decl *D,
784 static void handleEnableIfAttr(Sema &S, Decl *D, const AttributeList &Attr) {
812 static void handlePassObjectSizeAttr(Sema &S, Decl *D,
849 static void handleConsumableAttr(Sema &S, Decl *D, const AttributeList &Attr) {
890 static void handleCallableWhenAttr(Sema &S, Decl *D,
929 static void handleParamTypestateAttr(Sema &S, Decl *D,
967 static void handleReturnTypestateAttr(Sema &S, Decl *D,
1016 static void handleSetTypestateAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1040 static void handleTestTypestateAttr(Sema &S, Decl *D,
1065 static void handleExtVectorTypeAttr(Sema &S, Scope *scope, Decl *D,
1067 // Remember this typedef decl, we will need it later for diagnostics.
1071 static void handlePackedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1088 static bool checkIBOutletCommon(Sema &S, Decl *D, const AttributeList &Attr) {
1114 static void handleIBOutlet(Sema &S, Decl *D, const AttributeList &Attr) {
1123 static void handleIBOutletCollection(Sema &S, Decl *D,
1210 static void handleNonNullAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1276 static void handleReturnsNonNullAttr(Sema &S, Decl *D,
1289 static void handleAssumeAlignedAttr(Sema &S, Decl *D,
1297 void Sema::AddAssumeAlignedAttr(SourceRange AttrRange, Decl *D, Expr *E,
1359 static void handleOwnershipAttr(Sema &S, Decl *D, const AttributeList &AL) {
1468 static void handleWeakRefAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1523 // check for an existing decl?
1532 static void handleAliasAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1562 static void handleColdAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1570 static void handleHotAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1578 static void handleTLSModelAttr(Sema &S, Decl *D,
1598 static void handleKernelAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1616 static void handleRestrictAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1628 static void handleCommonAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1640 static void handleNakedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1649 static void handleNoReturnAttr(Sema &S, Decl *D, const AttributeList &attr) {
1674 static void handleAnalyzerNoReturnAttr(Sema &S, Decl *D,
1697 static void handleVecReturnAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1752 static void handleDependencyAttr(Sema &S, Scope *Scope, Decl *D,
1769 static void handleNotTailCalledAttr(Sema &S, Decl *D,
1779 static void handleDisableTailCallsAttr(Sema &S, Decl *D,
1789 static void handleUsedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1806 static void handleConstructorAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1817 static void handleDestructorAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1829 static void handleAttrWithMessage(Sema &S, Decl *D,
1840 static void handleObjCSuppresProtocolAttr(Sema &S, Decl *D,
2068 static void handleAvailabilityAttr(Sema &S, Decl *D,
2175 static T *mergeVisibilityAttr(Sema &S, Decl *D, SourceRange range,
2190 VisibilityAttr *Sema::mergeVisibilityAttr(Decl *D, SourceRange Range,
2197 TypeVisibilityAttr *Sema::mergeTypeVisibilityAttr(Decl *D, SourceRange Range,
2204 static void handleVisibilityAttr(Sema &S, Decl *D, const AttributeList &Attr,
2257 static void handleObjCMethodFamilyAttr(Sema &S, Decl *decl,
2259 ObjCMethodDecl *method = cast<ObjCMethodDecl>(decl);
2287 static void handleObjCNSObject(Sema &S, Decl *D, const AttributeList &Attr) {
2316 static void handleObjCIndependentClass(Sema &S, Decl *D, const AttributeList &Attr) {
2332 static void handleBlocksAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2352 static void handleSentinelAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2443 static void handleWarnUnusedResult(Sema &S, Decl *D, const AttributeList &Attr) {
2462 static void handleWeakImportAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2487 static void handleWorkGroupSize(Sema &S, Decl *D,
2512 static void handleVecTypeHint(Sema &S, Decl *D, const AttributeList &Attr) {
2543 SectionAttr *Sema::mergeSectionAttr(Decl *D, SourceRange Range,
2566 static void handleSectionAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2601 static void handleTargetAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2614 static void handleCleanupAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2679 static void handleFormatArgAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2751 static void handleInitPriorityAttr(Sema &S, Decl *D,
2790 FormatAttr *Sema::mergeFormatAttr(Decl *D, SourceRange Range,
2813 static void handleFormatAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2935 static void handleTransparentUnionAttr(Sema &S, Decl *D,
3004 static void handleAnnotateAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3022 static void handleAlignValueAttr(Sema &S, Decl *D,
3028 void Sema::AddAlignValueAttr(SourceRange AttrRange, Decl *D, Expr *E,
3039 llvm_unreachable("Unknown decl type for align_value");
3074 static void handleAlignedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3112 void Sema::AddAlignedAttr(SourceRange AttrRange, Decl *D, Expr *E,
3215 void Sema::AddAlignedAttr(SourceRange AttrRange, Decl *D, TypeSourceInfo *TS,
3225 void Sema::CheckAlignasUnderalignment(Decl *D) {
3226 assert(D->hasAttrs() && "no attributes on decl");
3345 /// handleModeAttr - This attribute modifies the width of a decl with primitive
3348 /// Despite what would be logical, the mode attribute is a decl attribute, not a
3351 static void handleModeAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3479 static void handleNoDebugAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3497 AlwaysInlineAttr *Sema::mergeAlwaysInlineAttr(Decl *D, SourceRange Range,
3513 CommonAttr *Sema::mergeCommonAttr(Decl *D, SourceRange Range,
3523 Sema::mergeInternalLinkageAttr(Decl *D, SourceRange Range,
3529 if (VD->getKind() != Decl::Var) {
3549 MinSizeAttr *Sema::mergeMinSizeAttr(Decl *D, SourceRange Range,
3563 OptimizeNoneAttr *Sema::mergeOptimizeNoneAttr(Decl *D, SourceRange Range,
3583 static void handleAlwaysInlineAttr(Sema &S, Decl *D,
3595 static void handleMinSizeAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3601 static void handleOptimizeNoneAttr(Sema &S, Decl *D,
3608 static void handleGlobalAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3625 static void handleGNUInlineAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3637 static void handleCallConvAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3641 // in the Decl node for syntactic reasoning, e.g., pretty-printing.
3858 void Sema::AddLaunchBoundsAttr(SourceRange AttrRange, Decl *D, Expr *MaxThreads,
3873 static void handleLaunchBoundsAttr(Sema &S, Decl *D,
3884 static void handleArgumentWithTypeTagAttr(Sema &S, Decl *D,
3929 static void handleTypeTagForDatatypeAttr(Sema &S, Decl *D,
3979 static void handleNSConsumedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
4007 static void handleNSReturnsRetainedAttr(Sema &S, Decl *D,
4120 static void handleObjCReturnsInnerPointerAttr(Sema &S, Decl *D,
4148 static void handleObjCRequiresSuperAttr(Sema &S, Decl *D,
4170 static void handleCFAuditedTransferAttr(Sema &S, Decl *D,
4181 static void handleCFUnknownTransferAttr(Sema &S, Decl *D,
4192 static void handleObjCBridgeAttr(Sema &S, Scope *Sc, Decl *D,
4222 static void handleObjCBridgeMutableAttr(Sema &S, Scope *Sc, Decl *D,
4236 static void handleObjCBridgeRelatedAttr(Sema &S, Scope *Sc, Decl *D,
4254 static void handleObjCDesignatedInitializer(Sema &S, Decl *D,
4272 static void handleObjCRuntimeName(Sema &S, Decl *D,
4288 static void handleObjCBoxable(Sema &S, Decl *D, const AttributeList &Attr) {
4311 static void handleObjCOwnershipAttr(Sema &S, Decl *D,
4319 static void handleObjCPreciseLifetimeAttr(Sema &S, Decl *D,
4364 static void handleUuidAttr(Sema &S, Decl *D, const AttributeList &Attr) {
4409 static void handleMSInheritanceAttr(Sema &S, Decl *D, const AttributeList &Attr) {
4423 static void handleDeclspecThreadAttr(Sema &S, Decl *D,
4442 static void handleARMInterruptAttr(Sema &S, Decl *D,
4471 static void handleMSP430InterruptAttr(Sema &S, Decl *D,
4482 // FIXME: Check for decl - it should be void ()(void).
4507 static void handleMipsInterruptAttr(Sema &S, Decl *D,
4566 static void handleInterruptAttr(Sema &S, Decl *D, const AttributeList &Attr) {
4579 static void handleMips16Attribute(Sema &S, Decl *D, const AttributeList &Attr) {
4587 static void handleAMDGPUNumVGPRAttr(Sema &S, Decl *D,
4600 static void handleAMDGPUNumSGPRAttr(Sema &S, Decl *D,
4613 static void handleX86ForceAlignArgPointerAttr(Sema &S, Decl *D,
4638 DLLImportAttr *Sema::mergeDLLImportAttr(Decl *D, SourceRange Range,
4651 DLLExportAttr *Sema::mergeDLLExportAttr(Decl *D, SourceRange Range,
4664 static void handleDLLAttr(Sema &S, Decl *D, const AttributeList &A) {
4699 Sema::mergeMSInheritanceAttr(Decl *D, SourceRange Range, bool BestCase,
4734 static void handleCapabilityAttr(Sema &S, Decl *D, const AttributeList &Attr) {
4758 static void handleAssertCapabilityAttr(Sema &S, Decl *D,
4765 static void handleAcquireCapabilityAttr(Sema &S, Decl *D,
4777 static void handleTryAcquireCapabilityAttr(Sema &S, Decl *D,
4791 static void handleReleaseCapabilityAttr(Sema &S, Decl *D,
4802 static void handleRequiresCapabilityAttr(Sema &S, Decl *D,
4820 static void handleDeprecatedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
4839 static void handleNoSanitizeAttr(Sema &S, Decl *D, const AttributeList &Attr) {
4863 static void handleNoSanitizeSpecificAttr(Sema &S, Decl *D,
4878 static void handleInternalLinkageAttr(Sema &S, Decl *D,
4889 static bool handleCommonAttributeFeatures(Sema &S, Scope *scope, Decl *D,
4931 /// ProcessDeclAttribute - Apply the specific attribute to the specified decl if
4934 static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
5471 /// ProcessDeclAttributeList - Apply all the decl attributes in the specified
5472 /// attribute list to the specified decl, ignoring any type attributes.
5473 void Sema::ProcessDeclAttributeList(Scope *S, Decl *D,
5536 /// contains any decl attributes that we should warn about.
5554 /// used to build a declaration, complain about any decl attributes
5563 /// DeclClonePragmaWeak - clone existing decl (maybe definition),
5564 /// \#pragma weak needs a non-definition decl and source may not have one.
5616 if (W.getAlias()) { // clone decl, impersonate __attribute(weak,alias(...))
5624 // to insert Decl at TU scope, sorry.
5636 void Sema::ProcessPragmaWeak(Scope *S, Decl *D) {
5664 void Sema::ProcessDeclAttributes(Scope *S, Decl *D, const Declarator &PD) {
5665 // Apply decl attributes from the DeclSpec if present.
5669 // Walk the declarator structure, applying decl attributes that were in a type
5670 // position to the decl itself. This handles cases like:
5672 // when X is a decl attribute.
5677 // Finally, apply any attributes on the decl itself.
5685 static bool isForbiddenTypeAllowed(Sema &S, Decl *decl,
5691 if (!isa<FieldDecl>(decl) && !isa<ObjCPropertyDecl>(decl) &&
5692 !isa<FunctionDecl>(decl))
5700 if ((isa<ObjCIvarDecl>(decl) || isa<ObjCPropertyDecl>(decl))) {
5709 if (S.Context.getSourceManager().isInSystemHeader(decl->getLocation())) {
5721 Decl *decl) {
5723 if (decl && isForbiddenTypeAllowed(S, decl, diag, reason)) {
5725 decl->addAttr(UnavailableAttr::CreateImplicit(S.Context, "", reason,
5730 if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(decl)) {
5747 static bool isDeclDeprecated(Decl *D) {
5755 } while ((D = cast_or_null<Decl>(D->getDeclContext())));
5759 static bool isDeclUnavailable(Decl *D) {
5767 } while ((D = cast_or_null<Decl>(D->getDeclContext())));
5772 Decl *Ctx, const NamedDecl *D,
5886 Decl *Ctx) {
5898 void Sema::PopParsingDeclaration(ParsingDeclState state, Decl *decl) {
5906 if (!decl) return;
5909 // parents. In general, we'll get one pool for the decl spec
5910 // and a child pool for each declarator; in a decl group like:
5913 // we really do need to consider delayed diagnostics from the decl spec
5928 // the decl is invalid.
5929 if (!decl->isInvalidDecl())
5930 handleDelayedAvailabilityCheck(*this, diag, decl);
5934 HandleDelayedAccessCheck(diag, decl);
5938 handleDelayedForbiddenType(*this, diag, decl);
5968 Decl *Ctx = cast<Decl>(getCurLexicalContext());