diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-10-08 21:12:22 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-10-08 21:12:22 +0000 |
commit | 90fe4bc75d7fe0a68fd858b278221101787320da (patch) | |
tree | b82edc7af27b6ceda9affe5d6546257fe26daaa2 /lib/Rewrite/RewriteObjC.cpp | |
parent | 642bfaa61870b97afc011681fd71e9c414ba2640 (diff) |
When dealing with an assignment with LHS being a property reference
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
Diffstat (limited to 'lib/Rewrite/RewriteObjC.cpp')
-rw-r--r-- | lib/Rewrite/RewriteObjC.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp index abd46df831..af756c52ef 100644 --- a/lib/Rewrite/RewriteObjC.cpp +++ b/lib/Rewrite/RewriteObjC.cpp @@ -5363,6 +5363,15 @@ Stmt *RewriteObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) { 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)) { |