retdec
array_index_op_expr.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LLVMIR2HLL_IR_ARRAY_INDEX_OP_EXPR_H
8 #define RETDEC_LLVMIR2HLL_IR_ARRAY_INDEX_OP_EXPR_H
9 
12 
13 namespace retdec {
14 namespace llvmir2hll {
15 
16 class Expression;
17 class Visitor;
18 
27 class ArrayIndexOpExpr final: public BinaryOpExpr {
28 public:
30  ShPtr<Expression> index);
31 
32  virtual ShPtr<Type> getType() const override;
33  virtual bool isEqualTo(ShPtr<Value> otherValue) const override;
34  virtual ShPtr<Value> clone() override;
35 
36  ShPtr<Expression> getBase() const;
38 
41  virtual void accept(Visitor *v) override;
43 
44 private:
45  // Since instances are created by calling the static function create(), the
46  // constructor can be private.
48 };
49 
50 } // namespace llvmir2hll
51 } // namespace retdec
52 
53 #endif
A base class for all binary operators.
An array subscript operator.
Definition: array_index_op_expr.h:27
virtual bool isEqualTo(ShPtr< Value > otherValue) const override
Returns true if this value is equal to otherValue, false otherwise.
Definition: array_index_op_expr.cpp:40
static ShPtr< ArrayIndexOpExpr > create(ShPtr< Expression > base, ShPtr< Expression > index)
Creates a new array subscript operator.
Definition: array_index_op_expr.cpp:81
virtual ShPtr< Type > getType() const override
Returns the type of the expression.
Definition: array_index_op_expr.cpp:25
ShPtr< Expression > getBase() const
Returns the base (i.e. the first operand).
Definition: array_index_op_expr.cpp:59
ArrayIndexOpExpr(ShPtr< Expression > base, ShPtr< Expression > index)
Constructs an array subscript operator.
Definition: array_index_op_expr.cpp:22
virtual ShPtr< Value > clone() override
Returns a clone of the value.
Definition: array_index_op_expr.cpp:49
virtual void accept(Visitor *v) override
Visitor pattern implementation.
Definition: array_index_op_expr.cpp:96
ShPtr< Expression > getIndex() const
Returns the index (i.e. the second operand).
Definition: array_index_op_expr.cpp:66
A base class for all binary operators.
Definition: binary_op_expr.h:21
A base class of all visitors.
Definition: visitor.h:95
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.