retdec
|
A pattern that is composed of zero or more statements. More...
#include <stmts_pattern.h>
Public Types | |
using | stmt_iterator = StmtVector::const_iterator |
Iterator over statements. More... | |
Public Member Functions | |
virtual void | print (llvm::raw_ostream &os, const std::string &indentation="") const override |
Prints the pattern to stream os, each line indented with indentation. More... | |
Statement Accessors | |
bool | isEmpty () const |
Returns true if the pattern is empty, false otherwise. More... | |
void | addStmt (ShPtr< Statement > stmt) |
Adds a new statement into the pattern. More... | |
StmtVector::size_type | getNumOfStmts () const |
Returns the number of statements in the pattern. More... | |
stmt_iterator | stmt_begin () const |
Returns an iterator to the first statement in the pattern. More... | |
stmt_iterator | stmt_end () const |
Returns an iterator past the last statement in the pattern. More... | |
![]() | |
virtual | ~Pattern ()=default |
Static Public Member Functions | |
static ShPtr< StmtsPattern > | create () |
Creates an empty pattern. More... | |
static ShPtr< StmtsPattern > | create (ShPtr< Statement > stmt) |
Creates a pattern containing stmt. More... | |
Protected Member Functions | |
StmtsPattern () | |
Constructs an empty pattern. More... | |
StmtsPattern (ShPtr< Statement > stmt) | |
Constructs a pattern containing stmt. More... | |
![]() | |
Pattern ()=default | |
Protected Attributes | |
StmtVector | stmts |
Statements that form the pattern. More... | |
A pattern that is composed of zero or more statements.
Use create() to create instances of this class.
using retdec::llvmir2hll::StmtsPattern::stmt_iterator = StmtVector::const_iterator |
Iterator over statements.
|
protected |
Constructs an empty pattern.
Constructs a pattern containing stmt.
Adds a new statement into the pattern.
Iterators returned by stmt_begin() and stmt_end() may be invalidated after this call.
|
static |
Creates an empty pattern.
|
static |
Creates a pattern containing stmt.
StmtVector::size_type retdec::llvmir2hll::StmtsPattern::getNumOfStmts | ( | ) | const |
Returns the number of statements in the pattern.
bool retdec::llvmir2hll::StmtsPattern::isEmpty | ( | ) | const |
Returns true
if the pattern is empty, false
otherwise.
Empty means that the pattern is composed of no statements. This means that isEmpty() returns true
if and only if getNumOfStmts() returns a non-zero number.
|
overridevirtual |
Prints the pattern to stream os, each line indented with indentation.
The pattern may span over multiple lines. When the pattern is empty, nothing should be printed. If the pattern is non-empty, the output is ended with a new line.
Implements retdec::llvmir2hll::Pattern.
StmtsPattern::stmt_iterator retdec::llvmir2hll::StmtsPattern::stmt_begin | ( | ) | const |
Returns an iterator to the first statement in the pattern.
The returned iterator is a constant iterator so there is no way of modifying the pattern during iterator.
StmtsPattern::stmt_iterator retdec::llvmir2hll::StmtsPattern::stmt_end | ( | ) | const |
Returns an iterator past the last statement in the pattern.
The returned iterator is a constant iterator so there is no way of modifying the pattern during iterator.
|
protected |
Statements that form the pattern.