if (var->type->is_matrix()) {
ir_rvalue *lhs =
new(ctx) ir_dereference_array(var, new(ctx) ir_constant(i));
- assignment = new(ctx) ir_assignment(lhs, rhs, NULL);
+ assignment = new(ctx) ir_assignment(lhs, rhs);
} else {
/* use writemask rather than index for vector */
assert(var->type->is_vector());
ir_rvalue *lhs = new(ctx) ir_dereference_array(var,
new(ctx) ir_constant(i));
- ir_instruction *assignment = new(ctx) ir_assignment(lhs, rhs, NULL);
+ ir_instruction *assignment = new(ctx) ir_assignment(lhs, rhs);
instructions->push_tail(assignment);
i++;
ir_instruction *inst =
new(ctx) ir_assignment(new(ctx) ir_dereference_variable(rhs_var),
- new(ctx) ir_constant(rhs_var->type, &zero),
- NULL);
+ new(ctx) ir_constant(rhs_var->type, &zero));
instructions->push_tail(inst);
ir_dereference *const rhs_ref =
ir_rvalue *const rhs = new(ctx) ir_swizzle(rhs_ref, rhs_swiz[i],
type->vector_elements);
- inst = new(ctx) ir_assignment(col_ref, rhs, NULL);
+ inst = new(ctx) ir_assignment(col_ref, rhs);
instructions->push_tail(inst);
}
ir_rvalue *const rhs = new(ctx) ir_swizzle(rhs_ref, 1, 1, 1, 1,
type->vector_elements);
- inst = new(ctx) ir_assignment(col_ref, rhs, NULL);
+ inst = new(ctx) ir_assignment(col_ref, rhs);
instructions->push_tail(inst);
}
} else if (first_param->type->is_matrix()) {
ir_rvalue *const lhs =
new(ctx) ir_dereference_array(var, new(ctx) ir_constant(col));
- ir_instruction *inst = new(ctx) ir_assignment(lhs, rhs, NULL);
+ ir_instruction *inst = new(ctx) ir_assignment(lhs, rhs);
instructions->push_tail(inst);
}
}
ir_dereference *const rhs_var_ref =
new(ctx) ir_dereference_variable(rhs_var);
ir_instruction *const inst =
- new(ctx) ir_assignment(rhs_var_ref, first_param, NULL);
+ new(ctx) ir_assignment(rhs_var_ref, first_param);
instructions->push_tail(inst);
const unsigned last_row = MIN2(src_matrix->type->vector_elements,
ir_dereference *rhs_var_ref =
new(ctx) ir_dereference_variable(rhs_var);
- ir_instruction *inst = new(ctx) ir_assignment(rhs_var_ref, rhs, NULL);
+ ir_instruction *inst = new(ctx) ir_assignment(rhs_var_ref, rhs);
instructions->push_tail(inst);
do {
ir_rvalue *const rhs = ((ir_instruction *) node)->as_rvalue();
assert(rhs != NULL);
- ir_instruction *const assign =
- new(mem_ctx) ir_assignment(lhs, rhs, NULL);
+ ir_instruction *const assign = new(mem_ctx) ir_assignment(lhs, rhs);
instructions->push_tail(assign);
node = node->next;
instructions->push_tail(var);
instructions->push_tail(
new(ctx) ir_assignment(new(ctx) ir_dereference_variable(var),
- matrix, NULL));
+ matrix));
var->constant_value = matrix->constant_expression_value(ctx);
/* Replace the matrix with dereferences of its columns. */
var = new(ctx) ir_variable(ir->type, "flattening_tmp", ir_var_temporary);
base_ir->insert_before(var);
- assign = new(ctx) ir_assignment(new(ctx) ir_dereference_variable(var),
- ir,
- NULL);
+ assign = new(ctx) ir_assignment(new(ctx) ir_dereference_variable(var), ir);
base_ir->insert_before(assign);
*rvalue = new(ctx) ir_dereference_variable(var);
ir_assignment *assignment =
new(mem_ctx) ir_assignment(new(mem_ctx) ir_dereference_variable(var),
- condition, NULL);
+ condition);
ir->replace_with(assignment);
}
ir_var_temporary);
ir_assignment *temp_initializer =
new(mem_ctx) ir_assignment(new(mem_ctx) ir_dereference_variable(temp),
- new(mem_ctx) ir_constant(false), NULL);
+ new(mem_ctx) ir_constant(false));
ir->insert_before(temp);
ir->insert_before(temp_initializer);
ir_assignment *const assign_x =
new(ir) ir_assignment(new(ir) ir_dereference_variable(x),
- ir->operands[0], NULL);
+ ir->operands[0]);
ir_assignment *const assign_y =
new(ir) ir_assignment(new(ir) ir_dereference_variable(y),
- ir->operands[1], NULL);
+ ir->operands[1]);
this->base_ir->insert_before(assign_x);
this->base_ir->insert_before(assign_y);
if(!this->execute_flag) {
exec_list& list = this->loop ? this->loop->body_instructions : signature->body;
this->execute_flag = new(this->signature) ir_variable(glsl_type::bool_type, "execute_flag", ir_var_temporary);
- list.push_head(new(this->signature) ir_assignment(new(this->signature) ir_dereference_variable(execute_flag), new(this->signature) ir_constant(true), 0));
+ list.push_head(new(this->signature) ir_assignment(new(this->signature) ir_dereference_variable(execute_flag), new(this->signature) ir_constant(true)));
list.push_head(this->execute_flag);
}
return this->execute_flag;
if(!this->break_flag) {
this->break_flag = new(this->signature) ir_variable(glsl_type::bool_type, "break_flag", ir_var_temporary);
this->loop->insert_before(this->break_flag);
- this->loop->insert_before(new(this->signature) ir_assignment(new(this->signature) ir_dereference_variable(break_flag), new(this->signature) ir_constant(false), 0));
+ this->loop->insert_before(new(this->signature) ir_assignment(new(this->signature) ir_dereference_variable(break_flag), new(this->signature) ir_constant(false)));
}
return this->break_flag;
}
{
if(!this->return_flag) {
this->return_flag = new(this->signature) ir_variable(glsl_type::bool_type, "return_flag", ir_var_temporary);
- this->signature->body.push_head(new(this->signature) ir_assignment(new(this->signature) ir_dereference_variable(return_flag), new(this->signature) ir_constant(false), 0));
+ this->signature->body.push_head(new(this->signature) ir_assignment(new(this->signature) ir_dereference_variable(return_flag), new(this->signature) ir_constant(false)));
this->signature->body.push_head(this->return_flag);
}
return this->return_flag;
void *ctx = this->function.signature;
return new(ctx) ir_assignment(
new(ctx) ir_dereference_variable(this->loop.get_break_flag()),
- new(ctx) ir_constant(true),
- 0);
+ new(ctx) ir_constant(true));
}
/**
* this->loop must be initialized even outside of loops.
*/
ir_variable* execute_flag = this->loop.get_execute_flag();
- jumps[lower]->replace_with(new(ir) ir_assignment(new (ir) ir_dereference_variable(execute_flag), new (ir) ir_constant(false), 0));
+ jumps[lower]->replace_with(new(ir) ir_assignment(new (ir) ir_dereference_variable(execute_flag), new (ir) ir_constant(false)));
/* Note: we must update block_records and jumps to reflect
* the fact that the control path has been altered to an
* instruction that clears the execute flag.
ir->projector->type,
ir->projector,
NULL);
- ir_assignment *assign = new(mem_ctx) ir_assignment(deref, expr, NULL);
+ ir_assignment *assign = new(mem_ctx) ir_assignment(deref, expr);
base_ir->insert_before(assign);
deref = new(mem_ctx) ir_dereference_variable(var);
if (ret) {
if (ret->value) {
ir_rvalue *lhs = orig_deref->clone(ctx, NULL);
- ret->replace_with(new(ctx) ir_assignment(lhs, ret->value, NULL));
+ ret->replace_with(new(ctx) ir_assignment(lhs, ret->value));
} else {
/* un-valued return has to be the last return, or we shouldn't
* have reached here. (see can_inline()).
base_ir->insert_before(index);
assignment = new(ctx) ir_assignment(new(ctx) ir_dereference_variable(index),
- deref->array_index, 0);
+ deref->array_index);
base_ir->insert_before(assignment);
deref->array_index = new(ctx) ir_dereference_variable(index);
ir_assignment *assign;
assign = new(ctx) ir_assignment(new(ctx) ir_dereference_variable(parameters[i]),
- param, NULL);
+ param);
next_ir->insert_before(assign);
} else {
assert(sig_param->data.mode == ir_var_function_out ||
ir_assignment *assign;
assign = new(ctx) ir_assignment(new(ctx) ir_dereference_variable(parameters[i]),
- param->clone(ctx, NULL)->as_rvalue(), NULL);
+ param->clone(ctx, NULL)->as_rvalue());
next_ir->insert_before(assign);
}
}
ir_assignment *assign;
assign = new(ctx) ir_assignment(param,
- new(ctx) ir_dereference_variable(parameters[i]),
- NULL);
+ new(ctx) ir_dereference_variable(parameters[i]));
next_ir->insert_before(assign);
}
type->fields.structure[i].name);
}
- ir->insert_before(new(mem_ctx) ir_assignment(new_lhs,
- new_rhs,
- NULL));
+ ir->insert_before(new(mem_ctx) ir_assignment(new_lhs, new_rhs));
}
ir->remove();
} else {