https://github.com/mgorny updated https://github.com/llvm/llvm-project/pull/152861
From f4c07170fda69208f8d340e79c836f9951b2f791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgo...@gentoo.org> Date: Sat, 9 Aug 2025 17:18:29 +0200 Subject: [PATCH] [libunwind] Use consistent indentation in `__libunwind_config.h` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use consistent indentation patterns all across `__libunwind_config.h`. The huge number of branches of the preprocessor conditions make them really unreadable when some of them are not indented. Signed-off-by: Michał Górny <mgo...@gentoo.org> --- libunwind/include/__libunwind_config.h | 49 +++++++++++++------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/libunwind/include/__libunwind_config.h b/libunwind/include/__libunwind_config.h index bb7fe4c83a3c1..0f68fa8d10197 100644 --- a/libunwind/include/__libunwind_config.h +++ b/libunwind/include/__libunwind_config.h @@ -11,6 +11,8 @@ #define _LIBUNWIND_VERSION 15000 +// Disable clang-format as it makes the huge conditions unreadable. +// clang-format off #if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \ !defined(__ARM_DWARF_EH__) && !defined(__SEH__) #define _LIBUNWIND_ARM_EHABI @@ -136,17 +138,16 @@ # error "Unsupported MIPS ABI and/or environment" # endif # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_MIPS -#elif defined(__sparc__) && defined(__arch64__) -#define _LIBUNWIND_TARGET_SPARC64 1 -#define _LIBUNWIND_HIGHEST_DWARF_REGISTER \ - _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC64 -#define _LIBUNWIND_CONTEXT_SIZE 33 -#define _LIBUNWIND_CURSOR_SIZE 45 +# elif defined(__sparc__) && defined(__arch64__) +# define _LIBUNWIND_TARGET_SPARC64 1 +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC64 +# define _LIBUNWIND_CONTEXT_SIZE 33 +# define _LIBUNWIND_CURSOR_SIZE 45 # elif defined(__sparc__) - #define _LIBUNWIND_TARGET_SPARC 1 - #define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC - #define _LIBUNWIND_CONTEXT_SIZE 16 - #define _LIBUNWIND_CURSOR_SIZE 23 +# define _LIBUNWIND_TARGET_SPARC 1 +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_SPARC +# define _LIBUNWIND_CONTEXT_SIZE 16 +# define _LIBUNWIND_CURSOR_SIZE 23 # elif defined(__riscv) # define _LIBUNWIND_TARGET_RISCV 1 # if defined(__riscv_flen) @@ -162,7 +163,7 @@ # else # error "Unsupported RISC-V ABI" # endif -# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_RISCV # elif defined(__ve__) # define _LIBUNWIND_TARGET_VE 1 # define _LIBUNWIND_CONTEXT_SIZE 67 @@ -173,20 +174,19 @@ # define _LIBUNWIND_CONTEXT_SIZE 34 # define _LIBUNWIND_CURSOR_SIZE 46 # define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_S390X -#elif defined(__loongarch__) -#define _LIBUNWIND_TARGET_LOONGARCH 1 -#if __loongarch_grlen == 64 -#define _LIBUNWIND_CONTEXT_SIZE 65 -#define _LIBUNWIND_CURSOR_SIZE 77 -#else -#error "Unsupported LoongArch ABI" -#endif -#define _LIBUNWIND_HIGHEST_DWARF_REGISTER \ - _LIBUNWIND_HIGHEST_DWARF_REGISTER_LOONGARCH -#elif defined(__wasm__) +# elif defined(__loongarch__) +# define _LIBUNWIND_TARGET_LOONGARCH 1 +# if __loongarch_grlen == 64 +# define _LIBUNWIND_CONTEXT_SIZE 65 +# define _LIBUNWIND_CURSOR_SIZE 77 +# else +# error "Unsupported LoongArch ABI" +# endif +# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_LOONGARCH +# elif defined(__wasm__) // Unused -#define _LIBUNWIND_CONTEXT_SIZE 0 -#define _LIBUNWIND_CURSOR_SIZE 0 +# define _LIBUNWIND_CONTEXT_SIZE 0 +# define _LIBUNWIND_CURSOR_SIZE 0 # else # error "Unsupported architecture." # endif @@ -211,5 +211,6 @@ # define _LIBUNWIND_CURSOR_SIZE 204 # define _LIBUNWIND_HIGHEST_DWARF_REGISTER 287 #endif // _LIBUNWIND_IS_NATIVE_ONLY +// clang-format on #endif // ____LIBUNWIND_CONFIG_H__ _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits