From da422663a6cacefcfae6be39154ab7598072cafa Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 25 Mar 2016 10:18:35 -0700 Subject: nir: Add a variable_foreach_safe helper Reviewed-by: Rob Clark --- src/compiler/nir/nir.h | 3 +++ 1 file changed, 3 insertions(+) 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) { -- cgit v1.2.3