glsl: Don't choke when printing an anonymous function parameter

This is based on commit 174cef7fee, but
the code is heavily changed.  The original commit modifies
ir_print_visitor::unique_name, but there is no such method in 7.10.
Instead, this code just modifies ir_print_visitor::visit(ir_variable
*ir) to "do the right thing" when ir_variable::name is NULL.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38584
This commit is contained in:
Ian Romanick 2011-07-06 17:24:54 -07:00
parent 7424f9c1fe
commit cd73c06eed

View file

@ -104,7 +104,11 @@ void ir_print_visitor::visit(ir_variable *ir)
cent, inv, mode[ir->mode], interp[ir->interpolation]);
print_type(ir->type);
printf(" %s@%p)", ir->name, (void *) ir);
if (ir->name == NULL) {
static unsigned arg = 1;
printf(" parameter@%u)", arg++);
} else
printf(" %s@%p)", ir->name, (void *) ir);
}