7 #ifndef RETDEC_LLVMIR2HLL_HLL_COMPOUND_OP_MANAGER_H
8 #define RETDEC_LLVMIR2HLL_HLL_COMPOUND_OP_MANAGER_H
62 virtual std::string
getId()
const = 0;
114 template<
typename ToOptimizeExpr>
117 template<
typename ToOptimizeExpr>
A base class for all binary operators.
Definition: binary_op_expr.h:21
Stores the resulting compound operator.
Definition: compound_op_manager.h:38
CompoundOp(std::string op)
A constructor of a unary compound operator.
Definition: compound_op_manager.cpp:51
const std::string & getOperator() const
Returns the operator.
Definition: compound_op_manager.cpp:73
ShPtr< Expression > operand
The right-hand side operand of a binary operator.
Definition: compound_op_manager.h:53
bool isBinaryOperator() const
Returns true if the operator is binary, false otherwise.
Definition: compound_op_manager.cpp:106
std::string op
The resulting operator.
Definition: compound_op_manager.h:50
bool isUnaryOperator() const
Returns true if the operator is unary, false otherwise.
Definition: compound_op_manager.cpp:95
ShPtr< Expression > getOperand() const
Returns the operand of a binary operator.
Definition: compound_op_manager.cpp:83
A base class for compound operator managers.
Definition: compound_op_manager.h:33
void createResultingUnaryCompoundOp(const std::string &op)
Creates the resulting unary compound operator and saves it into compoundOp.
Definition: compound_op_manager.cpp:287
CompoundOp tryOptimizeToCompoundOp(ShPtr< AssignStmt > stmt)
Tries to optimize stmt to a compound operator.
Definition: compound_op_manager.cpp:124
CompoundOpManager()
Constructs a new base class for compound operator managers.
Definition: compound_op_manager.cpp:113
void createResultingBinaryCompoundOp(const std::string &op, ShPtr< Expression > operand)
Creates the resulting binary compound operator and saves it into compoundOp.
Definition: compound_op_manager.cpp:298
ShPtr< Expression > getNextOpIfSecondOneIsEqWithLhsOfAssign(ShPtr< BinaryOpExpr > expr)
Checks if one of the operands is equal with the saved left-hand side of AssignStmt.
Definition: compound_op_manager.cpp:312
virtual std::string getId() const =0
Returns the ID of the manager.
virtual void visit(ShPtr< GlobalVarDef > varDef) override
Definition: ordered_all_visitor.cpp:95
CompoundOp compoundOp
Resulting operator.
Definition: compound_op_manager.h:129
virtual void optimizeToCompoundOp(ShPtr< AddOpExpr > expr, ShPtr< Expression > operand)
Sets the resulting operator to the default one which is the same like nothing is to be optimized.
Definition: compound_op_manager.cpp:222
void tryOptimizeWhenLeftOperandEqWithLhsOfAssignStmt(ShPtr< ToOptimizeExpr > expr)
Tries to optimize expr to compound operator when left operand is equal with left-hand side of AssignS...
Definition: compound_op_manager.cpp:345
ShPtr< Expression > lhsOfAssignStmt
Saved left-hand side of an assign statement.
Definition: compound_op_manager.h:126
void tryOptimizeWhenOneOfOperandsEqWithLhsOfAssignStmt(ShPtr< ToOptimizeExpr > expr)
Tries to optimize expr to compound operator when one of operands is equal with left-hand side of Assi...
Definition: compound_op_manager.cpp:330
A visitor that visits everything in an ordered way.
Definition: ordered_all_visitor.h:44
virtual void visit(ShPtr< GlobalVarDef > varDef) override
Definition: ordered_all_visitor.cpp:95
A mixin to make classes non-copyable.
Definition: non_copyable.h:27
A library providing API for working with back-end IR.
std::shared_ptr< T > ShPtr
An alias for a shared pointer.
Definition: smart_ptr.h:18
Definition: archive_wrapper.h:19
A mixin to make classes non-copyable.
A visitor that visits everything in an ordered way.
Declarations, aliases, macros, etc. for the use of smart pointers.
Aliases for several useful types.