[Mesa-dev] [PATCH v2 2/4] nir: Add foreach_register helper macros

Jason Ekstrand jason at jlekstrand.net
Thu Dec 15 19:46:04 UTC 2016


On Dec 15, 2016 9:45 AM, "Gustaw Smolarczyk" <wielkiegie at gmail.com> wrote:

15 gru 2016 18:19 "Jason Ekstrand"<jason at jlekstrand.net> napisaƂ(a):

---
 src/compiler/nir/nir.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index f1c99ce..4a9fe65 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -373,6 +373,11 @@ typedef struct nir_register {
    struct list_head if_uses;
 } nir_register;

+#define nir_foreach_register(var, reg_list) \
+   foreach_list_typed(nir_register, reg, node, reg_list)

Shouldn't the macro definition use the var parameter? Below too.


Yes... The only reason it worked was that I always called the iteration
parameter "reg".  Good catch!  I'll Gary that fixed.

Regards,
Gustaw

+#define nir_foreach_register_safe(var, reg_list) \
+   foreach_list_typed_safe(nir_register, reg, node, reg_list)
+
 typedef enum {
    nir_instr_type_alu,
    nir_instr_type_call,
--
2.5.0.400.gff86faf

_______________________________________________
mesa-dev mailing list
mesa-dev at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161215/6b9c2e61/attachment.html>


More information about the mesa-dev mailing list