7 #ifndef RETDEC_LLVMIR2HLL_IR_TERNARY_OP_EXPR_H
8 #define RETDEC_LLVMIR2HLL_IR_TERNARY_OP_EXPR_H
A base class of all expressions.
Definition: expression.h:23
A ternary operator.
Definition: ternary_op_expr.h:24
virtual void accept(Visitor *v) override
Visitor pattern implementation.
Definition: ternary_op_expr.cpp:201
virtual void replace(ShPtr< Expression > oldExpr, ShPtr< Expression > newExpr) override
Replaces all occurrences of oldExpr with newExpr in the current expression.
Definition: ternary_op_expr.cpp:51
void setFalseValue(ShPtr< Expression > newFalseValue)
Sets the false value.
Definition: ternary_op_expr.cpp:128
virtual bool isEqualTo(ShPtr< Value > otherValue) const override
Returns true if this value is equal to otherValue, false otherwise.
Definition: ternary_op_expr.cpp:33
ShPtr< Expression > falseValue
False value.
Definition: ternary_op_expr.h:68
ShPtr< Expression > cond
Condition.
Definition: ternary_op_expr.h:62
TernaryOpExpr(ShPtr< Expression > cond, ShPtr< Expression > trueValue, ShPtr< Expression > falseValue)
Constructs a ternary operator.
Definition: ternary_op_expr.cpp:20
void setTrueValue(ShPtr< Expression > newTrueValue)
Sets the true value.
Definition: ternary_op_expr.cpp:114
ShPtr< Expression > trueValue
True value.
Definition: ternary_op_expr.h:65
virtual void update(ShPtr< Value > subject, ShPtr< Value > arg=nullptr) override
Updates the operator according to the changes of subject.
Definition: ternary_op_expr.cpp:183
static ShPtr< TernaryOpExpr > create(ShPtr< Expression > cond, ShPtr< Expression > trueValue, ShPtr< Expression > falseValue)
Creates a new ternary operator.
Definition: ternary_op_expr.cpp:148
void setCondition(ShPtr< Expression > newCond)
Sets the condition.
Definition: ternary_op_expr.cpp:100
ShPtr< Expression > getCondition() const
Returns the operator condition.
Definition: ternary_op_expr.cpp:76
ShPtr< Expression > getTrueValue() const
Returns the true value.
Definition: ternary_op_expr.cpp:83
virtual ShPtr< Value > clone() override
Returns a clone of the value.
Definition: ternary_op_expr.cpp:24
virtual ShPtr< Type > getType() const override
Returns the type of the expression.
Definition: ternary_op_expr.cpp:43
ShPtr< Expression > getFalseValue() const
Returns the false value.
Definition: ternary_op_expr.cpp:90
A base class of all visitors.
Definition: visitor.h:95
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.