nir: Refactor nir_src_as_* constant functions
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 26 Jun 2019 01:33:46 +0000 (20:33 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Wed, 10 Jul 2019 00:20:59 +0000 (00:20 +0000)
commit3acddc733f1b71c3b02c4f881f3b4326bd06c764
treed78bda02471cd4db3df4dde8befbc6b8472e8704
parentce5581e23e54be91e4c1ad6a6c5990eca6677ceb
nir: Refactor nir_src_as_* constant functions

Now that we have the nir_const_value_as_* helpers, every one of these
functions is effectively the same except for the suffix they use so we
can easily define them with a repeated macro.  This also means that
they're inline and the fact that the nir_src is being passed by-value
should no longer really hurt anything.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/nir/nir.c
src/compiler/nir/nir.h