retdec
cast_expr.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LLVMIR2HLL_IR_CAST_EXPR_H
8 #define RETDEC_LLVMIR2HLL_IR_CAST_EXPR_H
9 
13 
14 namespace retdec {
15 namespace llvmir2hll {
16 
17 class Expression;
18 class Visitor;
19 
25 class CastExpr: public Expression {
26 public:
27  virtual ShPtr<Type> getType() const override;
28  virtual void replace(ShPtr<Expression> oldExpr,
29  ShPtr<Expression> newExpr) override;
30 
31  void setOperand(ShPtr<Expression> newOp);
33 
36  virtual void update(ShPtr<Value> subject,
37  ShPtr<Value> arg = nullptr) override;
39 
40 protected:
42 
43 protected:
46 
49 };
50 
51 } // namespace llvmir2hll
52 } // namespace retdec
53 
54 #endif
Base class for cast instructions.
Definition: cast_expr.h:25
CastExpr(ShPtr< Expression > op, ShPtr< Type > dstType)
Constructs a cast operator.
Definition: cast_expr.cpp:16
ShPtr< Expression > op
Operand.
Definition: cast_expr.h:45
virtual void update(ShPtr< Value > subject, ShPtr< Value > arg=nullptr) override
Updates the cast according to the changes of subject.
Definition: cast_expr.cpp:75
virtual void replace(ShPtr< Expression > oldExpr, ShPtr< Expression > newExpr) override
Replaces all occurrences of oldExpr with newExpr in the current expression.
Definition: cast_expr.cpp:26
void setOperand(ShPtr< Expression > newOp)
Sets a new operand.
Definition: cast_expr.cpp:42
virtual ShPtr< Type > getType() const override
Returns the type of the expression.
Definition: cast_expr.cpp:22
ShPtr< Type > dstType
Destination type.
Definition: cast_expr.h:48
ShPtr< Expression > getOperand() const
Returns the operand.
Definition: cast_expr.cpp:53
A base class of all expressions.
Definition: expression.h:23
A base class of all expressions.
A base class of all types.
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.