nir: Convert the NIR instruction insertion API to use cursors.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 10 Aug 2015 01:30:33 +0000 (18:30 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 27 Aug 2015 20:36:57 +0000 (13:36 -0700)
commit3e3cb77901c9c9efbf4cf550da80509fe6dbbd9f
treec5b847b6d4e33b350239537305f806472b13855e
parentf90c6b1ce0d96c7dbdd32ab913d5c88913700ba2
nir: Convert the NIR instruction insertion API to use cursors.

This patch implements a general nir_instr_insert() function that takes a
nir_cursor for the insertion point.  It then reworks the existing API to
simply be a wrapper around that for compatibility.

This largely involves moving the existing code into a new function.

Suggested by Connor Abbott.

v2: Make the legacy functions static inline in nir.h (requested by
    Connor Abbott).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Acked-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/nir/nir.c
src/glsl/nir/nir.h