A branch instruction is of the form s1!=0 : l1, s2!=0 : l_2 , ... s_k!=0:l_k. More...
#include <Branch.h>
Public Member Functions | |
Branch (Symbol *if_var, Symbol *else_var, Label *then_label, Label *else_label, il::node *original) | |
Branch (vector< pair< Symbol *, Label * > > *targets, il::node *original) | |
virtual string | to_string () const |
virtual string | to_string (bool pretty_print) const |
bool | is_if_statement () |
vector< pair< Symbol *, Label * > > * | get_targets () |
Label * | get_then_label () |
Label * | get_else_label () |
Symbol * | get_if_condition () |
Symbol * | get_else_condition () |
virtual bool | is_removable () |
Friends | |
class | boost::serialization::access |
A branch instruction is of the form s1!=0 : l1, s2!=0 : l_2 , ... s_k!=0:l_k.
Any s_i !=0 and s_j !=0 are mutually exclusive, and the disjunction s_1!=0 | ....|s_k!=0 is always true. The (s_i, l_i) pairs are represented by the vector called targets, i.e. the result of get_targets().
Symbol * sail::Branch::get_else_condition | ( | ) |
Convenience method for branches corresponding to if statements
Label * sail::Branch::get_else_label | ( | ) |
Convenience method for branches corresponding to if statements
Symbol * sail::Branch::get_if_condition | ( | ) |
Convenience method for branches corresponding to if statements
Label * sail::Branch::get_then_label | ( | ) |
Convenience method for branches corresponding to if statements
bool sail::Branch::is_if_statement | ( | ) |
bool sail::Branch::is_removable | ( | ) | [virtual] |
An instruction is removable if it's not present in the original source code, but introduced in the translation from the high-level language to the low-level language. For instance, if **x is an expression used in the original code, the low-level language will introduce a temporary t=*x; such instructions are "removable" for printing purposes.
Implements sail::Instruction.