sail::ArrayRefWrite Class Reference

v1[index].(f1...fk) = s. Field selectors are optional and appear only if ALLOW_OFFSETS is enabled. More...

#include <ArrayRefWrite.h>

Inheritance diagram for sail::ArrayRefWrite:
sail::Instruction

List of all members.

Public Member Functions

 ArrayRefWrite (Variable *v1, Symbol *v2, Symbol *index, int offset, string name, il::node *original, int line)
virtual string to_string () const
Variableget_lhs ()
Symbolget_rhs ()
Symbolget_index ()
int get_offset ()
string get_field_name ()
virtual bool is_removable ()
virtual string to_string (bool pretty_print) const

Friends

class boost::serialization::access

Detailed Description

v1[index].(f1...fk) = s. Field selectors are optional and appear only if ALLOW_OFFSETS is enabled.

Here, v1 is always a non-pointer array. The sequence of field selectors is represented by the ivar called offset and the "name" can be used for pretty printing the fields. The offset in this instruction is optional; if ALLOW_OFFSETS in Function.cpp is set to false, SAIL generates only ArrayWrite instructions with no field selectors.


Member Function Documentation

string sail::ArrayRefWrite::get_field_name (  ) 
Returns:
string representing the field selectors that can be used for pretty-printing the offset
Symbol * sail::ArrayRefWrite::get_index (  ) 
Returns:
the index of the array
Variable * sail::ArrayRefWrite::get_lhs (  ) 
Returns:
the array that is written to
int sail::ArrayRefWrite::get_offset (  ) 
Returns:
offset of the aggregate field selectors f1, ..., fk.
Symbol * sail::ArrayRefWrite::get_rhs (  ) 
Returns:
the value that is written
bool sail::ArrayRefWrite::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:30 2010 by  doxygen 1.6.3