- (ir_variable_mode) this->mode);
-
- var->max_array_access = this->max_array_access;
- var->read_only = this->read_only;
- var->centroid = this->centroid;
- var->invariant = this->invariant;
- var->interpolation = this->interpolation;
- var->array_lvalue = this->array_lvalue;
- var->location = this->location;
- var->warn_extension = this->warn_extension;
- var->origin_upper_left = this->origin_upper_left;
- var->pixel_center_integer = this->pixel_center_integer;
+ (ir_variable_mode) this->data.mode);
+
+ var->data.max_array_access = this->data.max_array_access;
+ if (this->is_interface_instance()) {
+ var->u.max_ifc_array_access =
+ rzalloc_array(var, unsigned, this->interface_type->length);
+ memcpy(var->u.max_ifc_array_access, this->u.max_ifc_array_access,
+ this->interface_type->length * sizeof(unsigned));
+ }
+
+ memcpy(&var->data, &this->data, sizeof(var->data));
+
+ if (this->get_state_slots()) {
+ ir_state_slot *s = var->allocate_state_slots(this->get_num_state_slots());
+ memcpy(s, this->get_state_slots(),
+ sizeof(s[0]) * var->get_num_state_slots());
+ }