From: Steve Naroff Date: Thu, 22 May 2008 23:24:08 +0000 (+0000) Subject: Make sure the source location for @property points the the @-sign (not the decl spec). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8442b5cdb76cef3ad88e32d41750914c7b77f588;p=clang Make sure the source location for @property points the the @-sign (not the decl spec). Also added a FIXME related to how we represent @properties in the ObjCInterfaceDecl AST. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51450 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index 4795a464f5..6a07503737 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -280,7 +280,7 @@ void Parser::ParseObjCInterfaceDeclList(DeclTy *interfaceDecl, // FIXME. This is not right! : FD.D.getIdentifier()); DeclTy *Property = Actions.ActOnProperty(CurScope, - DS.getSourceRange().getBegin(), FD, OCDS, + AtLoc, FD, OCDS, GetterSel, SetterSel, MethodImplKind); allProperties.push_back(Property); diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index a0fa6ecb2b..efef3fc1be 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -878,6 +878,10 @@ void Sema::ActOnAtEnd(SourceLocation AtEndLoc, DeclTy *classDecl, MergeProtocolPropertiesIntoClass(I, I); for (ObjCInterfaceDecl::classprop_iterator P = I->classprop_begin(), E = I->classprop_end(); P != E; ++P) { + // FIXME: It would be really nice if we could avoid this. Injecting + // methods into the interface makes it hard to distinguish "real" methods + // from synthesized "property" methods (that aren't in the source). + // This complicicates the rewriter's life. I->addPropertyMethods(Context, *P, insMethods); } I->addMethods(&insMethods[0], insMethods.size(),