An instruction of the form v = s1 binop s2. More...
#include <Binop.h>
Public Member Functions | |
Binop (Variable *v, Symbol *s1, Symbol *s2, il::binop_type binop, il::node *original, int line) | |
virtual string | to_string () const |
virtual string | to_string (bool pretty_print) const |
virtual Variable * | get_lhs () |
virtual void | set_lhs (Variable *v) |
Symbol * | get_first_operand () |
Symbol * | get_second_operand () |
il::binop_type | get_binop () |
virtual bool | is_removable () |
Friends | |
class | boost::serialization::access |
An instruction of the form v = s1 binop s2.
Different binop's are identified by the enum il::binop_type defined in il::binop_expression. In the low-level representation, all logical connectives have been converted to have non short-circuit connectives. So, LOGICAL_AND and LOGICAL_AND_NO_SHORT_CIRCUIT can be treated in the same way. Short circuit semantics is captured by modifying the control flow.
il::binop_type sail::Binop::get_binop | ( | ) |
Symbol * sail::Binop::get_first_operand | ( | ) |
Variable * sail::Binop::get_lhs | ( | ) | [virtual] |
Implements sail::SaveInstruction.
Symbol * sail::Binop::get_second_operand | ( | ) |
bool sail::Binop::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.