From bb8f14374966f548cd4d17966e79b6bf1959d442 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Tue, 8 Aug 2023 11:53:39 -0500 Subject: [PATCH] nir: Wrap pass macros in braces This makes clang-format not mess them up so bad. It's also probably a good idea to make sure anything we declare in the macro is properly scoped. Part-of: --- src/compiler/nir/nir.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index f8df00d..60f8df8 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -4651,7 +4651,7 @@ static inline bool should_print_nir(UNUSED nir_shader *shader) { return false; } } \ } while (0) -#define NIR_PASS(progress, nir, pass, ...) _PASS(pass, nir, \ +#define NIR_PASS(progress, nir, pass, ...) _PASS(pass, nir, { \ nir_metadata_set_validation_flag(nir); \ if (should_print_nir(nir)) \ printf("%s\n", #pass); \ @@ -4663,16 +4663,16 @@ static inline bool should_print_nir(UNUSED nir_shader *shader) { return false; } nir_print_shader(nir, stdout); \ nir_metadata_check_validation_flag(nir); \ } \ -) +}) -#define NIR_PASS_V(nir, pass, ...) _PASS(pass, nir, \ +#define NIR_PASS_V(nir, pass, ...) _PASS(pass, nir, { \ if (should_print_nir(nir)) \ printf("%s\n", #pass); \ pass(nir, ##__VA_ARGS__); \ nir_validate_shader(nir, "after " #pass " in " __FILE__); \ if (should_print_nir(nir)) \ nir_print_shader(nir, stdout); \ -) +}) #define NIR_SKIP(name) should_skip_nir(#name) -- 2.7.4