ir_dereference_variable::ir_dereference_variable(ir_variable *var)
- : ir_dereference(ir_reference_variable)
{
this->var = var;
this->type = (var != NULL) ? var->type : glsl_type::error_type;
ir_dereference_array::ir_dereference_array(ir_rvalue *value,
ir_rvalue *array_index)
- : ir_dereference(ir_reference_array)
{
this->array_index = array_index;
this->set_array(value);
ir_dereference_array::ir_dereference_array(ir_variable *var,
ir_rvalue *array_index)
- : ir_dereference(ir_reference_array)
{
this->array_index = array_index;
this->set_array(new ir_dereference_variable(var));
ir_dereference_record::ir_dereference_record(ir_rvalue *value,
const char *field)
- : ir_dereference(ir_reference_record)
{
this->record = value;
this->field = field;
ir_dereference_record::ir_dereference_record(ir_variable *var,
const char *field)
- : ir_dereference(ir_reference_record)
{
this->record = new ir_dereference_variable(var);
this->field = field;
* Get the variable that is ultimately referenced by an r-value
*/
virtual ir_variable *variable_referenced() = 0;
-
- enum ir_deref_mode {
- ir_reference_variable,
- ir_reference_array,
- ir_reference_record
- } mode;
-
-protected:
- ir_dereference(ir_deref_mode mode)
- : mode(mode)
- {
- /* empty */
- }
};