OSDN Git Service

nir: Add a variable_foreach_safe helper
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 25 Mar 2016 17:18:35 +0000 (10:18 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 29 Mar 2016 01:32:48 +0000 (18:32 -0700)
Reviewed-by: Rob Clark <robdclark@gmail.com>
src/compiler/nir/nir.h

index 37d2907..6bd871d 100644 (file)
@@ -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)
 {