aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ir_validate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/glsl/ir_validate.cpp')
-rw-r--r--mesalib/src/glsl/ir_validate.cpp47
1 files changed, 5 insertions, 42 deletions
diff --git a/mesalib/src/glsl/ir_validate.cpp b/mesalib/src/glsl/ir_validate.cpp
index 13e41a089..4bbb3ce65 100644
--- a/mesalib/src/glsl/ir_validate.cpp
+++ b/mesalib/src/glsl/ir_validate.cpp
@@ -63,7 +63,6 @@ public:
virtual ir_visitor_status visit_enter(ir_if *ir);
- virtual ir_visitor_status visit_leave(ir_loop *ir);
virtual ir_visitor_status visit_enter(ir_function *ir);
virtual ir_visitor_status visit_leave(ir_function *ir);
virtual ir_visitor_status visit_enter(ir_function_signature *ir);
@@ -149,42 +148,6 @@ ir_validate::visit_enter(ir_if *ir)
ir_visitor_status
-ir_validate::visit_leave(ir_loop *ir)
-{
- if (ir->counter != NULL) {
- if ((ir->from == NULL) || (ir->to == NULL) || (ir->increment == NULL)) {
- printf("ir_loop has invalid loop controls:\n"
- " counter: %p\n"
- " from: %p\n"
- " to: %p\n"
- " increment: %p\n",
- (void *) ir->counter, (void *) ir->from, (void *) ir->to,
- (void *) ir->increment);
- abort();
- }
-
- if ((ir->cmp < ir_binop_less) || (ir->cmp > ir_binop_nequal)) {
- printf("ir_loop has invalid comparitor %d\n", ir->cmp);
- abort();
- }
- } else {
- if ((ir->from != NULL) || (ir->to != NULL) || (ir->increment != NULL)) {
- printf("ir_loop has invalid loop controls:\n"
- " counter: %p\n"
- " from: %p\n"
- " to: %p\n"
- " increment: %p\n",
- (void *) ir->counter, (void *) ir->from, (void *) ir->to,
- (void *) ir->increment);
- abort();
- }
- }
-
- return visit_continue;
-}
-
-
-ir_visitor_status
ir_validate::visit_enter(ir_function *ir)
{
/* Function definitions cannot be nested.
@@ -679,9 +642,9 @@ ir_validate::visit(ir_variable *ir)
* to be out of bounds.
*/
if (ir->type->array_size() > 0) {
- if (ir->max_array_access >= ir->type->length) {
+ if (ir->data.max_array_access >= ir->type->length) {
printf("ir_variable has maximum access out of bounds (%d vs %d)\n",
- ir->max_array_access, ir->type->length - 1);
+ ir->data.max_array_access, ir->type->length - 1);
ir->print();
abort();
}
@@ -707,7 +670,7 @@ ir_validate::visit(ir_variable *ir)
}
}
- if (ir->constant_initializer != NULL && !ir->has_initializer) {
+ if (ir->constant_initializer != NULL && !ir->data.has_initializer) {
printf("ir_variable didn't have an initializer, but has a constant "
"initializer value.\n");
ir->print();
@@ -789,8 +752,8 @@ ir_validate::visit_enter(ir_call *ir)
printf("ir_call parameter type mismatch:\n");
goto dump_ir;
}
- if (formal_param->mode == ir_var_function_out
- || formal_param->mode == ir_var_function_inout) {
+ if (formal_param->data.mode == ir_var_function_out
+ || formal_param->data.mode == ir_var_function_inout) {
if (!actual_param->is_lvalue()) {
printf("ir_call out/inout parameters must be lvalues:\n");
goto dump_ir;