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