glsl2: Remove unnecessary casts of clone return values
This commit is contained in:
@@ -67,7 +67,7 @@ ir_swizzle *
|
|||||||
ir_swizzle::clone(struct hash_table *ht) const
|
ir_swizzle::clone(struct hash_table *ht) const
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(this);
|
void *ctx = talloc_parent(this);
|
||||||
return new(ctx) ir_swizzle((ir_rvalue *)this->val->clone(ht), this->mask);
|
return new(ctx) ir_swizzle(this->val->clone(ht), this->mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
ir_return *
|
ir_return *
|
||||||
@@ -77,7 +77,7 @@ ir_return::clone(struct hash_table *ht) const
|
|||||||
ir_rvalue *new_value = NULL;
|
ir_rvalue *new_value = NULL;
|
||||||
|
|
||||||
if (this->value)
|
if (this->value)
|
||||||
new_value = (ir_rvalue *)this->value->clone(ht);
|
new_value = this->value->clone(ht);
|
||||||
|
|
||||||
return new(ctx) ir_return(new_value);
|
return new(ctx) ir_return(new_value);
|
||||||
}
|
}
|
||||||
@@ -89,7 +89,7 @@ ir_discard::clone(struct hash_table *ht) const
|
|||||||
ir_rvalue *new_condition = NULL;
|
ir_rvalue *new_condition = NULL;
|
||||||
|
|
||||||
if (this->condition != NULL)
|
if (this->condition != NULL)
|
||||||
new_condition = (ir_rvalue *) this->condition->clone(ht);
|
new_condition = this->condition->clone(ht);
|
||||||
|
|
||||||
return new(ctx) ir_discard(new_condition);
|
return new(ctx) ir_discard(new_condition);
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ ir_if *
|
|||||||
ir_if::clone(struct hash_table *ht) const
|
ir_if::clone(struct hash_table *ht) const
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(this);
|
void *ctx = talloc_parent(this);
|
||||||
ir_if *new_if = new(ctx) ir_if((ir_rvalue *)this->condition->clone(ht));
|
ir_if *new_if = new(ctx) ir_if(this->condition->clone(ht));
|
||||||
|
|
||||||
foreach_iter(exec_list_iterator, iter, this->then_instructions) {
|
foreach_iter(exec_list_iterator, iter, this->then_instructions) {
|
||||||
ir_instruction *ir = (ir_instruction *)iter.get();
|
ir_instruction *ir = (ir_instruction *)iter.get();
|
||||||
@@ -129,11 +129,11 @@ ir_loop::clone(struct hash_table *ht) const
|
|||||||
ir_loop *new_loop = new(ctx) ir_loop();
|
ir_loop *new_loop = new(ctx) ir_loop();
|
||||||
|
|
||||||
if (this->from)
|
if (this->from)
|
||||||
new_loop->from = (ir_rvalue *)this->from->clone(ht);
|
new_loop->from = this->from->clone(ht);
|
||||||
if (this->to)
|
if (this->to)
|
||||||
new_loop->to = (ir_rvalue *)this->to->clone(ht);
|
new_loop->to = this->to->clone(ht);
|
||||||
if (this->increment)
|
if (this->increment)
|
||||||
new_loop->increment = (ir_rvalue *)this->increment->clone(ht);
|
new_loop->increment = this->increment->clone(ht);
|
||||||
new_loop->counter = counter;
|
new_loop->counter = counter;
|
||||||
|
|
||||||
foreach_iter(exec_list_iterator, iter, this->body_instructions) {
|
foreach_iter(exec_list_iterator, iter, this->body_instructions) {
|
||||||
@@ -166,7 +166,7 @@ ir_expression::clone(struct hash_table *ht) const
|
|||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < get_num_operands(); i++) {
|
for (i = 0; i < get_num_operands(); i++) {
|
||||||
op[i] = (ir_rvalue *)this->operands[i]->clone(ht);
|
op[i] = this->operands[i]->clone(ht);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new(ctx) ir_expression(this->operation, this->type, op[0], op[1]);
|
return new(ctx) ir_expression(this->operation, this->type, op[0], op[1]);
|
||||||
@@ -193,15 +193,15 @@ ir_dereference_array *
|
|||||||
ir_dereference_array::clone(struct hash_table *ht) const
|
ir_dereference_array::clone(struct hash_table *ht) const
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(this);
|
void *ctx = talloc_parent(this);
|
||||||
return new(ctx) ir_dereference_array((ir_rvalue *)this->array->clone(ht),
|
return new(ctx) ir_dereference_array(this->array->clone(ht),
|
||||||
(ir_rvalue *)this->array_index->clone(ht));
|
this->array_index->clone(ht));
|
||||||
}
|
}
|
||||||
|
|
||||||
ir_dereference_record *
|
ir_dereference_record *
|
||||||
ir_dereference_record::clone(struct hash_table *ht) const
|
ir_dereference_record::clone(struct hash_table *ht) const
|
||||||
{
|
{
|
||||||
void *ctx = talloc_parent(this);
|
void *ctx = talloc_parent(this);
|
||||||
return new(ctx) ir_dereference_record((ir_rvalue *)this->record->clone(ht),
|
return new(ctx) ir_dereference_record(this->record->clone(ht),
|
||||||
this->field);
|
this->field);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,13 +211,12 @@ ir_texture::clone(struct hash_table *ht) const
|
|||||||
void *ctx = talloc_parent(this);
|
void *ctx = talloc_parent(this);
|
||||||
ir_texture *new_tex = new(ctx) ir_texture(this->op);
|
ir_texture *new_tex = new(ctx) ir_texture(this->op);
|
||||||
|
|
||||||
new_tex->sampler = (ir_dereference *)this->sampler->clone(ht);
|
new_tex->sampler = this->sampler->clone(ht);
|
||||||
new_tex->coordinate = (ir_rvalue *)this->coordinate->clone(ht);
|
new_tex->coordinate = this->coordinate->clone(ht);
|
||||||
if (this->projector)
|
if (this->projector)
|
||||||
new_tex->projector = (ir_rvalue *)this->projector->clone(ht);
|
new_tex->projector = this->projector->clone(ht);
|
||||||
if (this->shadow_comparitor) {
|
if (this->shadow_comparitor) {
|
||||||
new_tex->shadow_comparitor =
|
new_tex->shadow_comparitor = this->shadow_comparitor->clone(ht);
|
||||||
(ir_rvalue *)this->shadow_comparitor->clone(ht);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
@@ -227,17 +226,15 @@ ir_texture::clone(struct hash_table *ht) const
|
|||||||
case ir_tex:
|
case ir_tex:
|
||||||
break;
|
break;
|
||||||
case ir_txb:
|
case ir_txb:
|
||||||
new_tex->lod_info.bias = (ir_rvalue *)this->lod_info.bias->clone(ht);
|
new_tex->lod_info.bias = this->lod_info.bias->clone(ht);
|
||||||
break;
|
break;
|
||||||
case ir_txl:
|
case ir_txl:
|
||||||
case ir_txf:
|
case ir_txf:
|
||||||
new_tex->lod_info.lod = (ir_rvalue *)this->lod_info.lod->clone(ht);
|
new_tex->lod_info.lod = this->lod_info.lod->clone(ht);
|
||||||
break;
|
break;
|
||||||
case ir_txd:
|
case ir_txd:
|
||||||
new_tex->lod_info.grad.dPdx =
|
new_tex->lod_info.grad.dPdx = this->lod_info.grad.dPdx->clone(ht);
|
||||||
(ir_rvalue *)this->lod_info.grad.dPdx->clone(ht);
|
new_tex->lod_info.grad.dPdy = this->lod_info.grad.dPdy->clone(ht);
|
||||||
new_tex->lod_info.grad.dPdy =
|
|
||||||
(ir_rvalue *)this->lod_info.grad.dPdy->clone(ht);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,11 +247,11 @@ ir_assignment::clone(struct hash_table *ht) const
|
|||||||
ir_rvalue *new_condition = NULL;
|
ir_rvalue *new_condition = NULL;
|
||||||
|
|
||||||
if (this->condition)
|
if (this->condition)
|
||||||
new_condition = (ir_rvalue *)this->condition->clone(ht);
|
new_condition = this->condition->clone(ht);
|
||||||
|
|
||||||
void *ctx = talloc_parent(this);
|
void *ctx = talloc_parent(this);
|
||||||
return new(ctx) ir_assignment((ir_rvalue *)this->lhs->clone(ht),
|
return new(ctx) ir_assignment(this->lhs->clone(ht),
|
||||||
(ir_rvalue *)this->rhs->clone(ht),
|
this->rhs->clone(ht),
|
||||||
new_condition);
|
new_condition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -315,8 +315,7 @@ cross_validate_globals(struct gl_shader_program *prog,
|
|||||||
* have an initializer but a later instance does, copy the
|
* have an initializer but a later instance does, copy the
|
||||||
* initializer to the version stored in the symbol table.
|
* initializer to the version stored in the symbol table.
|
||||||
*/
|
*/
|
||||||
existing->constant_value =
|
existing->constant_value = var->constant_value->clone(NULL);
|
||||||
(ir_constant *)var->constant_value->clone(NULL);
|
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
variables.add_variable(var->name, var);
|
variables.add_variable(var->name, var);
|
||||||
|
Reference in New Issue
Block a user