summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-03-25 10:18:35 -0700
committerJason Ekstrand <[email protected]>2016-03-28 18:32:48 -0700
commitda422663a6cacefcfae6be39154ab7598072cafa (patch)
tree767278a1b7db2c01cdab9fb967516acab888c654 /src/compiler
parent731870fbe31d00fd9d734c4a6ebdecb944181eb8 (diff)
nir: Add a variable_foreach_safe helper
Reviewed-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 37d2907a82b..6bd871dc43a 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -334,6 +334,9 @@ typedef struct nir_variable {
#define nir_foreach_variable(var, var_list) \
foreach_list_typed(nir_variable, var, node, var_list)
+#define nir_foreach_variable_safe(var, var_list) \
+ foreach_list_typed_safe(nir_variable, var, node, var_list)
+
static inline bool
nir_variable_is_global(const nir_variable *var)
{