glsl: Make _mesa_print_ir() available from anything including ir.h.

No more forgetting to #include "ir_print_visitor.h" when doing temporary
debug code, or forgetting and leaving it in after removing your temporary
debug code.  Also, available from C code so you don't need to move the
caller to C++ just to call it (see also: ir_to_mesa.cpp).
glsl: Remove ir_print_visitor.h includes and usage

We have ir->print() to do the old declaration of a visitor and having the
IR accept the visitor (yuck!).  And now you can call _mesa_print_ir()
safely anywhere that you know what an ir_instruction is..

A couple of missing printf("\n")s are added in error paths -- when an
expression is handed to the visitor, it doesn't print '\n' (since it might
be a step in printing a whole expression tree).
mesa: Use shared code for converting shader targets to short strings.

We were duplicating this code all over the place, they all would need
updating for the next set of shader targets.
mesa: Move the common _mesa_glsl_compile_shader() code to glsl/.

... and move the mesa-core-specific code into Mesa core.  This code had no
relation to ir_to_mesa.cpp, since it was also used by intel and
state_tracker, and most of it was duplicated with the standalone compiler
(which has periodically drifted from the Mesa copy).
glsl: Include EmitVertex() and EndPrimitive() prototypes for GLSL 1.50 GS.

They'd been added to ARB_gs4, but they're used the same way in 1.50.
glsl: !UPSTREAM: Spam in builtin 1.30 variables for 1.50 GSes.

They're supposed to be moved into interface blocks, but I haven't figured
out how to wire that up yet.  At least I can compile geometry-basic now.
glsl: Make sure that we don't put too many bitfields in ast_type_qualifier.

We do some tests of qualifiersusing a union containing an int and the
struct full of bitfields, so make sure the bitfields don't spill outside
the int.
glsl: Parse the GLSL 1.50 GS layout qualifiers.

Limited semantic checking (compatibility between declarations, checking
that they're in the right shader target, etc.) is done.

v2: Remove stray debug printfs.
glsl: Export the compiler's GS layout qualifiers to the gl_shader.

Next step is to validate them at link time.
glsl: Cross-validate GS layout qualifiers while intrastage linking.

This gets piglit's geometry-basic test running.

TODO: Still need to validate that the GS layout qualifiers don't get used
in places they shouldn't (like an interface block, or a particular shader
input or output)
i965/gs: Support UBOs by generating surface state and binding tables.

All but two of the piglit GLSL 1.50/uniform_buffer tests work, and
maxuniformblocksize and referenced-by-shader work.
!UPSTREAM: Expose GLSL 1.50 and GL 3.2 core contexts.

This lets me run tests normally, since globally doing GL version override
can break tests that require a compatibility context.
!UPSTREAM: Fix GS sampling

TODO:

- Seems like these functions ought to be rewritten to loop over
  program types.

- Handling of null gs seems clumsy.

- Can the same sampler be used in multiple shader stages (e.g. both VS
  and FS)?  If not, then it seems like we're going to run out of
  samplers in our bitfield.  If so, then is it guaranteed that
  fs->SamplerUnits[s] == gs->SamplerUnits[s]?  If so this needs an
  explanatory comment.  If not, this code seems broken.

- Decide what to do about code duplication.  Either I should de-dup
  the code or I suppose I should only update the gen7 code.

- Move to appropriate place in the series.