From cd73c06eed3e8ff517d8741eb91b2d3356cfd214 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 6 Jul 2011 17:24:54 -0700 Subject: [PATCH] glsl: Don't choke when printing an anonymous function parameter This is based on commit 174cef7fee7d400fc89a3ce68b7791d2aa3eb90f, 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 --- src/glsl/ir_print_visitor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/glsl/ir_print_visitor.cpp b/src/glsl/ir_print_visitor.cpp index 0aa0b0a5d32..04927e79284 100644 --- a/src/glsl/ir_print_visitor.cpp +++ b/src/glsl/ir_print_visitor.cpp @@ -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); }