v1 = v2[index].(f1 ... .fk); field selectors are optional -- this instruction includes field selectors only if ALLOW_OFFSETS is enabled. More...
#include <ArrayRefRead.h>
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 Variable * | get_lhs () |
virtual void | set_lhs (Variable *v) |
Variable * | get_rhs () |
Symbol * | get_index () |
virtual bool | is_removable () |
virtual string | to_string (bool pretty_print) const |
Friends | |
class | boost::serialization::access |
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.
string sail::ArrayRefRead::get_field_name | ( | ) |
Symbol * sail::ArrayRefRead::get_index | ( | ) |
Variable * sail::ArrayRefRead::get_lhs | ( | ) | [virtual] |
Implements sail::SaveInstruction.
int sail::ArrayRefRead::get_offset | ( | ) |
Variable * sail::ArrayRefRead::get_rhs | ( | ) |
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.