7 #ifndef RETDEC_LLVMIR2HLL_IR_SWITCH_STMT_H
8 #define RETDEC_LLVMIR2HLL_IR_SWITCH_STMT_H
static const uint64_t Undefined
Definition: address.h:47
A representation of a program statement.
Definition: statement.h:39
ShPtr< Statement > succ
Successor statement.
Definition: statement.h:141
A switch statement.
Definition: switch_stmt.h:28
virtual ShPtr< Value > clone() override
Returns a clone of the value.
Definition: switch_stmt.cpp:24
ShPtr< Statement > getDefaultClauseBody() const
Returns the body of the default clause.
Definition: switch_stmt.cpp:206
SwitchStmt(ShPtr< Expression > controlExpr, Address a=Address::Undefined)
Constructs a new switch statement.
Definition: switch_stmt.cpp:21
virtual void update(ShPtr< Value > subject, ShPtr< Value > arg=nullptr) override
Updates the operator according to the changes of subject.
Definition: switch_stmt.cpp:338
void setControlExpr(ShPtr< Expression > newExpr)
Sets a new control expression.
Definition: switch_stmt.cpp:183
virtual void accept(Visitor *v) override
Visitor pattern implementation.
Definition: switch_stmt.cpp:368
clause_iterator removeClause(clause_iterator clauseIterator)
Removes the given clause, specified by an iterator.
Definition: switch_stmt.cpp:163
clause_iterator clause_begin() const
Returns an iterator to the first case clause.
Definition: switch_stmt.cpp:280
void addDefaultClause(ShPtr< Statement > body)
Adds a default clause.
Definition: switch_stmt.cpp:229
bool hasDefaultClause() const
Returns true if there is a default clause, false otherwise.
Definition: switch_stmt.cpp:192
ShPtr< Expression > controlExpr
Control expression.
Definition: switch_stmt.h:98
std::pair< ShPtr< Expression >, ShPtr< Statement > > SwitchClause
case clause (condition and body).
Definition: switch_stmt.h:31
void setDefaultClauseBody(ShPtr< Statement > body)
Sets a new body of the default clause.
Definition: switch_stmt.cpp:244
void removeDefaultClause()
Removes the default clause (if any).
Definition: switch_stmt.cpp:265
clause_iterator clause_end() const
Returns an iterator past the last case clause.
Definition: switch_stmt.cpp:288
virtual ShPtr< Expression > asExpression() const override
Returns the statement as an expression.
Definition: switch_stmt.cpp:108
SwitchClauseList::const_iterator clause_iterator
Definition: switch_stmt.h:44
SwitchClauseList switchClauseList
List of case clauses.
Definition: switch_stmt.h:95
static ShPtr< SwitchStmt > create(ShPtr< Expression > controlExpr, ShPtr< Statement > succ=nullptr, Address a=Address::Undefined)
Creates a new switch statement.
Definition: switch_stmt.cpp:302
virtual bool isCompound() override
Returns true if the statement is a compound statement, false otherwise.
Definition: switch_stmt.h:53
std::list< SwitchClause > SwitchClauseList
A list of case clauses.
Definition: switch_stmt.h:36
void addClause(ShPtr< Expression > expr, ShPtr< Statement > body)
Adds a new case clause.
Definition: switch_stmt.cpp:128
virtual bool isEqualTo(ShPtr< Value > otherValue) const override
Returns true if this value is equal to otherValue, false otherwise.
Definition: switch_stmt.cpp:43
virtual void replace(ShPtr< Expression > oldExpr, ShPtr< Expression > newExpr) override
Replaces all occurrences of oldExpr with newExpr in the current statement.
Definition: switch_stmt.cpp:92
ShPtr< Expression > getControlExpr() const
Returns the control expression.
Definition: switch_stmt.cpp:176
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.
A representation of a program statement.