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 | 9d4d20af55180abca1ecbcebb0710b08d386d281 (patch) | |
tree | cb6a5ca30248d4377164c3e9f1060adc052a9dc5 /clang/lib/Sema/SemaDeclAttr.cpp | |
parent | 2007dc889249c19a6acc97a70604bea0b7f5f992 (diff) | |
download | bcm5719-llvm-9d4d20af55180abca1ecbcebb0710b08d386d281.tar.gz bcm5719-llvm-9d4d20af55180abca1ecbcebb0710b08d386d281.zip |
objc: introduce objc_suppress_autosynthesis class
attributes for later use.
llvm-svn: 147457
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 1626bf14b60..4074afee1cc 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/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); |