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>
This commit is contained in:
Kenneth Graunke
2011-09-20 17:58:45 -07:00
parent 82065fa20e
commit f75c2d5314
6 changed files with 14 additions and 7 deletions

View File

@@ -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