#include <tree.hh>
Private Member Functions |
void | child_set (rTree &dst, const rTree &src) |
Friends |
std::ostream & | operator<< (std::ostream &ostr, const Tree &tree) |
| Print t on o.
|
Kinds of Tree nodes. |
enum | kind_tree_type {
const_kind,
name_kind,
temp_kind,
binop_kind,
mem_kind,
call_kind,
eseq_kind,
move_kind,
sxp_kind,
jump_kind,
cjump_kind,
seq_kind,
label_kind
} |
| The kinds of Tree instuctions. More...
|
virtual kind_tree_type | kind_get () const =0 |
| The kind of this instruction.
|
Member Enumeration Documentation
The kinds of Tree instuctions.
These flags are used to facilitate the pattern matching during instruction selection. This method is not very clean nevertheless this way is cleaner and more efficient than the use of dynamic_cast<>().
- Enumerator:
const_kind |
|
name_kind |
|
temp_kind |
|
binop_kind |
|
mem_kind |
|
call_kind |
|
eseq_kind |
|
move_kind |
|
sxp_kind |
|
jump_kind |
|
cjump_kind |
|
seq_kind |
|
label_kind |
|
Constructor & Destructor Documentation
A new node with these children.
Recursively destroy the children.
References temp_.
Member Function Documentation
void tree::Tree::asm_set |
( |
const temp::Temp & |
temp | ) |
|
|
inline |
rTree & tree::Tree::child_get |
( |
int |
nth | ) |
|
|
inline |
References children_, and postcondition.
Referenced by tree::Move::dst_get(), tree::Sxp::exp_get(), tree::Mem::exp_get(), tree::Jump::exp_get(), tree::Eseq::exp_get(), tree::Cjump::flip(), tree::Cjump::label_false_get(), tree::Jump::label_get(), tree::Cjump::label_true_get(), tree::Binop::left_get(), tree::Cjump::left_get(), left_get(), tree::Binop::right_get(), tree::Cjump::right_get(), right_get(), tree::Move::src_get(), and tree::Eseq::stm_get().
rTree tree::Tree::child_get |
( |
int |
nth | ) |
const |
|
inline |
void tree::Tree::child_push_back |
( |
const rTree & |
tree | ) |
|
|
inline |
void tree::Tree::child_set |
( |
rTree & |
dst, |
|
|
const rTree & |
src |
|
) |
| |
|
inlineprivate |
std::ostream & tree::Tree::dump |
( |
std::ostream & |
o | ) |
const |
|
virtual |
The kind of this instruction.
Implemented in tree::Cjump, tree::Binop, tree::Seq, tree::Jump, tree::Eseq, tree::Move, tree::Mem, tree::Sxp, tree::Temp, tree::Call, tree::Label, tree::Name, and tree::Const.
rTree & tree::Tree::left_get |
( |
| ) |
|
|
inline |
Tree * tree::Tree::parent_get |
( |
| ) |
|
|
inline |
const Tree * tree::Tree::parent_get |
( |
| ) |
const |
|
inline |
void tree::Tree::parent_get_assert |
( |
| ) |
const |
void tree::Tree::parent_set |
( |
Tree * |
parent | ) |
|
|
inline |
bool tree::Tree::reducible_get |
( |
| ) |
const |
|
inline |
void tree::Tree::reducible_set |
( |
bool |
b | ) |
|
|
inline |
void tree::Tree::replace_by |
( |
const rTree & |
tree | ) |
|
rTree & tree::Tree::right_get |
( |
| ) |
|
|
inline |
void * tree::Tree::state_get |
( |
| ) |
const |
|
inline |
void *& tree::Tree::state_get |
( |
| ) |
|
|
inline |
virtual std::ostream& tree::Tree::tag_print |
( |
std::ostream & |
o | ) |
const |
|
pure virtual |
Report on o the kind of this instruction.
Implemented in tree::Cjump, tree::Binop, tree::Seq, tree::Jump, tree::Eseq, tree::Move, tree::Mem, tree::Sxp, tree::Temp, tree::Call, tree::Label, tree::Name, and tree::Const.
Referenced by dump().
Friends And Related Function Documentation
std::ostream& operator<< |
( |
std::ostream & |
ostr, |
|
|
const Tree & |
tree |
|
) |
| |
|
friend |
Member Data Documentation
Tree* tree::Tree::parent_ = nullptr |
|
protected |
bool tree::Tree::reducible_ = true |
|
protected |
void* tree::Tree::state_ = nullptr |
|
protected |
The documentation for this class was generated from the following files: