From 07acdf4c776fd98e315bc1de380af8ba3c25559e Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Fri, 24 Sep 2010 18:36:58 +0000 Subject: [PATCH] Fix rewriting of property declared in @protocol's. Fixed //rdar://8472487. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114741 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Rewrite/RewriteObjC.cpp | 4 ++++ test/Rewriter/rewrite-protocol-qualified.mm | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp index 578a063614..dd6cf93a39 100644 --- a/lib/Rewrite/RewriteObjC.cpp +++ b/lib/Rewrite/RewriteObjC.cpp @@ -962,6 +962,10 @@ void RewriteObjC::RewriteProtocolDecl(ObjCProtocolDecl *PDecl) { I != E; ++I) RewriteMethodDeclaration(*I); + for (ObjCInterfaceDecl::prop_iterator I = PDecl->prop_begin(), + E = PDecl->prop_end(); I != E; ++I) + RewriteProperty(*I); + // Lastly, comment out the @end. SourceLocation LocEnd = PDecl->getAtEndRange().getBegin(); ReplaceText(LocEnd, strlen("@end"), "/* @end */"); diff --git a/test/Rewriter/rewrite-protocol-qualified.mm b/test/Rewriter/rewrite-protocol-qualified.mm index 5f12010afd..671aa6b08a 100644 --- a/test/Rewriter/rewrite-protocol-qualified.mm +++ b/test/Rewriter/rewrite-protocol-qualified.mm @@ -30,3 +30,12 @@ void f() { id a; id b = bar((id )a); } + +// rdar://8472487 +@protocol NSObject @end +@class NSRunLoop; + +@protocol CoreDAVTaskManager + @property (retain) NSRunLoop *workRunLoop; +@end + -- 2.40.0