diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-02-29 22:18:55 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-02-29 22:18:55 +0000 |
commit | 77bfb8b43ec3f7dee3a71f6e854b03ad29dab84f (patch) | |
tree | 3f8f072cf0145794270c21859a13d633bbaa4981 /lib/Parse/ParseObjc.cpp | |
parent | fd819783aafa39b3bfdfcc095270352074ef4734 (diff) |
objective-c: provide fixit hint when atomic property does not
have matching user defined setter/getter and a warning is issued.
In this case, a fixit note is displayed. // rdar://10267155
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151766 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r-- | lib/Parse/ParseObjc.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index 27bdd0beb1..b135bba488 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -295,13 +295,15 @@ public: SmallVectorImpl<Decl *> &Props; ObjCDeclSpec &OCDS; SourceLocation AtLoc; + SourceLocation LParenLoc; tok::ObjCKeywordKind MethodImplKind; ObjCPropertyCallback(Parser &P, SmallVectorImpl<Decl *> &Props, ObjCDeclSpec &OCDS, SourceLocation AtLoc, + SourceLocation LParenLoc, tok::ObjCKeywordKind MethodImplKind) : - P(P), Props(Props), OCDS(OCDS), AtLoc(AtLoc), + P(P), Props(Props), OCDS(OCDS), AtLoc(AtLoc), LParenLoc(LParenLoc), MethodImplKind(MethodImplKind) { } @@ -333,7 +335,8 @@ public: FD.D.getIdentifier()); bool isOverridingProperty = false; Decl *Property = - P.Actions.ActOnProperty(P.getCurScope(), AtLoc, FD, OCDS, + P.Actions.ActOnProperty(P.getCurScope(), AtLoc, LParenLoc, + FD, OCDS, GetterSel, SetterSel, &isOverridingProperty, MethodImplKind); @@ -478,12 +481,15 @@ void Parser::ParseObjCInterfaceDeclList(tok::ObjCKeywordKind contextKey, Diag(AtLoc, diag::err_objc_properties_require_objc2); ObjCDeclSpec OCDS; + SourceLocation LParenLoc; // Parse property attribute list, if any. - if (Tok.is(tok::l_paren)) + if (Tok.is(tok::l_paren)) { + LParenLoc = Tok.getLocation(); ParseObjCPropertyAttribute(OCDS); + } ObjCPropertyCallback Callback(*this, allProperties, - OCDS, AtLoc, MethodImplKind); + OCDS, AtLoc, LParenLoc, MethodImplKind); // Parse all the comma separated declarators. DeclSpec DS(AttrFactory); |