diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-01-03 18:45:41 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-01-03 18:45:41 +0000 |
commit | e23dcf3524fe01208cc79e707412f0a5dd8eed7b (patch) | |
tree | 768da1bb1093cbde7fb60a7ca725a62790e00470 /lib | |
parent | 94ad28b31433058445a27db722f60402ee820bea (diff) |
objc: introduce objc_suppress_autosynthesis class
attributes for later use.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147457 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/AttributeList.cpp | 1 | ||||
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/Sema/AttributeList.cpp b/lib/Sema/AttributeList.cpp index 13a0edec28..a8ccbb1f56 100644 --- a/lib/Sema/AttributeList.cpp +++ b/lib/Sema/AttributeList.cpp @@ -108,6 +108,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo *Name) { .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) diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 1626bf14b6..4074afee1c 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -1579,6 +1579,18 @@ static void handleArcWeakrefUnavailableAttr(Sema &S, Decl *D, 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(); @@ -3603,6 +3615,9 @@ static void ProcessInheritableDeclAttr(Sema &S, Scope *scope, Decl *D, 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); |