var = new(ctx) ir_variable(lvalue->type, "_post_incdec_tmp",
ir_var_temporary);
instructions->push_tail(var);
- var->data.mode = ir_var_auto;
instructions->push_tail(new(ctx) ir_assignment(new(ctx) ir_dereference_variable(var),
lvalue));
/* If there is no qualifier that changes the mode of the variable, leave
* the setting alone.
*/
+ assert(var->data.mode != ir_var_temporary);
if (qual->flags.q.in && qual->flags.q.out)
var->data.mode = ir_var_function_inout;
else if (qual->flags.q.in)
*/
ir_variable *const junk =
new(state) ir_variable(type, "#default precision",
- ir_var_temporary);
+ ir_var_auto);
state->symbols->add_variable(junk);
}
case ir_type_function:
shader->symbols->add_function((ir_function *) ir);
break;
- case ir_type_variable:
- shader->symbols->add_variable((ir_variable *) ir);
+ case ir_type_variable: {
+ ir_variable *const var = (ir_variable *) ir;
+
+ if (var->data.mode != ir_var_temporary)
+ shader->symbols->add_variable(var);
break;
+ }
default:
break;
}
bool glsl_symbol_table::add_variable(ir_variable *v)
{
+ assert(v->data.mode != ir_var_temporary);
+
if (this->separate_function_namespace) {
/* In 1.10, functions and variables have separate namespaces. */
symbol_table_entry *existing = get_entry(v->name);
if ((func = inst->as_function()) != NULL) {
sh->symbols->add_function(func);
} else if ((var = inst->as_variable()) != NULL) {
- sh->symbols->add_variable(var);
+ if (var->data.mode != ir_var_temporary)
+ sh->symbols->add_variable(var);
}
}
}
* to have a location assigned.
*/
if (var->data.is_unmatched_generic_inout) {
+ assert(var->data.mode != ir_var_temporary);
var->data.mode = ir_var_auto;
}
}
!var->type->contains_integer());
/* Change the old varying into an ordinary global. */
+ assert(var->data.mode != ir_var_temporary);
var->data.mode = ir_var_auto;
/* Create a reference to the old varying. */