nir: Add a nir_foreach_function_temp_variable helper
[mesa.git] / src / compiler / nir / nir.h
index b15de3b5dd304cc6b07580675317d94e0abd1d0e..de26c937722421111744fd1a50d1aac67d2b80cc 100644 (file)
@@ -2750,6 +2750,12 @@ typedef struct {
    nir_metadata valid_metadata;
 } nir_function_impl;
 
+#define nir_foreach_function_temp_variable(var, impl) \
+   foreach_list_typed(nir_variable, var, node, &(impl)->locals)
+
+#define nir_foreach_function_temp_variable_safe(var, impl) \
+   foreach_list_typed_safe(nir_variable, var, node, &(impl)->locals)
+
 ATTRIBUTE_RETURNS_NONNULL static inline nir_block *
 nir_start_block(nir_function_impl *impl)
 {