sail::ArrayRefRead Class Reference

v1 = v2[index].(f1 ... .fk); field selectors are optional -- this instruction includes field selectors only if ALLOW_OFFSETS is enabled. More...

#include <ArrayRefRead.h>

Inheritance diagram for sail::ArrayRefRead:
sail::SaveInstruction sail::Instruction

List of all members.

Public Member Functions

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

Friends

class boost::serialization::access

Detailed Description

v1 = v2[index].(f1 ... .fk); field selectors are optional -- this instruction includes field selectors only if ALLOW_OFFSETS is enabled.

Here, v2 is always a non-pointer array. The sequence of field selectors is represented by the offset and the ivar called 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 ArrayRead instructions with no field selectors.


Member Function Documentation

string sail::ArrayRefRead::get_field_name (  ) 
Returns:
a string that can be used to pretty-print the field selectors that are represented by the offset.
Symbol * sail::ArrayRefRead::get_index (  ) 
Returns:
the index
Variable * sail::ArrayRefRead::get_lhs (  )  [virtual]
Returns:
the variable storing result of the array read.

Implements sail::SaveInstruction.

int sail::ArrayRefRead::get_offset (  ) 
Returns:
the offset of the aggregate field selectors.
Variable * sail::ArrayRefRead::get_rhs (  ) 
Returns:
the array that is read from
bool sail::ArrayRefRead::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