[cfe-commits] r116254 - /cfe/trunk/lib/Rewrite/RewriteObjC.cpp

Fariborz Jahanian fjahanian at apple.com
Mon Oct 11 15:21:03 PDT 2010


Author: fjahanian
Date: Mon Oct 11 17:21:03 2010
New Revision: 116254

URL: http://llvm.org/viewvc/llvm-project?rev=116254&view=rev
Log:
Some refactoring of property rewriting stuff 
in rewriter. No functionality change.

Modified:
    cfe/trunk/lib/Rewrite/RewriteObjC.cpp

Modified: cfe/trunk/lib/Rewrite/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/RewriteObjC.cpp?rev=116254&r1=116253&r2=116254&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Rewrite/RewriteObjC.cpp Mon Oct 11 17:21:03 2010
@@ -5356,12 +5356,9 @@
 
   if (BinaryOperator *BinOp = dyn_cast<BinaryOperator>(S)) {
     if (BinOp->isAssignmentOp()) {
-      if (ObjCPropertyRefExpr *PRE = 
-            dyn_cast<ObjCPropertyRefExpr>(BinOp->getLHS()))
-        PropSetters[PRE] = BinOp;
-      else if (ObjCImplicitSetterGetterRefExpr *ISE = 
-                dyn_cast<ObjCImplicitSetterGetterRefExpr>(BinOp->getLHS()))
-        PropSetters[ISE] = BinOp;
+        if (isa<ObjCPropertyRefExpr>(BinOp->getLHS()) || 
+            isa<ObjCImplicitSetterGetterRefExpr>(BinOp->getLHS()))
+          PropSetters[BinOp->getLHS()] = BinOp;
     }
   }
 }
@@ -5402,18 +5399,15 @@
       // 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 (ObjCImplicitSetterGetterRefExpr *ISE = 
-            dyn_cast<ObjCImplicitSetterGetterRefExpr>(S))
-        if (PropSetters[ISE]) {
-          ++CI;
-          continue;
+      if (Expr *Exp = dyn_cast<Expr>(S))
+        if (isa<ObjCPropertyRefExpr>(Exp) || 
+            isa<ObjCImplicitSetterGetterRefExpr>(Exp)) {
+          if (PropSetters[Exp]) {
+            ++CI;
+            continue;
+          }
         }
-    }
+      }
 
   if (BlockExpr *BE = dyn_cast<BlockExpr>(S)) {
     llvm::SmallVector<BlockDeclRefExpr *, 8> InnerBlockDeclRefs;





More information about the cfe-commits mailing list