The constructor currently returns a ir_dereference_variable of error
type when provided NULL, but that's about to change in the next commit.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
ir_variable *var =
state->symbols->get_variable(this->primary_expression.identifier);
- result = new(ctx) ir_dereference_variable(var);
-
if (var != NULL) {
var->used = true;
+ result = new(ctx) ir_dereference_variable(var);
} else {
_mesa_glsl_error(& loc, state, "`%s' undeclared",
this->primary_expression.identifier);
+ result = ir_call::get_error_instruction(ctx);
error_emitted = true;
}
break;