sail::Binop Class Reference

An instruction of the form v = s1 binop s2. More...

#include <Binop.h>

Inheritance diagram for sail::Binop:
sail::SaveInstruction sail::Instruction

List of all members.

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 Variableget_lhs ()
virtual void set_lhs (Variable *v)
Symbolget_first_operand ()
Symbolget_second_operand ()
il::binop_type get_binop ()
virtual bool is_removable ()

Friends

class boost::serialization::access

Detailed Description

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.


Member Function Documentation

il::binop_type sail::Binop::get_binop (  ) 
Returns:
the type of the binop, e.g. +, % etc.
Symbol * sail::Binop::get_first_operand (  ) 
Returns:
first operand of binop
Variable * sail::Binop::get_lhs (  )  [virtual]
Returns:
the variable holding the result of the binop

Implements sail::SaveInstruction.

Symbol * sail::Binop::get_second_operand (  ) 
Returns:
the second operand of binop
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.


The documentation for this class was generated from the following files:
Generated on Sun Oct 17 14:01:31 2010 by  doxygen 1.6.3