i965/link: Make better use of temporary variables

The way NIR_PASS works (and, by extension, nir_optimize) is that they
may clone the shader and throw the old one away.  (We use this for
testing nir_clone.)  It's better if we just make a temporary variable,
use it for everything, and re-assign to the gl_program at the end.

[jordan.l.justen@intel.com: Tested NIR_TEST_CLONE=1 with valgrind]
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
1 file changed