This is as opposed to returning the type of the base class of the hierarchy.
op[0], op[1]);
result = do_assignment(instructions, state,
- (ir_rvalue *)op[0]->clone(NULL), temp_rhs,
+ op[0]->clone(NULL), temp_rhs,
this->subexpressions[0]->get_location());
type = result->type;
error_emitted = (op[0]->type->is_error());
op[0], op[1]);
result = do_assignment(instructions, state,
- (ir_rvalue *)op[0]->clone(NULL), temp_rhs,
+ op[0]->clone(NULL), temp_rhs,
this->subexpressions[0]->get_location());
type = result->type;
error_emitted = type->is_error();
op[0], op[1]);
result = do_assignment(instructions, state,
- (ir_rvalue *)op[0]->clone(NULL), temp_rhs,
+ op[0]->clone(NULL), temp_rhs,
this->subexpressions[0]->get_location());
type = result->type;
error_emitted = op[0]->type->is_error();
/* Get a temporary of a copy of the lvalue before it's modified.
* This may get thrown away later.
*/
- result = get_lvalue_copy(instructions, (ir_rvalue *)op[0]->clone(NULL));
+ result = get_lvalue_copy(instructions, op[0]->clone(NULL));
(void)do_assignment(instructions, state,
- (ir_rvalue *)op[0]->clone(NULL), temp_rhs,
+ op[0]->clone(NULL), temp_rhs,
this->subexpressions[0]->get_location());
type = result->type;
class ir_rvalue : public ir_instruction {
public:
+ virtual ir_rvalue *clone(struct hash_table *) const = 0;
+
virtual ir_rvalue * as_rvalue()
{
return this;
public:
ir_variable(const struct glsl_type *, const char *);
- virtual ir_instruction *clone(struct hash_table *ht) const;
+ virtual ir_variable *clone(struct hash_table *ht) const;
virtual ir_variable *as_variable()
{
public:
ir_function_signature(const glsl_type *return_type);
- virtual ir_instruction *clone(struct hash_table *ht) const;
+ virtual ir_function_signature *clone(struct hash_table *ht) const;
virtual void accept(ir_visitor *v)
{
public:
ir_function(const char *name);
- virtual ir_instruction *clone(struct hash_table *ht) const;
+ virtual ir_function *clone(struct hash_table *ht) const;
virtual ir_function *as_function()
{
/* empty */
}
- virtual ir_instruction *clone(struct hash_table *ht) const;
+ virtual ir_if *clone(struct hash_table *ht) const;
virtual ir_if *as_if()
{
/* empty */
}
- virtual ir_instruction *clone(struct hash_table *ht) const;
+ virtual ir_loop *clone(struct hash_table *ht) const;
virtual void accept(ir_visitor *v)
{
public:
ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs, ir_rvalue *condition);
- virtual ir_instruction *clone(struct hash_table *ht) const;
+ virtual ir_assignment *clone(struct hash_table *ht) const;
virtual void accept(ir_visitor *v)
{
ir_expression(int op, const struct glsl_type *type,
ir_rvalue *, ir_rvalue *);
- virtual ir_instruction *clone(struct hash_table *ht) const;
+ virtual ir_expression *clone(struct hash_table *ht) const;
static unsigned int get_num_operands(ir_expression_operation);
unsigned int get_num_operands() const
actual_parameters->move_nodes_to(& this->actual_parameters);
}
- virtual ir_instruction *clone(struct hash_table *ht) const;
+ virtual ir_call *clone(struct hash_table *ht) const;
virtual ir_call *as_call()
{
/* empty */
}
- virtual ir_instruction *clone(struct hash_table *) const;
+ virtual ir_return *clone(struct hash_table *) const;
virtual ir_return *as_return()
{
this->loop = loop;
}
- virtual ir_instruction *clone(struct hash_table *) const;
+ virtual ir_loop_jump *clone(struct hash_table *) const;
virtual void accept(ir_visitor *v)
{
this->condition = cond;
}
- virtual ir_instruction *clone(struct hash_table *ht) const;
+ virtual ir_discard *clone(struct hash_table *ht) const;
virtual void accept(ir_visitor *v)
{
/* empty */
}
- virtual ir_instruction *clone(struct hash_table *) const;
+ virtual ir_texture *clone(struct hash_table *) const;
virtual void accept(ir_visitor *v)
{
ir_swizzle(ir_rvalue *val, ir_swizzle_mask mask);
- virtual ir_instruction *clone(struct hash_table *) const;
+ virtual ir_swizzle *clone(struct hash_table *) const;
virtual ir_swizzle *as_swizzle()
{
class ir_dereference : public ir_rvalue {
public:
+ virtual ir_dereference *clone(struct hash_table *) const = 0;
+
virtual ir_dereference *as_dereference()
{
return this;
public:
ir_dereference_variable(ir_variable *var);
- virtual ir_instruction *clone(struct hash_table *) const;
+ virtual ir_dereference_variable *clone(struct hash_table *) const;
virtual ir_dereference_variable *as_dereference_variable()
{
ir_dereference_array(ir_variable *var, ir_rvalue *array_index);
- virtual ir_instruction *clone(struct hash_table *) const;
+ virtual ir_dereference_array *clone(struct hash_table *) const;
virtual ir_dereference_array *as_dereference_array()
{
ir_dereference_record(ir_variable *var, const char *field);
- virtual ir_instruction *clone(struct hash_table *) const;
+ virtual ir_dereference_record *clone(struct hash_table *) const;
/**
* Get the variable that is ultimately referenced by an r-value
*/
ir_constant(const ir_constant *c, unsigned i);
- virtual ir_instruction *clone(struct hash_table *) const;
+ virtual ir_constant *clone(struct hash_table *) const;
virtual ir_constant *as_constant()
{
* This will probably be made \c virtual and moved to the base class
* eventually.
*/
-ir_instruction *
+ir_variable *
ir_variable::clone(struct hash_table *ht) const
{
void *ctx = talloc_parent(this);
return var;
}
-ir_instruction *
+ir_swizzle *
ir_swizzle::clone(struct hash_table *ht) const
{
void *ctx = talloc_parent(this);
return new(ctx) ir_swizzle((ir_rvalue *)this->val->clone(ht), this->mask);
}
-ir_instruction *
+ir_return *
ir_return::clone(struct hash_table *ht) const
{
void *ctx = talloc_parent(this);
return new(ctx) ir_return(new_value);
}
-ir_instruction *
+ir_discard *
ir_discard::clone(struct hash_table *ht) const
{
void *ctx = talloc_parent(this);
return new(ctx) ir_discard(new_condition);
}
-ir_instruction *
+ir_loop_jump *
ir_loop_jump::clone(struct hash_table *ht) const
{
void *ctx = talloc_parent(this);
return new(ctx) ir_loop_jump(this->mode);
}
-ir_instruction *
+ir_if *
ir_if::clone(struct hash_table *ht) const
{
void *ctx = talloc_parent(this);
return new_if;
}
-ir_instruction *
+ir_loop *
ir_loop::clone(struct hash_table *ht) const
{
void *ctx = talloc_parent(this);
return new_loop;
}
-ir_instruction *
+ir_call *
ir_call::clone(struct hash_table *ht) const
{
void *ctx = talloc_parent(this);
return new(ctx) ir_call(this->callee, &new_parameters);
}
-ir_instruction *
+ir_expression *
ir_expression::clone(struct hash_table *ht) const
{
void *ctx = talloc_parent(this);
return new(ctx) ir_expression(this->operation, this->type, op[0], op[1]);
}
-ir_instruction *
+ir_dereference_variable *
ir_dereference_variable::clone(struct hash_table *ht) const
{
void *ctx = talloc_parent(this);
return new(ctx) ir_dereference_variable(new_var);
}
-ir_instruction *
+ir_dereference_array *
ir_dereference_array::clone(struct hash_table *ht) const
{
void *ctx = talloc_parent(this);
(ir_rvalue *)this->array_index->clone(ht));
}
-ir_instruction *
+ir_dereference_record *
ir_dereference_record::clone(struct hash_table *ht) const
{
void *ctx = talloc_parent(this);
this->field);
}
-ir_instruction *
+ir_texture *
ir_texture::clone(struct hash_table *ht) const
{
void *ctx = talloc_parent(this);
return new_tex;
}
-ir_instruction *
+ir_assignment *
ir_assignment::clone(struct hash_table *ht) const
{
ir_rvalue *new_condition = NULL;
new_condition);
}
-ir_instruction *
+ir_function *
ir_function::clone(struct hash_table *ht) const
{
(void)ht;
abort();
}
-ir_instruction *
+ir_function_signature *
ir_function_signature::clone(struct hash_table *ht) const
{
(void)ht;
abort();
}
-ir_instruction *
+ir_constant *
ir_constant::clone(struct hash_table *ht) const
{
void *ctx = talloc_parent(this);
ir_variable *var = ir->variable_referenced();
if (var && var->constant_value)
- value = (ir_constant *)var->constant_value->clone(NULL);
+ value = var->constant_value->clone(NULL);
}
ir_rvalue *param = (ir_rvalue *) param_iter.get();
/* Generate a new variable for the parameter. */
- parameters[i] = (ir_variable *)sig_param->clone(ht);
+ parameters[i] = sig_param->clone(ht);
parameters[i]->mode = ir_var_auto;
next_ir->insert_before(parameters[i]);