[compiler-rt] [compiler-rt] Fix interceptors with Solaris as (PR #72973)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 21 02:19:53 PST 2023
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff ef9bcace834e63f25bbbc5e8e2b615f89d85fb2f 0b0ce24a59f1c6f0a6144c27cb28002c77c252ad -- compiler-rt/lib/interception/interception.h compiler-rt/lib/sanitizer_common/sanitizer_asm.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/lib/interception/interception.h b/compiler-rt/lib/interception/interception.h
index 9d8b60b2ee..ae849626db 100644
--- a/compiler-rt/lib/interception/interception.h
+++ b/compiler-rt/lib/interception/interception.h
@@ -185,18 +185,18 @@ const interpose_substitution substitution_##func_name[] \
# else
# define __ASM_WEAK_WRAPPER(func) ".weak " #func "\n"
# endif // SANITIZER_FREEBSD || SANITIZER_NETBSD
-# if defined(__arm__) || defined(__aarch64__)
-# define ASM_TYPE_FUNCTION_STR "%function"
-# else
-# define ASM_TYPE_FUNCTION_STR "@function"
-# endif
+# if defined(__arm__) || defined(__aarch64__)
+# define ASM_TYPE_FUNCTION_STR "%function"
+# else
+# define ASM_TYPE_FUNCTION_STR "@function"
+# endif
// Keep trampoline implementation in sync with sanitizer_common/sanitizer_asm.h
-# define DECLARE_WRAPPER(ret_type, func, ...) \
- extern "C" ret_type func(__VA_ARGS__); \
- extern "C" ret_type TRAMPOLINE(func)(__VA_ARGS__); \
- extern "C" ret_type __interceptor_##func(__VA_ARGS__) \
- INTERCEPTOR_ATTRIBUTE __attribute__((weak)) ALIAS(WRAP(func)); \
- asm( \
+# define DECLARE_WRAPPER(ret_type, func, ...) \
+ extern "C" ret_type func(__VA_ARGS__); \
+ extern "C" ret_type TRAMPOLINE(func)(__VA_ARGS__); \
+ extern "C" ret_type __interceptor_##func(__VA_ARGS__) \
+ INTERCEPTOR_ATTRIBUTE __attribute__((weak)) ALIAS(WRAP(func)); \
+ asm( \
".text\n" \
__ASM_WEAK_WRAPPER(func) \
".set " #func ", " SANITIZER_STRINGIFY(TRAMPOLINE(func)) "\n" \
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_asm.h b/compiler-rt/lib/sanitizer_common/sanitizer_asm.h
index bbb18cfbdf..56fea571ee 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_asm.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_asm.h
@@ -62,16 +62,16 @@
#if !defined(__APPLE__)
# define ASM_HIDDEN(symbol) .hidden symbol
-# if defined(__arm__) || defined(__aarch64__)
-# define ASM_TYPE_FUNCTION(symbol) .type symbol, %function
-# else
-# define ASM_TYPE_FUNCTION(symbol) .type symbol, @function
-# endif
-# define ASM_SIZE(symbol) .size symbol, .-symbol
-# define ASM_SYMBOL(symbol) symbol
-# define ASM_SYMBOL_INTERCEPTOR(symbol) symbol
-# if defined(__i386__) || defined(__powerpc__) || defined(__s390__) || \
- defined(__sparc__)
+# if defined(__arm__) || defined(__aarch64__)
+# define ASM_TYPE_FUNCTION(symbol) .type symbol, % function
+# else
+# define ASM_TYPE_FUNCTION(symbol) .type symbol, @function
+# endif
+# define ASM_SIZE(symbol) .size symbol, .- symbol
+# define ASM_SYMBOL(symbol) symbol
+# define ASM_SYMBOL_INTERCEPTOR(symbol) symbol
+# if defined(__i386__) || defined(__powerpc__) || defined(__s390__) || \
+ defined(__sparc__)
// For details, see interception.h
# define ASM_WRAPPER_NAME(symbol) __interceptor_##symbol
# define ASM_TRAMPOLINE_ALIAS(symbol, name) \
``````````
</details>
https://github.com/llvm/llvm-project/pull/72973
More information about the llvm-commits
mailing list