From: Jason Ekstrand Date: Fri, 25 Mar 2016 17:18:35 +0000 (-0700) Subject: nir: Add a variable_foreach_safe helper X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=da422663a6cacefcfae6be39154ab7598072cafa;p=mesa.git nir: Add a variable_foreach_safe helper Reviewed-by: Rob Clark --- 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) {