7 #ifndef RETDEC_LLVMIR2HLL_IR_IF_STMT_H
8 #define RETDEC_LLVMIR2HLL_IR_IF_STMT_H
static const uint64_t Undefined
Definition: address.h:47
An if/else-if/else statement.
Definition: if_stmt.h:28
clause_iterator clause_end() const
Returns an iterator past the last else-if clause.
Definition: if_stmt.cpp:242
std::list< IfClause > IfClauseList
A list of if clauses.
Definition: if_stmt.h:36
clause_iterator removeClause(clause_iterator clauseIterator)
Removes the given clause, specified by an iterator.
Definition: if_stmt.cpp:163
void removeElseClause()
Removes the else clause (if any).
Definition: if_stmt.cpp:214
bool hasElseIfClauses() const
Returns true if there is at least one else-if clause, false otherwise.
Definition: if_stmt.cpp:130
IfClauseList::const_iterator clause_iterator
Definition: if_stmt.h:42
std::pair< ShPtr< Expression >, ShPtr< Statement > > IfClause
If clause (condition and body).
Definition: if_stmt.h:31
ShPtr< Statement > getFirstIfBody() const
Returns the body of the first if clause in the statement.
Definition: if_stmt.cpp:349
ShPtr< Statement > getElseClause() const
Returns the else clause (if any), the null pointer otherwise.
Definition: if_stmt.cpp:249
bool hasIfClause() const
Returns true if the statement has the if clause, false otherwise.
Definition: if_stmt.cpp:186
bool hasElseClause() const
Returns true if this if statement has an else clause, false otherwise.
Definition: if_stmt.cpp:222
virtual void replace(ShPtr< Expression > oldExpr, ShPtr< Expression > newExpr) override
Replaces all occurrences of oldExpr with newExpr in the current statement.
Definition: if_stmt.cpp:81
clause_iterator clause_begin() const
Returns an iterator to the first if clause (if cond then body).
Definition: if_stmt.cpp:232
virtual bool isEqualTo(ShPtr< Value > otherValue) const override
Returns true if this value is equal to otherValue, false otherwise.
Definition: if_stmt.cpp:50
void setElseClause(ShPtr< Statement > body)
Sets the else clause (else body).
Definition: if_stmt.cpp:197
static ShPtr< IfStmt > create(ShPtr< Expression > cond, ShPtr< Statement > body, ShPtr< Statement > succ=nullptr, Address a=Address::Undefined)
Constructs a new if statement.
Definition: if_stmt.cpp:264
virtual ShPtr< Value > clone() override
Returns a clone of the value.
Definition: if_stmt.cpp:24
void setFirstIfCond(ShPtr< Expression > newCond)
Sets a new condition of the first if clause.
Definition: if_stmt.cpp:362
IfClauseList ifClauseList
A list of if clauses.
Definition: if_stmt.h:92
ShPtr< Statement > elseClause
The else clause (if any).
Definition: if_stmt.h:95
void addClause(ShPtr< Expression > cond, ShPtr< Statement > body)
Adds a new clause ([else] if cond then body).
Definition: if_stmt.cpp:113
IfStmt(ShPtr< Expression > cond, ShPtr< Statement > body, Address a=Address::Undefined)
Constructs a new if/else-if/else statement.
Definition: if_stmt.cpp:21
virtual ShPtr< Expression > asExpression() const override
Returns the statement as an expression.
Definition: if_stmt.cpp:94
bool hasClauses() const
Returns true if there is at least one clause, false otherwise.
Definition: if_stmt.cpp:176
virtual void accept(Visitor *v) override
Visitor pattern implementation.
Definition: if_stmt.cpp:328
void setFirstIfBody(ShPtr< Statement > newBody)
Sets a new body of the first if clause.
Definition: if_stmt.cpp:376
virtual void update(ShPtr< Value > subject, ShPtr< Value > arg=nullptr) override
Updates the statement according to the changes of subject.
Definition: if_stmt.cpp:301
ShPtr< Expression > getFirstIfCond() const
Returns the condition of the first if clause in the statement.
Definition: if_stmt.cpp:337
virtual bool isCompound() override
Returns true if the statement is a compound statement, false otherwise.
Definition: if_stmt.h:50
A representation of a program statement.
Definition: statement.h:39
ShPtr< Statement > succ
Successor statement.
Definition: statement.h:141
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.