summaryrefslogtreecommitdiff
path: root/src/glsl/ir_validate.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2011-09-20 17:58:45 -0700
committerKenneth Graunke <kenneth@whitecape.org>2012-04-02 14:15:46 -0700
commitf75c2d53146ea14f8dfedcc5b7a4704278ba0792 (patch)
tree512d5cda78998a6b5b80d3f6ec90ba92dcb47b8c /src/glsl/ir_validate.cpp
parent82065fa20ee3f2880a070f1f4f75509b910cedde (diff)
glsl: Demote 'type' from ir_instruction to ir_rvalue and ir_variable.
Variables have types, expression trees have types, but statements don't. Rather than have a nonsensical field that stays NULL in the base class, just move it to where it makes sense. Fix up a few places that lazily used ir_instruction even though they actually knew the particular subclass. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/glsl/ir_validate.cpp')
-rw-r--r--src/glsl/ir_validate.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp
index a7c82010b18..7efb4347799 100644
--- a/src/glsl/ir_validate.cpp
+++ b/src/glsl/ir_validate.cpp
@@ -622,7 +622,9 @@ check_node_type(ir_instruction *ir, void *data)
printf("Instruction node with unset type\n");
ir->print(); printf("\n");
}
- assert(ir->type != glsl_type::error_type);
+ ir_rvalue *value = ir->as_rvalue();
+ if (value != NULL)
+ assert(value->type != glsl_type::error_type);
}
void