retdec
binary_op_expr.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LLVMIR2HLL_IR_BINARY_OP_EXPR_H
8 #define RETDEC_LLVMIR2HLL_IR_BINARY_OP_EXPR_H
9 
12 
13 namespace retdec {
14 namespace llvmir2hll {
15 
21 class BinaryOpExpr: public Expression {
22 public:
23  virtual ShPtr<Type> getType() const override;
24  virtual void replace(ShPtr<Expression> oldExpr,
25  ShPtr<Expression> newExpr) override;
26 
29 
32 
35  virtual void update(ShPtr<Value> subject,
36  ShPtr<Value> arg = nullptr) override;
38 
39 protected:
41 
42 protected:
45 
48 };
49 
50 } // namespace llvmir2hll
51 } // namespace retdec
52 
53 #endif
A base class for all binary operators.
Definition: binary_op_expr.h:21
BinaryOpExpr(ShPtr< Expression > op1, ShPtr< Expression > op2)
Constructs a binary operator.
Definition: binary_op_expr.cpp:25
void setFirstOperand(ShPtr< Expression > first)
Sets the first operand.
Definition: binary_op_expr.cpp:99
virtual void update(ShPtr< Value > subject, ShPtr< Value > arg=nullptr) override
Updates the operator according to the changes of subject.
Definition: binary_op_expr.cpp:139
virtual ShPtr< Type > getType() const override
Returns the type of the expression.
Definition: binary_op_expr.cpp:31
ShPtr< Expression > getSecondOperand() const
Returns the second operand.
Definition: binary_op_expr.cpp:89
void setSecondOperand(ShPtr< Expression > second)
Sets the second operand.
Definition: binary_op_expr.cpp:113
virtual void replace(ShPtr< Expression > oldExpr, ShPtr< Expression > newExpr) override
Replaces all occurrences of oldExpr with newExpr in the current expression.
Definition: binary_op_expr.cpp:63
ShPtr< Expression > op1
First operand.
Definition: binary_op_expr.h:44
ShPtr< Expression > getFirstOperand() const
Returns the first operand.
Definition: binary_op_expr.cpp:82
ShPtr< Expression > op2
Second operand.
Definition: binary_op_expr.h:47
A base class of all expressions.
Definition: expression.h:23
A base class of all expressions.
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
Declarations, aliases, macros, etc. for the use of smart pointers.