nir: Add a nir_foreach_variable_safe helper
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 17 Feb 2016 21:45:24 +0000 (13:45 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 18 Feb 2016 02:04:39 +0000 (18:04 -0800)
src/compiler/nir/nir.h

index 9c478870626e3d2ff47ec90b623281813e4e5ec0..932cab62e645cec4cc22cd026e75b1fe49094233 100644 (file)
@@ -338,6 +338,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)
 {