retdec
unary_op_expr.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LLVMIR2HLL_IR_UNARY_OP_EXPR_H
8 #define RETDEC_LLVMIR2HLL_IR_UNARY_OP_EXPR_H
9 
12 
13 namespace retdec {
14 namespace llvmir2hll {
15 
21 class UnaryOpExpr: public Expression {
22 public:
23  virtual ShPtr<Type> getType() const override;
24  virtual void replace(ShPtr<Expression> oldExpr,
25  ShPtr<Expression> newExpr) override;
26 
28 
29  void setOperand(ShPtr<Expression> newOp);
30 
33  virtual void update(ShPtr<Value> subject,
34  ShPtr<Value> arg = nullptr) override;
36 
37 protected:
39 
40 protected:
43 };
44 
45 } // namespace llvmir2hll
46 } // namespace retdec
47 
48 #endif
A base class of all expressions.
Definition: expression.h:23
A base class for all unary operators.
Definition: unary_op_expr.h:21
virtual void replace(ShPtr< Expression > oldExpr, ShPtr< Expression > newExpr) override
Replaces all occurrences of oldExpr with newExpr in the current expression.
Definition: unary_op_expr.cpp:30
ShPtr< Expression > op
Operand.
Definition: unary_op_expr.h:42
virtual ShPtr< Type > getType() const override
Returns the type of the expression.
Definition: unary_op_expr.cpp:26
void setOperand(ShPtr< Expression > newOp)
Sets a new operand.
Definition: unary_op_expr.cpp:53
virtual void update(ShPtr< Value > subject, ShPtr< Value > arg=nullptr) override
Updates the operator according to the changes of subject.
Definition: unary_op_expr.cpp:79
ShPtr< Expression > getOperand() const
Returns the operand.
Definition: unary_op_expr.cpp:43
UnaryOpExpr(ShPtr< Expression > op)
Constructs a unary operator.
Definition: unary_op_expr.cpp:21
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.