diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-06-20 00:31:37 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-06-20 07:21:31 +0200 |
commit | 81b58bb075313ce5cb7268fa3427d977e4b2692c (patch) | |
tree | 8e979801aeb05aade5d0c96ee26f17adf1670c23 /compilerplugins/clang/postfixincrementfix.hxx | |
parent | ade47d3d67635baf9580da797370fd0e3d395b5a (diff) |
simplify postfixincrementfix plugin using parentStmt()
Change-Id: I93fa422afe7f3e1e10576dd64af9d57b2302f44e
Diffstat (limited to 'compilerplugins/clang/postfixincrementfix.hxx')
-rw-r--r-- | compilerplugins/clang/postfixincrementfix.hxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/compilerplugins/clang/postfixincrementfix.hxx b/compilerplugins/clang/postfixincrementfix.hxx index 29756cf690c6..e357f9941caa 100644 --- a/compilerplugins/clang/postfixincrementfix.hxx +++ b/compilerplugins/clang/postfixincrementfix.hxx @@ -23,14 +23,11 @@ class PostfixIncrementFix public: explicit PostfixIncrementFix( CompilerInstance& compiler, Rewriter& rewriter ); virtual void run() override; - bool VisitFunctionDecl( const FunctionDecl* declaration ); + bool VisitCXXOperatorCallExpr( const CXXOperatorCallExpr* op ); private: - typedef std::vector< const Stmt* > StmtParents; - void fixPostfixOperator( const CXXOperatorCallExpr* op, StmtParents& parents ); - void fixPostfixOperators( const Stmt* stmt, StmtParents& parents ); - bool canChangePostfixToPrefix( const CXXOperatorCallExpr* op, StmtParents& parents, int parent_pos ); - bool canChangeInConditionStatement( const CXXOperatorCallExpr* op, const Expr* condition, - const StmtParents& parents, unsigned int parent_pos ); + void fixPostfixOperator( const CXXOperatorCallExpr* op ); + void fixPostfixOperators( const Stmt* stmt ); + bool canChangePostfixToPrefix( const Stmt* stmt, const CXXOperatorCallExpr* op ); bool shouldDoChange( const Expr* op ); }; |