summaryrefslogtreecommitdiff
path: root/ir.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-03-25 23:30:28 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-03-26 12:50:40 -0700
commit44e1dfa2df4de3e2de963f0505cdadade6fe8180 (patch)
tree01ea06c0eeb9e2c09a043fa44f83e9a3002e03ea /ir.cpp
parentb7592c362b69a8ddbef9c1c6c2bde33e40653774 (diff)
Replace "mode" type tag with virtual as_foo() downcasting functions.
These should work well even in a non-flat IR hierarchy. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'ir.cpp')
-rw-r--r--ir.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/ir.cpp b/ir.cpp
index 1b5947a470..0e98f0c8d9 100644
--- a/ir.cpp
+++ b/ir.cpp
@@ -28,7 +28,7 @@
ir_assignment::ir_assignment(ir_instruction *lhs, ir_instruction *rhs,
ir_expression *condition)
- : ir_instruction(ir_op_assign)
+ : ir_instruction()
{
this->lhs = (ir_dereference *) lhs;
this->rhs = rhs;
@@ -38,7 +38,7 @@ ir_assignment::ir_assignment(ir_instruction *lhs, ir_instruction *rhs,
ir_expression::ir_expression(int op, const struct glsl_type *type,
ir_instruction *op0, ir_instruction *op1)
- : ir_instruction(ir_op_expression)
+ : ir_instruction()
{
this->type = type;
this->operation = ir_expression_operation(op);
@@ -48,14 +48,14 @@ ir_expression::ir_expression(int op, const struct glsl_type *type,
ir_label::ir_label(const char *label)
- : ir_instruction(ir_op_label), label(label)
+ : ir_instruction(), label(label)
{
/* empty */
}
ir_constant::ir_constant(const struct glsl_type *type, const void *data)
- : ir_instruction(ir_op_constant)
+ : ir_instruction()
{
const unsigned elements =
((type->vector_elements == 0) ? 1 : type->vector_elements)
@@ -79,7 +79,7 @@ ir_constant::ir_constant(const struct glsl_type *type, const void *data)
ir_dereference::ir_dereference(ir_instruction *var)
- : ir_instruction(ir_op_dereference)
+ : ir_instruction()
{
this->mode = ir_reference_variable;
this->var = var;
@@ -89,7 +89,7 @@ ir_dereference::ir_dereference(ir_instruction *var)
ir_dereference::ir_dereference(ir_instruction *var,
ir_instruction *array_index)
- : ir_instruction(ir_op_dereference), mode(ir_reference_array),
+ : ir_instruction(), mode(ir_reference_array),
var(var)
{
this->type = (var != NULL) ? var->type : glsl_error_type;
@@ -124,8 +124,8 @@ ir_dereference::set_swizzle(unsigned x, unsigned y, unsigned z, unsigned w,
ir_variable::ir_variable(const struct glsl_type *type, const char *name)
- : ir_instruction(ir_op_var_decl), read_only(false), centroid(false),
- invariant(false), mode(ir_var_auto), interpolation(ir_var_smooth)
+ : ir_instruction(), read_only(false), centroid(false), invariant(false),
+ mode(ir_var_auto), interpolation(ir_var_smooth)
{
this->type = type;
this->name = name;
@@ -133,14 +133,14 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name)
ir_function_signature::ir_function_signature(const glsl_type *return_type)
- : ir_instruction(ir_op_func_sig), return_type(return_type), definition(NULL)
+ : ir_instruction(), return_type(return_type), definition(NULL)
{
/* empty */
}
ir_function::ir_function(const char *name)
- : ir_instruction(ir_op_func), name(name)
+ : ir_instruction(), name(name)
{
/* empty */
}