Conditional branching.
More...
#include <cjump.hh>
Public Types |
enum | Relop {
eq,
ne,
lt,
gt,
le,
ge,
ult,
ule,
ugt,
uge
} |
| Comparison of the condition. More...
|
|
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...
|
Private Attributes |
Relop | relop_ |
| The comparison operator.
|
Detailed Description
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 |
|
Comparison of the condition.
- Enumerator:
eq |
|
ne |
|
lt |
|
gt |
|
le |
|
ge |
|
ult |
|
ule |
|
ugt |
|
uge |
|
Constructor & Destructor Documentation
tree::Cjump::Cjump |
( |
Relop |
relop, |
|
|
const rExp & |
left, |
|
|
const rExp & |
right, |
|
|
const rName & |
iftrue, |
|
|
const rName & |
iffalse |
|
) |
| |
|
inline |
Construct a conditional jump.
- Parameters
-
relop | Comparison operator |
left | Left operand |
right | Right operand |
iftrue | Destination label in case of positive test |
iffalse | Destination label in case of negative test |
References tree::Tree::child_push_back().
Member Function Documentation
void tree::Tree::asm_set |
( |
const temp::Temp & |
temp | ) |
|
|
inlineinherited |
rTree & tree::Tree::child_get |
( |
int |
nth | ) |
|
|
inlineinherited |
References tree::Tree::children_, and postcondition.
Referenced by tree::Move::dst_get(), tree::Sxp::exp_get(), tree::Jump::exp_get(), tree::Mem::exp_get(), tree::Eseq::exp_get(), flip(), label_false_get(), tree::Jump::label_get(), label_true_get(), tree::Binop::left_get(), left_get(), tree::Tree::left_get(), tree::Binop::right_get(), right_get(), tree::Tree::right_get(), tree::Move::src_get(), and tree::Eseq::stm_get().
rTree tree::Tree::child_get |
( |
int |
nth | ) |
const |
|
inlineinherited |
void tree::Tree::child_push_back |
( |
const rTree & |
tree | ) |
|
|
inlineinherited |
std::ostream & tree::Tree::dump |
( |
std::ostream & |
o | ) |
const |
|
virtualinherited |
void tree::Cjump::flip |
( |
| ) |
|
|
inline |
Flip the test/destinations of this CJump.
References tree::Tree::child_get(), tree::Tree::children_, eq, ge, gt, le, lt, ne, precondition, relop_, uge, ugt, ule, and ult.
void tree::Cjump::label_false_set |
( |
const temp::Label & |
false_label | ) |
|
|
inline |
rExp tree::Cjump::left_get |
( |
| ) |
const |
|
inline |
rTree & tree::Tree::left_get |
( |
| ) |
|
|
inlineinherited |
Tree * tree::Tree::parent_get |
( |
| ) |
|
|
inlineinherited |
const Tree * tree::Tree::parent_get |
( |
| ) |
const |
|
inlineinherited |
void tree::Tree::parent_get_assert |
( |
| ) |
const |
|
inherited |
void tree::Tree::parent_set |
( |
Tree * |
parent | ) |
|
|
inlineinherited |
bool tree::Tree::reducible_get |
( |
| ) |
const |
|
inlineinherited |
void tree::Tree::reducible_set |
( |
bool |
b | ) |
|
|
inlineinherited |
Comparison operator.
References relop_.
void tree::Tree::replace_by |
( |
const rTree & |
tree | ) |
|
|
inherited |
rExp tree::Cjump::right_get |
( |
| ) |
const |
|
inline |
rTree & tree::Tree::right_get |
( |
| ) |
|
|
inlineinherited |
void * tree::Tree::state_get |
( |
| ) |
const |
|
inlineinherited |
void *& tree::Tree::state_get |
( |
| ) |
|
|
inlineinherited |
std::ostream & tree::Cjump::tag_print |
( |
std::ostream & |
o | ) |
const |
|
overridevirtual |
Report on o the kind of this instruction.
Implements tree::Tree.
References relop_.
Member Data Documentation
Tree* tree::Tree::parent_ = nullptr |
|
protectedinherited |
bool tree::Tree::reducible_ = true |
|
protectedinherited |
Relop tree::Cjump::relop_ |
|
private |
void* tree::Tree::state_ = nullptr |
|
protectedinherited |
The documentation for this class was generated from the following files: