diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2010-10-11 22:21:03 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-10-11 22:21:03 +0000 |
| commit | fef5d16f45e066ddde6046ed398c2a202931e88d (patch) | |
| tree | 856771bfa017155c5d3bd819d6c33bdec4d6666d | |
| parent | b9ab0ed33e0d237bc2b628a30b9fe8cc3c2ea1ed (diff) | |
| download | bcm5719-llvm-fef5d16f45e066ddde6046ed398c2a202931e88d.tar.gz bcm5719-llvm-fef5d16f45e066ddde6046ed398c2a202931e88d.zip | |
Some refactoring of property rewriting stuff
in rewriter. No functionality change.
llvm-svn: 116254
| -rw-r--r-- | clang/lib/Rewrite/RewriteObjC.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/clang/lib/Rewrite/RewriteObjC.cpp b/clang/lib/Rewrite/RewriteObjC.cpp index 745b7888d5e..339b7d16404 100644 --- a/clang/lib/Rewrite/RewriteObjC.cpp +++ b/clang/lib/Rewrite/RewriteObjC.cpp @@ -5356,12 +5356,9 @@ void RewriteObjC::CollectPropertySetters(Stmt *S) { 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 @@ 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<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; |

