nir: allow NIR_PASS(_, )
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 18 Aug 2021 12:50:58 +0000 (13:50 +0100)
committerMarge Bot <emma+marge@anholt.net>
Thu, 19 May 2022 13:37:20 +0000 (13:37 +0000)
If a user wants to skip printing the shader if no changes were made
without declaring a dummy variable for the progress.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12448>

src/compiler/nir/nir.h

index 329d642..1d70f7f 100644 (file)
@@ -4348,6 +4348,7 @@ static inline bool should_print_nir(UNUSED nir_shader *shader) { return false; }
       printf("%s\n", #pass);                                         \
    if (pass(nir, ##__VA_ARGS__)) {                                   \
       nir_validate_shader(nir, "after " #pass);                      \
+      UNUSED bool _;                                                 \
       progress = true;                                               \
       if (should_print_nir(nir))                                     \
          nir_print_shader(nir, stdout);                              \