2 * This file is part of the LibreOffice project.
6 * This file is distributed under the University of Illinois Open Source
7 * License. See LICENSE.TXT for details.
11 #ifndef POSTFIXINCREMENTFIX_H
12 #define POSTFIXINCREMENTFIX_H
19 class PostfixIncrementFix
20 : public RecursiveASTVisitor
< PostfixIncrementFix
>
21 , public RewritePlugin
24 explicit PostfixIncrementFix( CompilerInstance
& compiler
, Rewriter
& rewriter
);
25 virtual void run() override
;
26 bool VisitFunctionDecl( const FunctionDecl
* declaration
);
28 typedef std::vector
< const Stmt
* > StmtParents
;
29 void fixPostfixOperator( const CXXOperatorCallExpr
* op
, StmtParents
& parents
);
30 void fixPostfixOperators( const Stmt
* stmt
, StmtParents
& parents
);
31 bool canChangePostfixToPrefix( const CXXOperatorCallExpr
* op
, StmtParents
& parents
, int parent_pos
);
32 bool canChangeInConditionStatement( const CXXOperatorCallExpr
* op
, const Expr
* condition
,
33 const StmtParents
& parents
, unsigned int parent_pos
);
34 bool shouldDoChange( const Expr
* op
);
39 #endif // POSTFIXINCREMENTFIX_H