From: Faith Ekstrand Date: Tue, 8 Aug 2023 16:53:39 +0000 (-0500) Subject: nir: Wrap pass macros in braces X-Git-Tag: upstream/23.3.3~3403 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb8f14374966f548cd4d17966e79b6bf1959d442;p=platform%2Fupstream%2Fmesa.git 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: --- 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)