retdec
|
A node of a CFG (represents a basic block). More...
#include <cfg.h>
Public Member Functions | |
Node () | |
Constructs a new node. More... | |
Node (const std::string &label) | |
Constructs a new node with the selected label. More... | |
std::string | getLabel () const |
Returns the node's label. More... | |
Statements Accessors | |
bool | hasStmts () const |
Returns true if the node has some statements, false otherwise. More... | |
std::size_t | getNumberOfStmts () const |
Returns the number of statements in the node. More... | |
void | addStmt (ShPtr< Statement > stmt) |
Adds stmt to the statements in the node. More... | |
void | replaceStmt (ShPtr< Statement > stmt, const StmtVector &stmts) |
Replaces stmt with stmts. More... | |
void | removeStmt (ShPtr< Statement > stmt) |
Removes the given statement from the node. More... | |
stmt_iterator | stmt_begin () const |
Returns an iterator to the first statement in the basic block. More... | |
stmt_iterator | stmt_end () const |
Returns an iterator past the last statement in the basic block. More... | |
stmt_reverse_iterator | stmt_rbegin () const |
Returns a constant reverse iterator to the last statement in the basic block. More... | |
stmt_reverse_iterator | stmt_rend () const |
Returns a constant reverse iterator before the first statement in the basic block. More... | |
Successors Accessors | |
bool | hasSuccs () const |
Returns true if the node has some successors, false otherwise. More... | |
bool | hasSucc (ShPtr< Edge > edge) const |
Returns true if the node has the given successor, false otherwise. More... | |
std::size_t | getNumberOfSuccs () const |
Returns the number of successors. More... | |
void | addSucc (ShPtr< Edge > succ) |
Adds the given successor to the node. More... | |
ShPtr< Edge > | getFirstSucc () const |
Returns the first successor of the node. More... | |
void | removeSucc (ShPtr< Edge > succ) |
Removes the given successor from the node. More... | |
succ_iterator | succ_begin () const |
Returns an iterator to the first edge leaving the node. More... | |
succ_iterator | succ_end () const |
Returns an iterator past the last edge leaving the node. More... | |
Predecessors Accessors | |
bool | hasPreds () const |
Returns true if the node has some predecessors, false otherwise. More... | |
bool | hasPred (ShPtr< Edge > edge) const |
Returns true if the node has the given predecessor, false otherwise. More... | |
std::size_t | getNumberOfPreds () const |
Returns the number of predecessors. More... | |
void | addPred (ShPtr< Edge > pred) |
Adds the given predecessor to the node. More... | |
void | removePred (ShPtr< Edge > succ) |
Removes the given predecessor from the node. More... | |
pred_iterator | pred_begin () const |
Returns an iterator to the first edge entering the node. More... | |
pred_iterator | pred_end () const |
Returns an iterator past the last edge entering the node. More... | |
Private Attributes | |
std::string | label |
Label. More... | |
StmtVector | stmts |
Vector of statements forming a basic block. More... | |
EdgeVector | succs |
Vector of edges leaving the node. More... | |
EdgeVector | preds |
Vector of edges entering the node. More... | |
Friends | |
class | RecursiveCFGBuilder |
class | NonRecursiveCFGBuilder |
Additional Inherited Members | |
![]() | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
NonCopyable ()=default | |
~NonCopyable ()=default | |
A node of a CFG (represents a basic block).
Instances of this class have reference object semantics.
retdec::llvmir2hll::CFG::Node::Node | ( | ) |
Constructs a new node.
|
explicit |
Constructs a new node with the selected label.
Adds the given predecessor to the node.
Adds stmt to the statements in the node.
Adds the given successor to the node.
Returns the first successor of the node.
If there are no successors, the null pointer is returned.
std::string retdec::llvmir2hll::CFG::Node::getLabel | ( | ) | const |
Returns the node's label.
If the node has no label, the label or metadata of its first statement is returned. Otherwise, if the node has no statements, the empty string is returned.
std::size_t retdec::llvmir2hll::CFG::Node::getNumberOfPreds | ( | ) | const |
Returns the number of predecessors.
std::size_t retdec::llvmir2hll::CFG::Node::getNumberOfStmts | ( | ) | const |
Returns the number of statements in the node.
std::size_t retdec::llvmir2hll::CFG::Node::getNumberOfSuccs | ( | ) | const |
Returns the number of successors.
Returns true
if the node has the given predecessor, false
otherwise.
bool retdec::llvmir2hll::CFG::Node::hasPreds | ( | ) | const |
Returns true
if the node has some predecessors, false
otherwise.
bool retdec::llvmir2hll::CFG::Node::hasStmts | ( | ) | const |
Returns true
if the node has some statements, false
otherwise.
Returns true
if the node has the given successor, false
otherwise.
bool retdec::llvmir2hll::CFG::Node::hasSuccs | ( | ) | const |
Returns true
if the node has some successors, false
otherwise.
CFG::pred_iterator retdec::llvmir2hll::CFG::Node::pred_begin | ( | ) | const |
Returns an iterator to the first edge entering the node.
CFG::pred_iterator retdec::llvmir2hll::CFG::Node::pred_end | ( | ) | const |
Returns an iterator past the last edge entering the node.
Removes the given predecessor from the node.
If the given predecessor doesn't exist in the node, this function does nothing.
Removes the given statement from the node.
If there is no such statement in the node, this function does nothing.
Removes the given successor from the node.
If the given successor doesn't exist in the node, this function does nothing.
void retdec::llvmir2hll::CFG::Node::replaceStmt | ( | ShPtr< Statement > | stmt, |
const StmtVector & | stmts | ||
) |
Replaces stmt with stmts.
If stmt does not exist in the node, this function does nothing.
CFG::stmt_iterator retdec::llvmir2hll::CFG::Node::stmt_begin | ( | ) | const |
Returns an iterator to the first statement in the basic block.
CFG::stmt_iterator retdec::llvmir2hll::CFG::Node::stmt_end | ( | ) | const |
Returns an iterator past the last statement in the basic block.
CFG::stmt_reverse_iterator retdec::llvmir2hll::CFG::Node::stmt_rbegin | ( | ) | const |
Returns a constant reverse iterator to the last statement in the basic block.
CFG::stmt_reverse_iterator retdec::llvmir2hll::CFG::Node::stmt_rend | ( | ) | const |
Returns a constant reverse iterator before the first statement in the basic block.
CFG::succ_iterator retdec::llvmir2hll::CFG::Node::succ_begin | ( | ) | const |
Returns an iterator to the first edge leaving the node.
CFG::succ_iterator retdec::llvmir2hll::CFG::Node::succ_end | ( | ) | const |
Returns an iterator past the last edge leaving the node.
|
friend |
|
friend |
|
private |
Label.
|
private |
Vector of edges entering the node.
|
private |
Vector of statements forming a basic block.
|
private |
Vector of edges leaving the node.