retdec
expression.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LLVMIR2HLL_IR_EXPRESSION_H
8 #define RETDEC_LLVMIR2HLL_IR_EXPRESSION_H
9 
12 
13 namespace retdec {
14 namespace llvmir2hll {
15 
16 class Type;
17 
23 class Expression: public Value {
24 public:
32  virtual ShPtr<Type> getType() const = 0;
33 
48  virtual void replace(ShPtr<Expression> oldExpr,
49  ShPtr<Expression> newExpr) = 0;
50 
51  static void replaceExpression(ShPtr<Expression> oldExpr,
52  ShPtr<Expression> newExpr);
53 
54 protected:
55  Expression() = default;
56 };
57 
58 } // namespace llvmir2hll
59 } // namespace retdec
60 
61 #endif
A base class of all expressions.
Definition: expression.h:23
virtual ShPtr< Type > getType() const =0
Returns the type of the expression.
static void replaceExpression(ShPtr< Expression > oldExpr, ShPtr< Expression > newExpr)
Replaces oldExpr with newExpr.
Definition: expression.cpp:35
virtual void replace(ShPtr< Expression > oldExpr, ShPtr< Expression > newExpr)=0
Replaces all occurrences of oldExpr with newExpr in the current expression.
A base class of all objects a module can contain.
Definition: value.h:32
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.
A base class of all objects a module can contain.