return false;
}
+ /// isObjCSuppressAutosynthesis - Checks that a class or one of its super
+ /// classes must not be auto-synthesized. Returns true if it must not be.
+ bool isObjCSuppressAutosynthesis() const {
+ const ObjCInterfaceDecl *Class = this;
+ while (Class) {
+ if (Class->hasAttr<ObjCSuppressAutosynthesisAttr>())
+ return true;
+ Class = Class->getSuperClass();
+ }
+ return false;
+ }
+
ObjCIvarDecl *lookupInstanceVariable(IdentifierInfo *IVarName,
ObjCInterfaceDecl *&ClassDeclared);
ObjCIvarDecl *lookupInstanceVariable(IdentifierInfo *IVarName) {
let Spellings = ["objc_arc_weak_reference_unavailable"];
}
+def ObjCSuppressAutosynthesis : InheritableAttr {
+ let Spellings = ["objc_suppress_autosynhesis"];
+}
+
def Unused : InheritableAttr {
let Spellings = ["unused"];
}
.Case("weak", AT_weak)
.Case("weakref", AT_weakref)
.Case("objc_arc_weak_reference_unavailable", AT_arc_weakref_unavailable)
+ .Case("objc_suppress_autosynthesis", AT_objc_suppress_autosynthesis)
.Case("pure", AT_pure)
.Case("mode", AT_mode)
.Case("used", AT_used)
Attr.getRange(), S.Context));
}
+static void handleObjCSuppressAutosynthesisAttr(Sema &S, Decl *D,
+ const AttributeList &Attr) {
+ unsigned NumArgs = Attr.getNumArgs();
+ if (NumArgs > 0) {
+ S.Diag(Attr.getLoc(), diag::err_attribute_too_many_arguments) << 0;
+ return;
+ }
+
+ D->addAttr(::new (S.Context) ObjCSuppressAutosynthesisAttr(
+ Attr.getRange(), S.Context));
+}
+
static void handleAvailabilityAttr(Sema &S, Decl *D,
const AttributeList &Attr) {
IdentifierInfo *Platform = Attr.getParameterName();
case AttributeList::AT_arc_weakref_unavailable:
handleArcWeakrefUnavailableAttr (S, D, Attr);
break;
+ case AttributeList::AT_objc_suppress_autosynthesis:
+ handleObjCSuppressAutosynthesisAttr (S, D, Attr);
+ break;
case AttributeList::AT_unused: handleUnusedAttr (S, D, Attr); break;
case AttributeList::AT_returns_twice:
handleReturnsTwiceAttr(S, D, Attr);