glsl/standalone: Optimize dead variable declarations
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 15 Sep 2016 18:18:35 +0000 (11:18 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 10 Nov 2016 22:30:49 +0000 (14:30 -0800)
commit4dc759c8c236e725ff7bbd439e19eada12bf390f
tree2d0b3ed0db486bb87d548578bf063685d1cd1488
parentf45a2a93aea0a57cf0aa8ee9ca062fcc42407a44
glsl/standalone: Optimize dead variable declarations

We didn't bother with this in the regular compiler because it doesn't
change the generated code.  In the stand-alone compiler, this can
clutter the output with useless variables.  It's especially bad after
functions are inlined but the foo_retval declarations remain.

v2: Use set_foreach.  Suggested by Tapani.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/compiler/glsl/standalone.cpp