diff options
author | Jason Ekstrand <[email protected]> | 2014-12-15 15:12:59 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-01-15 07:20:22 -0800 |
commit | 193fea9eb6a7ad72360a3ac65b322bab081f9587 (patch) | |
tree | ecad1e92bda6a4ff6cf91aad7ece7ca99d172715 /src/glsl/nir/nir.h | |
parent | bc0735857f1f36eede7e8e5382f8e9bbc496fecb (diff) |
nir: Add a foreach_ssa_def function
There are some functions whose destinations are SSA-only and so aren't a
nir_dest. This provides a function that is capable of iterating over the
SSA definitions defined by those functions. If you want registers, you
should use the old iterator.
v2: Kenneth Graunke <[email protected]>:
- Fix nir_foreach_ssa_def's return value.
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/glsl/nir/nir.h')
-rw-r--r-- | src/glsl/nir/nir.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index 8887c5815e7..301e58fcc3d 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -1316,8 +1316,11 @@ void nir_instr_insert_after_cf_list(struct exec_list *list, nir_instr *after); void nir_instr_remove(nir_instr *instr); +typedef bool (*nir_foreach_ssa_def_cb)(nir_ssa_def *def, void *state); typedef bool (*nir_foreach_dest_cb)(nir_dest *dest, void *state); typedef bool (*nir_foreach_src_cb)(nir_src *src, void *state); +bool nir_foreach_ssa_def(nir_instr *instr, nir_foreach_ssa_def_cb cb, + void *state); bool nir_foreach_dest(nir_instr *instr, nir_foreach_dest_cb cb, void *state); bool nir_foreach_src(nir_instr *instr, nir_foreach_src_cb cb, void *state); |