Code Listener
[unstable] git snapshot
|
Basic block - a single node in ControlFlow graph. More...
#include <storage.hh>
Public Types | |
typedef TList::const_iterator | const_iterator |
typedef const_iterator | iterator |
Public Member Functions | |
Block () | |
constructor useful to place objects into std::vector, but do not try to call append() on objects constructed this way. More... | |
Block (ControlFlow *cfg, const char *name) | |
created a named basic block More... | |
const std::string & | name () const |
return name of the basic block More... | |
void | append (Insn *insn) |
append a given instruction to end of the block More... | |
void | appendPredecessor (Block *) |
const TTargetList & | targets () const |
return list of all direct successors More... | |
const TTargetList & | inbound () const |
return list of all direct predecessors More... | |
const_iterator | begin () const |
return STL-like iterator to go through all the instructions inside More... | |
const_iterator | end () const |
return STL-like iterator to go through all the instructions inside More... | |
const Insn * | front () const |
return the first instruction in the basic block More... | |
const Insn * | back () const |
return the last instruction in the basic block More... | |
size_t | size () const |
return count of instructions inside the basic block More... | |
const Insn * | operator[] (unsigned idx) const |
direct access to instruction by its index. More... | |
const ControlFlow * | cfg () const |
return the ControlFlow object which the Block belongs to More... | |
bool | isLoopEntry () const |
return true, if a loop at the level of CFG starts with this block More... | |
Private Types | |
typedef const Insn * | TList |
Private Attributes | |
TList | insns_ |
TTargetList | inbound_ |
ControlFlow * | cfg_ |
std::string | name_ |
Basic block - a single node in ControlFlow graph.
Once the basic block is ready, it contains (possibly empty) sequence of non-terminating instructions and exactly one terminating instruction.
Definition at line 439 of file storage.hh.
typedef TList::const_iterator const_iterator |
Definition at line 444 of file storage.hh.
typedef const_iterator iterator |
Definition at line 445 of file storage.hh.
Definition at line 441 of file storage.hh.
|
inline |
constructor useful to place objects into std::vector, but do not try to call append() on objects constructed this way.
It would crash on a NULL pointer dereference.
Definition at line 453 of file storage.hh.
|
inline |
created a named basic block
cfg | pointer to control flow graph where the block belongs to |
name | name of the basic block being constructed (zero ended C string) |
Definition at line 464 of file storage.hh.
void append | ( | Insn * | insn) |
append a given instruction to end of the block
insn | Instruction to append. |
void appendPredecessor | ( | Block * | ) |
const Insn* back | ( | ) | const |
return the last instruction in the basic block
|
inline |
return STL-like iterator to go through all the instructions inside
Definition at line 501 of file storage.hh.
References Block::insns_.
Referenced by ControlFlow::begin().
|
inline |
return the ControlFlow object which the Block belongs to
Definition at line 535 of file storage.hh.
References Block::cfg_.
|
inline |
return STL-like iterator to go through all the instructions inside
Definition at line 506 of file storage.hh.
References Block::insns_.
Referenced by ControlFlow::end().
const Insn* front | ( | ) | const |
return the first instruction in the basic block
|
inline |
return list of all direct predecessors
Definition at line 496 of file storage.hh.
References Block::inbound_.
bool isLoopEntry | ( | ) | const |
return true, if a loop at the level of CFG starts with this block
|
inline |
|
inline |
direct access to instruction by its index.
idx | Index of instruction to access (staring with zero). |
Definition at line 530 of file storage.hh.
References Block::insns_.
|
inline |
return count of instructions inside the basic block
Definition at line 523 of file storage.hh.
References Block::insns_.
Referenced by ControlFlow::size().
const TTargetList& targets | ( | ) | const |
return list of all direct successors
|
private |
Definition at line 543 of file storage.hh.
Referenced by Block::cfg().
|
private |
Definition at line 542 of file storage.hh.
Referenced by Block::inbound().
|
private |
Definition at line 541 of file storage.hh.
Referenced by Block::begin(), Block::end(), Block::operator[](), and Block::size().
|
private |
Definition at line 544 of file storage.hh.
Referenced by Block::name().