CBMC
|
Main driver for working out if a class (normally goto_programt) has any natural loops. More...
#include <natural_loops.h>
Public Types | |
typedef parentt::loopt | natural_loopt |
![]() | |
typedef loop_templatet< T > | loopt |
typedef std::map< T, loopt > | loop_mapt |
Public Member Functions | |
void | operator() (P &program) |
const cfg_dominators_templatet< P, T, false > & | get_dominator_info () const |
natural_loops_templatet () | |
natural_loops_templatet (P &program) | |
![]() | |
virtual void | output (std::ostream &) const |
Print all natural loops that were found. More... | |
bool | is_loop_header (const T instruction) const |
Returns true if instruction is the header of any loop. More... | |
loop_analysist ()=default | |
Protected Types | |
typedef cfg_dominators_templatet< P, T, false >::cfgt::nodet | nodet |
Protected Member Functions | |
void | compute (P &program) |
Finds all back-edges and computes the natural loops. More... | |
void | compute_natural_loop (T, T) |
Computes the natural loop for a given back-edge (see Muchnick section 7.4) More... | |
Protected Attributes | |
cfg_dominators_templatet< P, T, false > | cfg_dominators |
Private Types | |
typedef loop_analysist< T > | parentt |
Additional Inherited Members | |
![]() | |
loop_mapt | loop_map |
Main driver for working out if a class (normally goto_programt) has any natural loops.
compute takes an entire goto_programt, iterates over the instructions and for any backwards jumps attempts to find out if it's a natural loop.
All instructions in a natural loop are stored into loop_map, keyed by their head - the target of the backwards goto jump.
P | the program representation and needs:
|
T | iterator of the particular node type, e.g. std::list<...>::iterator. The object this iterator holds needs:
|
Definition at line 47 of file natural_loops.h.
typedef parentt::loopt natural_loops_templatet< P, T >::natural_loopt |
Definition at line 52 of file natural_loops.h.
|
protected |
Definition at line 75 of file natural_loops.h.
|
private |
Definition at line 49 of file natural_loops.h.
|
inline |
Definition at line 64 of file natural_loops.h.
|
inlineexplicit |
Definition at line 68 of file natural_loops.h.
|
protected |
Finds all back-edges and computes the natural loops.
Definition at line 103 of file natural_loops.h.
|
protected |
Computes the natural loop for a given back-edge (see Muchnick section 7.4)
Definition at line 137 of file natural_loops.h.
|
inline |
Definition at line 59 of file natural_loops.h.
|
inline |
Definition at line 54 of file natural_loops.h.
|
protected |
Definition at line 74 of file natural_loops.h.