nir: use a _clone so users calling their variable clone don't get a warning
authorDave Airlie <airlied@redhat.com>
Wed, 6 Sep 2023 06:23:36 +0000 (16:23 +1000)
committerMarge Bot <emma+marge@anholt.net>
Tue, 12 Sep 2023 01:57:50 +0000 (01:57 +0000)
I've got code using clone name and it gets confused.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24687>

src/compiler/nir/nir.h

index 2da1487..db8524e 100644 (file)
@@ -4687,8 +4687,8 @@ should_print_nir(UNUSED nir_shader *shader)
       }                                                                 \
       do_pass if (NIR_DEBUG(CLONE))                                     \
       {                                                                 \
-         nir_shader *clone = nir_shader_clone(ralloc_parent(nir), nir); \
-         nir_shader_replace(nir, clone);                                \
+         nir_shader *_clone = nir_shader_clone(ralloc_parent(nir), nir);\
+         nir_shader_replace(nir, _clone);                               \
       }                                                                 \
       if (NIR_DEBUG(SERIALIZE)) {                                       \
          nir_shader_serialize_deserialize(nir);                         \