[Mesa-dev] [PATCH 4/7] nir: add a helper for iterating over blocks in a cf node
Connor Abbott
cwabbott0 at gmail.com
Tue Jul 21 21:53:29 PDT 2015
From: Connor Abbott <cwabbott0 at gmail.com>
We were already doing this internally for iterating over a function
implementation, so just expose it directly.
Signed-off-by: Connor Abbott <connor.w.abbott at intel.com>
---
src/glsl/nir/nir.c | 7 +++++++
src/glsl/nir/nir.h | 2 ++
2 files changed, 9 insertions(+)
diff --git a/src/glsl/nir/nir.c b/src/glsl/nir/nir.c
index f2b60d4..9e5d936 100644
--- a/src/glsl/nir/nir.c
+++ b/src/glsl/nir/nir.c
@@ -1341,6 +1341,13 @@ foreach_cf_node(nir_cf_node *node, nir_foreach_block_cb cb,
}
bool
+nir_foreach_block_in_cf_node(nir_cf_node *node, nir_foreach_block_cb cb,
+ void *state)
+{
+ return foreach_cf_node(node, cb, false, state);
+}
+
+bool
nir_foreach_block(nir_function_impl *impl, nir_foreach_block_cb cb, void *state)
{
foreach_list_typed_safe(nir_cf_node, node, node, &impl->body) {
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index c56487c..0de9f27 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -1579,6 +1579,8 @@ bool nir_foreach_block(nir_function_impl *impl, nir_foreach_block_cb cb,
void *state);
bool nir_foreach_block_reverse(nir_function_impl *impl, nir_foreach_block_cb cb,
void *state);
+bool nir_foreach_block_in_cf_node(nir_cf_node *node, nir_foreach_block_cb cb,
+ void *state);
/* If the following CF node is an if, this function returns that if.
* Otherwise, it returns NULL.
--
2.4.3
More information about the mesa-dev
mailing list