From: Fariborz Jahanian Date: Mon, 11 Oct 2010 22:21:03 +0000 (+0000) Subject: Some refactoring of property rewriting stuff X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8537f7b49402bddeac95893eb711a3912aef3552;p=clang Some refactoring of property rewriting stuff in rewriter. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116254 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Rewrite/RewriteObjC.cpp b/lib/Rewrite/RewriteObjC.cpp index 745b7888d5..339b7d1640 100644 --- a/lib/Rewrite/RewriteObjC.cpp +++ b/lib/Rewrite/RewriteObjC.cpp @@ -5356,12 +5356,9 @@ void RewriteObjC::CollectPropertySetters(Stmt *S) { if (BinaryOperator *BinOp = dyn_cast(S)) { if (BinOp->isAssignmentOp()) { - if (ObjCPropertyRefExpr *PRE = - dyn_cast(BinOp->getLHS())) - PropSetters[PRE] = BinOp; - else if (ObjCImplicitSetterGetterRefExpr *ISE = - dyn_cast(BinOp->getLHS())) - PropSetters[ISE] = BinOp; + if (isa(BinOp->getLHS()) || + isa(BinOp->getLHS())) + PropSetters[BinOp->getLHS()] = BinOp; } } } @@ -5402,18 +5399,15 @@ Stmt *RewriteObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) { // 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(S)) - if (PropSetters[PRE]) { - ++CI; - continue; - } - if (ObjCImplicitSetterGetterRefExpr *ISE = - dyn_cast(S)) - if (PropSetters[ISE]) { - ++CI; - continue; + if (Expr *Exp = dyn_cast(S)) + if (isa(Exp) || + isa(Exp)) { + if (PropSetters[Exp]) { + ++CI; + continue; + } } - } + } if (BlockExpr *BE = dyn_cast(S)) { llvm::SmallVector InnerBlockDeclRefs;