retdec
break_stmt.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LLVMIR2HLL_IR_BREAK_STMT_H
8 #define RETDEC_LLVMIR2HLL_IR_BREAK_STMT_H
9 
11 
12 namespace retdec {
13 namespace llvmir2hll {
14 
15 class Visitor;
16 
23 class BreakStmt final: public Statement {
24 public:
26 
27  virtual ShPtr<Value> clone() override;
28  virtual bool isEqualTo(ShPtr<Value> otherValue) const override;
29  virtual bool isCompound() override { return false; }
30  virtual void replace(ShPtr<Expression> oldExpr, ShPtr<Expression> newExpr) override;
31  virtual ShPtr<Expression> asExpression() const override;
32 
35  virtual void accept(Visitor *v) override;
37 
38 private:
39  // Since instances are created by calling the static function create(), the
40  // constructor can be private.
42 };
43 
44 } // namespace llvmir2hll
45 } // namespace retdec
46 
47 #endif
Definition: address.h:21
static const uint64_t Undefined
Definition: address.h:47
A break statement to exit a loop or a switch case.
Definition: break_stmt.h:23
static ShPtr< BreakStmt > create(Address a=Address::Undefined)
Creates a new break statement.
Definition: break_stmt.cpp:39
virtual void replace(ShPtr< Expression > oldExpr, ShPtr< Expression > newExpr) override
Replaces all occurrences of oldExpr with newExpr in the current statement.
Definition: break_stmt.cpp:20
virtual bool isEqualTo(ShPtr< Value > otherValue) const override
Returns true if this value is equal to otherValue, false otherwise.
Definition: break_stmt.cpp:16
virtual ShPtr< Value > clone() override
Returns a clone of the value.
Definition: break_stmt.cpp:29
virtual ShPtr< Expression > asExpression() const override
Returns the statement as an expression.
Definition: break_stmt.cpp:24
BreakStmt(Address a=Address::Undefined)
Definition: break_stmt.cpp:14
virtual bool isCompound() override
Returns true if the statement is a compound statement, false otherwise.
Definition: break_stmt.h:29
virtual void accept(Visitor *v) override
Visitor pattern implementation.
Definition: break_stmt.cpp:43
A representation of a program statement.
Definition: statement.h:39
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
A representation of a program statement.