Lines Matching defs:AL

1525 static bool checkIBOutletCommon(Sema &S, Decl *D, const ParsedAttr &AL) {
1531 S.Diag(AL.getLoc(), diag::warn_iboutlet_object_type)
1532 << AL << VD->getType() << 0;
1537 S.Diag(AL.getLoc(), diag::warn_iboutlet_object_type)
1538 << AL << PD->getType() << 1;
1542 S.Diag(AL.getLoc(), diag::warn_attribute_iboutlet) << AL;
1549 void SemaObjC::handleIBOutlet(Decl *D, const ParsedAttr &AL) {
1550 if (!checkIBOutletCommon(SemaRef, D, AL))
1553 D->addAttr(::new (getASTContext()) IBOutletAttr(getASTContext(), AL));
1556 void SemaObjC::handleIBOutletCollection(Decl *D, const ParsedAttr &AL) {
1560 if (AL.getNumArgs() > 1) {
1561 Diag(AL.getLoc(), diag::err_attribute_wrong_number_arguments) << AL << 1;
1565 if (!checkIBOutletCommon(SemaRef, D, AL))
1570 if (AL.hasParsedType())
1571 PT = AL.getTypeArg();
1574 Context.Idents.get("NSObject"), AL.getLoc(),
1577 Diag(AL.getLoc(), diag::err_iboutletcollection_type) << "NSObject";
1585 QTLoc = Context.getTrivialTypeSourceInfo(QT, AL.getLoc());
1592 Diag(AL.getLoc(), QT->isBuiltinType()
1599 D->addAttr(::new (Context) IBOutletCollectionAttr(Context, AL, QTLoc));
1602 void SemaObjC::handleSuppresProtocolAttr(Decl *D, const ParsedAttr &AL) {
1604 Diag(AL.getLoc(), diag::err_objc_attr_protocol_requires_definition)
1605 << AL << AL.getRange();
1610 ObjCExplicitProtocolImplAttr(getASTContext(), AL));
1613 void SemaObjC::handleDirectAttr(Decl *D, const ParsedAttr &AL) {
1616 Diag(AL.getLoc(), diag::err_objc_direct_on_protocol) << false;
1621 handleSimpleAttribute<ObjCDirectAttr>(*this, D, AL);
1623 Diag(AL.getLoc(), diag::warn_objc_direct_ignored) << AL;
1627 void SemaObjC::handleDirectMembersAttr(Decl *D, const ParsedAttr &AL) {
1629 handleSimpleAttribute<ObjCDirectMembersAttr>(*this, D, AL);
1631 Diag(AL.getLoc(), diag::warn_objc_direct_ignored) << AL;
1635 void SemaObjC::handleMethodFamilyAttr(Decl *D, const ParsedAttr &AL) {
1637 if (!AL.isArgIdent(0)) {
1638 Diag(AL.getLoc(), diag::err_attribute_argument_n_type)
1639 << AL << 1 << AANT_ArgumentIdentifier;
1643 IdentifierLoc *IL = AL.getArgAsIdent(0);
1646 Diag(IL->Loc, diag::warn_attribute_type_not_supported) << AL << IL->Ident;
1659 ObjCMethodFamilyAttr(getASTContext(), AL, F));
1662 void SemaObjC::handleNSObject(Decl *D, const ParsedAttr &AL) {
1684 D->addAttr(::new (getASTContext()) ObjCNSObjectAttr(getASTContext(), AL));
1687 void SemaObjC::handleIndependentClass(Decl *D, const ParsedAttr &AL) {
1699 ObjCIndependentClassAttr(getASTContext(), AL));
1702 void SemaObjC::handleBlocksAttr(Decl *D, const ParsedAttr &AL) {
1703 if (!AL.isArgIdent(0)) {
1704 Diag(AL.getLoc(), diag::err_attribute_argument_n_type)
1705 << AL << 1 << AANT_ArgumentIdentifier;
1709 IdentifierInfo *II = AL.getArgAsIdent(0)->Ident;
1712 Diag(AL.getLoc(), diag::warn_attribute_type_not_supported) << AL << II;
1716 D->addAttr(::new (getASTContext()) BlocksAttr(getASTContext(), AL, type));
1774 SemaObjC::parsedAttrToRetainOwnershipKind(const ParsedAttr &AL) {
1775 switch (AL.getKind()) {
1818 void SemaObjC::handleXReturnsXRetainedAttr(Decl *D, const ParsedAttr &AL) {
1820 Sema::RetainOwnershipKind K = parsedAttrToRetainOwnershipKind(AL);
1825 (AL.getKind() == ParsedAttr::AT_NSReturnsRetained)) {
1840 << AL << DiagID << AL.getRange();
1843 } else if (AL.isUsedAsTypeAttr()) {
1847 switch (AL.getKind()) {
1864 << AL.getRange() << AL << AL.isRegularKeywordAttribute()
1872 switch (AL.getKind()) {
1901 if (AL.isUsedAsTypeAttr())
1906 << AL << ParmDiagID << AL.getRange();
1915 << AL << SubjectKind << Cf << AL.getRange();
1920 switch (AL.getKind()) {
1924 handleSimpleAttribute<NSReturnsAutoreleasedAttr>(*this, D, AL);
1927 handleSimpleAttribute<CFReturnsNotRetainedAttr>(*this, D, AL);
1930 handleSimpleAttribute<NSReturnsNotRetainedAttr>(*this, D, AL);
1933 handleSimpleAttribute<CFReturnsRetainedAttr>(*this, D, AL);
1936 handleSimpleAttribute<NSReturnsRetainedAttr>(*this, D, AL);
1939 handleSimpleAttribute<OSReturnsRetainedAttr>(*this, D, AL);
1942 handleSimpleAttribute<OSReturnsNotRetainedAttr>(*this, D, AL);
2026 void SemaObjC::handleBridgeAttr(Decl *D, const ParsedAttr &AL) {
2027 IdentifierLoc *Parm = AL.isArgIdent(0) ? AL.getArgAsIdent(0) : nullptr;
2030 Diag(D->getBeginLoc(), diag::err_objc_attr_not_id) << AL << 0;
2037 Diag(AL.getLoc(), diag::err_objc_attr_typedef_not_id) << AL;
2044 Diag(AL.getLoc(), diag::err_objc_attr_typedef_not_void_pointer);
2050 ObjCBridgeAttr(getASTContext(), AL, Parm->Ident));
2053 void SemaObjC::handleBridgeMutableAttr(Decl *D, const ParsedAttr &AL) {
2054 IdentifierLoc *Parm = AL.isArgIdent(0) ? AL.getArgAsIdent(0) : nullptr;
2057 Diag(D->getBeginLoc(), diag::err_objc_attr_not_id) << AL << 0;
2062 ObjCBridgeMutableAttr(getASTContext(), AL, Parm->Ident));
2065 void SemaObjC::handleBridgeRelatedAttr(Decl *D, const ParsedAttr &AL) {
2067 AL.isArgIdent(0) ? AL.getArgAsIdent(0)->Ident : nullptr;
2069 Diag(D->getBeginLoc(), diag::err_objc_attr_not_id) << AL << 0;
2073 AL.getArgAsIdent(1) ? AL.getArgAsIdent(1)->Ident : nullptr;
2075 AL.getArgAsIdent(2) ? AL.getArgAsIdent(2)->Ident : nullptr;
2077 getASTContext(), AL, RelatedClass, ClassMethod, InstanceMethod));
2080 void SemaObjC::handleDesignatedInitializer(Decl *D, const ParsedAttr &AL) {
2103 ObjCDesignatedInitializerAttr(getASTContext(), AL));
2106 void SemaObjC::handleRuntimeName(Decl *D, const ParsedAttr &AL) {
2108 if (!SemaRef.checkStringLiteralArgumentAttr(AL, 0, MetaDataName))
2111 ObjCRuntimeNameAttr(getASTContext(), AL, MetaDataName));
2118 void SemaObjC::handleBoxable(Decl *D, const ParsedAttr &AL) {
2129 ::new (getASTContext()) ObjCBoxableAttr(getASTContext(), AL);
2140 void SemaObjC::handleOwnershipAttr(Decl *D, const ParsedAttr &AL) {
2145 << AL.getRange() << AL << AL.isRegularKeywordAttribute()
2149 void SemaObjC::handlePreciseLifetimeAttr(Decl *D, const ParsedAttr &AL) {
2154 Diag(AL.getLoc(), diag::err_objc_precise_lifetime_bad_type) << QT;
2177 Diag(AL.getLoc(), diag::warn_objc_precise_lifetime_meaningless)
2183 ObjCPreciseLifetimeAttr(getASTContext(), AL));
2223 void SemaObjC::handleExternallyRetainedAttr(Decl *D, const ParsedAttr &AL) {
2234 handleSimpleAttribute<ObjCExternallyRetainedAttr>(*this, D, AL);
2256 handleSimpleAttribute<ObjCExternallyRetainedAttr>(*this, D, AL);