glsl: Generalize processing of variable redeclarations.
glsl: Generalize processing of variable redeclarations.

This patch modifies the get_variable_being_redeclared() function so
that it no longer relies on the ast_declaration for the variable being
redeclared.  In future patches, this will allow
get_variable_being_redeclared() to be used for processing
redeclarations of the built-in gl_PerVertex interface block.

v2: Also make get_variable_being_redeclared() static.

Reviewed-by: Kenneth Graunke <bd2562f754ec92342f93f61c25d731e290a2ffa8@whitecape.org>
Reviewed-by: Ian Romanick <2b237cafb16dc45038e85df6c85e74e6d899eba9@intel.com>

bkaradzic/glsl-optimizer,mapbox/glsl-optimizer,djreep81/glsl-optimizer,zeux/glsl-optimizer,mcanthony/glsl-optimizer,jbarczak/glsl-optimizer,wolf96/glsl-optimizer,zz85/glsl-optimizer,bkaradzic/glsl-optimizer,mapbox/glsl-optimizer,benaadams/glsl-optimizer,mcanthony/glsl-optimizer,mapbox/glsl-optimizer,tokyovigilante/glsl-optimizer,wolf96/glsl-optimizer,benaadams/glsl-optimizer,metora/MesaGLSLCompiler,tokyovigilante/glsl-optimizer,bkaradzic/glsl-optimizer,zeux/glsl-optimizer,zz85/glsl-optimizer,benaadams/glsl-optimizer,dellis1972/glsl-optimizer,benaadams/glsl-optimizer,dellis1972/glsl-optimizer,zz85/glsl-optimizer,zeux/glsl-optimizer,metora/MesaGLSLCompiler,dellis1972/glsl-optimizer,jbarczak/glsl-optimizer,metora/MesaGLSLCompiler,mapbox/glsl-optimizer,benaadams/glsl-optimizer,djreep81/glsl-optimizer,wolf96/glsl-optimizer,jbarczak/glsl-optimizer,jbarczak/glsl-optimizer,benaadams/glsl-optimizer,jbarczak/glsl-optimizer,dellis1972/glsl-optimizer,zeux/glsl-optimizer,dellis1972/glsl-optimizer,mcanthony/glsl-optimizer,mcanthony/glsl-optimizer,zz85/glsl-optimizer,djreep81/glsl-optimizer,wolf96/glsl-optimizer,tokyovigilante/glsl-optimizer,mapbox/glsl-optimizer,bkaradzic/glsl-optimizer,mcanthony/glsl-optimizer,tokyovigilante/glsl-optimizer,djreep81/glsl-optimizer,zz85/glsl-optimizer,tokyovigilante/glsl-optimizer,djreep81/glsl-optimizer,bkaradzic/glsl-optimizer,zz85/glsl-optimizer,zeux/glsl-optimizer,wolf96/glsl-optimizer