expression, the entire assignment tree is rewritten into a property
setter messaging. This includes rewriting the RHS.
Do not attempt to rewrite RHS again. Never rewrite a rewritten text!
Fixes //rdar: //
8527018.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116104
91177308-0d34-0410-b5e6-
96231b3b80d8
9012911C1048068D0083456D /* ASTUnit.cpp */,
1A2A54A50FD1DD1C00F4CE45 /* ASTConsumers.cpp */,
1A2A54A70FD1DD1C00F4CE45 /* CacheTokens.cpp */,
+ DE4DC7A20EA1C33E00069E5A /* TokenRewriter.cpp */,
1ACB57DB1105820D0047B991 /* CompilerInstance.cpp */,
1ACB57DC1105820D0047B991 /* CompilerInvocation.cpp */,
1ACB57DD1105820D0047B991 /* DeclXML.cpp */,
72D16C1E0D9975C400E6DA4A /* HTMLRewrite.cpp */,
DEF7D9F80C9C8B1D0001F598 /* Rewriter.cpp */,
DECAB0CF0DB3C84200E13CCB /* RewriteRope.cpp */,
- DE4DC7A20EA1C33E00069E5A /* TokenRewriter.cpp */,
);
name = Rewrite;
sourceTree = "<group>";
newStmt = RewriteFunctionBodyOrGlobalInitializer(S);
if (newStmt)
*CI = newStmt;
+ // If dealing with an assignment with LHS being a property reference
+ // expression, the entire assignment tree is rewritten into a property
+ // setter messaging. This involvs the RHS too. Do not attempt to rewrite
+ // RHS again.
+ if (ObjCPropertyRefExpr *PRE = dyn_cast<ObjCPropertyRefExpr>(S))
+ if (PropSetters[PRE]) {
+ ++CI;
+ continue;
+ }
}
if (BlockExpr *BE = dyn_cast<BlockExpr>(S)) {
--- /dev/null
+// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp
+// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp
+// rdar:// 8527018
+
+void *sel_registerName(const char *);
+
+@class NSString;
+@interface CoreDAVDiscoveryAccountInfo {
+ NSString *_scheme;
+}
+@property (retain) NSString *scheme;
+- (void) Meth ;
+@end
+
+@implementation CoreDAVDiscoveryAccountInfo
+@synthesize scheme=_scheme;
+- (void) Meth {
+ CoreDAVDiscoveryAccountInfo *discoveryInfo;
+ discoveryInfo.scheme = @"https";
+}
+@end