Home | History | Annotate | Download | only in Sema

Lines Matching refs:decl

10 //  This file implements decl-related attribute processing.
52 static const FunctionType *getFunctionType(const Decl *D,
55 if (const ValueDecl *decl = dyn_cast<ValueDecl>(D))
56 Ty = decl->getType();
57 else if (const FieldDecl *decl = dyn_cast<FieldDecl>(D))
58 Ty = decl->getType();
59 else if (const TypedefNameDecl* decl = dyn_cast<TypedefNameDecl>(D))
60 Ty = decl->getUnderlyingType();
75 /// isFunction - Return true if the given decl has function
77 static bool isFunction(const Decl *D) {
81 /// isFunctionOrMethod - Return true if the given decl has function
84 static bool isFunctionOrMethod(const Decl *D) {
88 /// isFunctionOrMethodOrBlock - Return true if the given decl has function
91 static bool isFunctionOrMethodOrBlock(const Decl *D) {
102 /// Return true if the given decl has a declarator that should have
104 static bool hasDeclarator(const Decl *D) {
110 /// hasFunctionProto - Return true if the given decl has a argument
111 /// information. This decl should have already passed
113 static bool hasFunctionProto(const Decl *D) {
125 static unsigned getFunctionOrMethodNumArgs(const Decl *D) {
133 static QualType getFunctionOrMethodArgType(const Decl *D, unsigned Idx) {
142 static QualType getFunctionOrMethodResultType(const Decl *D) {
148 static bool isFunctionOrMethodVariadic(const Decl *D) {
159 static bool isInstanceMethod(const Decl *D) {
223 /// \brief Check if passed in Decl is a field or potentially shared global var
224 /// \return true if the Decl is a field or potentially shared global variable
226 static bool mayBeSharedVariable(const Decl *D) {
242 /// \brief Check if passed in Decl is a pointer type.
244 /// \return true if the Decl is a pointer type; false otherwise
246 static bool checkIsPointer(Sema &S, const Decl *D, const AttributeList &Attr) {
275 static void checkForLockableRecord(Sema &S, Decl *D, const AttributeList &Attr,
301 static bool checkAttrArgsAreLockableObjs(Sema &S, Decl *D,
353 static void handleGuardedVarAttr(Sema &S, Decl *D, const AttributeList &Attr,
376 static void handleGuardedByAttr(Sema &S, Decl *D, const AttributeList &Attr,
407 static void handleLockableAttr(Sema &S, Decl *D, const AttributeList &Attr,
427 static void handleNoThreadSafetyAttr(Sema &S, Decl *D,
444 static void handleNoAddressSafetyAttr(Sema &S, Decl *D,
461 static void handleAcquireOrderAttr(Sema &S, Decl *D, const AttributeList &Attr,
504 static void handleLockFunAttr(Sema &S, Decl *D, const AttributeList &Attr,
536 static void handleTrylockFunAttr(Sema &S, Decl *D, const AttributeList &Attr,
576 static void handleLocksRequiredAttr(Sema &S, Decl *D, const AttributeList &Attr,
608 static void handleUnlockFunAttr(Sema &S, Decl *D,
633 static void handleLockReturnedAttr(Sema &S, Decl *D,
656 static void handleLocksExcludedAttr(Sema &S, Decl *D,
683 static void handleExtVectorTypeAttr(Sema &S, Scope *scope, Decl *D,
723 // Remember this typedef decl, we will need it later for diagnostics.
728 static void handlePackedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
748 static void handleMsStructAttr(Sema &S, Decl *D, const AttributeList &Attr) {
755 static void handleIBAction(Sema &S, Decl *D, const AttributeList &Attr) {
770 static bool checkIBOutletCommon(Sema &S, Decl *D, const AttributeList &Attr) {
796 static void handleIBOutlet(Sema &S, Decl *D, const AttributeList &Attr) {
807 static void handleIBOutletCollection(Sema &S, Decl *D,
857 static void handleNonNullAttr(Sema &S, Decl *D, const AttributeList &Attr) {
912 // FIXME: Should also highlight argument in decl.
948 static void handleOwnershipAttr(Sema &S, Decl *D, const AttributeList &AL) {
1047 // FIXME: Should also highlight argument in decl.
1123 static void handleWeakRefAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1193 // check for an existing decl?
1201 static void handleAliasAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1229 static void handleNakedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1243 static void handleAlwaysInlineAttr(Sema &S, Decl *D,
1260 static void handleMallocAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1278 static void handleMayAliasAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1286 static void handleNoCommonAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1295 static void handleCommonAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1304 static void handleNoReturnAttr(Sema &S, Decl *D, const AttributeList &attr) {
1328 static void handleAnalyzerNoReturnAttr(Sema &S, Decl *D,
1353 static void handleVecReturnAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1413 static void handleDependencyAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1422 static void handleUnusedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1439 static void handleReturnsTwiceAttr(Sema &S, Decl *D,
1456 static void handleUsedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1477 Decl *D, const AttributeList &Attr) {
1507 static void handleDestructorAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1537 static void handleDeprecatedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1559 static void handleUnavailableAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1580 static void handleArcWeakrefUnavailableAttr(Sema &S, Decl *D,
1592 static void handleObjCRootClassAttr(Sema &S, Decl *D,
1608 static void handleObjCRequiresPropertyDefsAttr(Sema &S, Decl *D,
1625 static void handleAvailabilityAttr(Sema &S, Decl *D,
1685 static void handleVisibilityAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1726 static void handleObjCMethodFamilyAttr(Sema &S, Decl *decl,
1728 ObjCMethodDecl *method = dyn_cast<ObjCMethodDecl>(decl);
1779 static void handleObjCExceptionAttr(Sema &S, Decl *D,
1793 static void handleObjCNSObject(Sema &S, Decl *D, const AttributeList &Attr) {
1819 handleOverloadableAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1833 static void handleBlocksAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1857 static void handleSentinelAttr(Sema &S, Decl *D, const AttributeList &Attr) {
1950 static void handleWarnUnusedResult(Sema &S, Decl *D, const AttributeList &Attr) {
1976 static void handleWeakAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2004 static void handleWeakImportAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2031 static void handleReqdWorkGroupSize(Sema &S, Decl *D,
2054 static void handleSectionAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2087 static void handleNothrowAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2102 static void handleConstAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2117 static void handlePureAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2125 static void handleCleanupAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2187 static void handleFormatArgAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2296 static void handleInitPriorityAttr(Sema &S, Decl *D,
2345 static void handleFormatAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2500 static void handleTransparentUnionAttr(Sema &S, Decl *D,
2567 static void handleAnnotateAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2593 static void handleAlignedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2612 void Sema::AddAlignedAttr(SourceRange AttrRange, Decl *D, Expr *E) {
2641 void Sema::AddAlignedAttr(SourceRange AttrRange, Decl *D, TypeSourceInfo *TS) {
2648 /// handleModeAttr - This attribute modifies the width of a decl with primitive
2651 /// Despite what would be logical, the mode attribute is a decl attribute, not a
2654 static void handleModeAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2818 static void handleNoDebugAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2832 static void handleNoInlineAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2847 static void handleNoInstrumentFunctionAttr(Sema &S, Decl *D,
2864 static void handleConstantAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2884 static void handleDeviceAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2904 static void handleGlobalAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2937 static void handleHostAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2956 static void handleSharedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2975 static void handleGNUInlineAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2995 static void handleCallConvAttr(Sema &S, Decl *D, const AttributeList &Attr) {
2999 // in the Decl node for syntactic reasoning, e.g., pretty-printing.
3055 static void handleOpenCLKernelAttr(Sema &S, Decl *D, const AttributeList &Attr){
3106 static void handleRegparmAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3162 static void handleLaunchBoundsAttr(Sema &S, Decl *D, const AttributeList &Attr){
3222 static void handleNSConsumedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3251 static void handleNSConsumesSelfAttr(Sema &S, Decl *D,
3262 static void handleNSReturnsRetainedAttr(Sema &S, Decl *D,
3333 static void handleObjCReturnsInnerPointerAttr(Sema &S, Decl *D,
3363 static void handleCFTransferAttr(Sema &S, Decl *D, const AttributeList &A) {
3397 static void handleNSBridgedAttr(Sema &S, Scope *Sc, Decl *D,
3427 static void handleObjCOwnershipAttr(Sema &S, Decl *D,
3435 static void handleObjCPreciseLifetimeAttr(Sema &S, Decl *D,
3501 static void handleUuidAttr(Sema &S, Decl *D, const AttributeList &Attr) {
3559 static void ProcessNonInheritableDeclAttr(Sema &S, Scope *scope, Decl *D,
3570 static void ProcessInheritableDeclAttr(Sema &S, Scope *scope, Decl *D,
3798 /// ProcessDeclAttribute - Apply the specific attribute to the specified decl if
3802 static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
3819 /// ProcessDeclAttributeList - Apply all the decl attributes in the specified
3820 /// attribute list to the specified decl, ignoring any type attributes.
3821 void Sema::ProcessDeclAttributeList(Scope *S, Decl *D,
3855 /// contains any decl attributes that we should warn about.
3873 /// used to build a declaration, complain about any decl attributes
3882 /// DeclClonePragmaWeak - clone existing decl (maybe definition),
3883 /// #pragma weak needs a non-definition decl and source may not have one
3938 if (W.getAlias()) { // clone decl, impersonate __attribute(weak,alias(...))
3946 // to insert Decl at TU scope, sorry.
3959 void Sema::ProcessDeclAttributes(Scope *S, Decl *D, const Declarator &PD,
3980 // Apply decl attributes from the DeclSpec if present.
3984 // Walk the declarator structure, applying decl attributes that were in a type
3985 // position to the decl itself. This handles cases like:
3987 // when X is a decl attribute.
3992 // Finally, apply any attributes on the decl itself.
3998 static bool isForbiddenTypeAllowed(Sema &S, Decl *decl) {
4003 if (!isa<FieldDecl>(decl) && !isa<ObjCPropertyDecl>(decl) &&
4004 !isa<FunctionDecl>(decl))
4008 return S.Context.getSourceManager().isInSystemHeader(decl->getLocation());
4013 Decl *decl) {
4014 if (decl && isForbiddenTypeAllowed(S, decl)) {
4015 decl->addAttr(new (S.Context) UnavailableAttr(diag.Loc, S.Context,
4020 if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(decl)) {
4060 Decl *decl) {
4076 // successfully parsed a decl.
4077 if (decl) {
4080 // decl spec and another for each declarator; in a decl group like:
4083 // we really do need to consider delayed diagnostics from the decl spec
4092 // Don't bother giving deprecation diagnostics if the decl is invalid.
4093 if (!decl->isInvalidDecl())
4094 S.HandleDelayedDeprecationCheck(diag, decl);
4098 S.HandleDelayedAccessCheck(diag, decl);
4102 handleDelayedForbiddenType(S, diag, decl);
4115 static bool isDeclDeprecated(Decl *D) {
4122 } while ((D = cast_or_null<Decl>(D->getDeclContext())));
4127 Decl *Ctx) {
4158 if (isDeclDeprecated(cast<Decl>(getCurLexicalContext())))