[clang] [compiler-rt] Sanitizer prer6 (PR #76894)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 3 21:13:56 PST 2024


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 33565750e49f683308fad3ba22a06fa7e75f592b 9893b37053f02f679fcef2961b1e6872d8cf20b3 -- clang/lib/Driver/ToolChains/Arch/Mips.cpp clang/test/Driver/mips-features.c 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 58e969378a..deb5a811fc 100644
--- a/compiler-rt/lib/interception/interception.h
+++ b/compiler-rt/lib/interception/interception.h
@@ -191,12 +191,12 @@ const interpose_substitution substitution_##func_name[]             \
 #   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 37fa77b2d6..b558748b51 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_asm.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_asm.h
@@ -45,7 +45,7 @@
 #if defined(__x86_64__) || defined(__i386__) || defined(__sparc__)
 # define ASM_TAIL_CALL jmp
 #elif defined(__mips__) && __mips_isa_rev >= 6
-# define ASM_TAIL_CALL bc
+#  define ASM_TAIL_CALL bc
 #elif defined(__arm__) || defined(__aarch64__) || defined(__mips__) || \
     defined(__powerpc__) || defined(__loongarch_lp64)
 # define ASM_TAIL_CALL b
@@ -56,18 +56,22 @@
 #endif
 
 #if defined(__mips64) && __mips_isa_rev < 6
-# define C_ASM_TAIL_CALL(tfunc, ifunc)                        \
-    "lui $t8, %hi(%neg(%gp_rel(" tfunc ")))\n"                \
-    "daddu $t8, $t8, $t9\n"                                   \
-    "daddu $t8, $t8, %lo(%neg(%gp_rel(" tfunc ")))\n"         \
-    "ld $t9, %got_disp(" ifunc ")($t8)\n"                     \
+#  define C_ASM_TAIL_CALL(tfunc, ifunc)       \
+    "lui $t8, %hi(%neg(%gp_rel(" tfunc        \
+    ")))\n"                                   \
+    "daddu $t8, $t8, $t9\n"                   \
+    "daddu $t8, $t8, %lo(%neg(%gp_rel(" tfunc \
+    ")))\n"                                   \
+    "ld $t9, %got_disp(" ifunc                \
+    ")($t8)\n"                                \
     "jr $t9\n"
 #elif defined(__mips__) && __mips_isa_rev < 6
-# define C_ASM_TAIL_CALL(tfunc, ifunc)                        \
-    ".set    noreorder\n"                                     \
-    ".cpload $t9\n"                                           \
-    ".set    reorder\n"                                       \
-    "lw $t9, %got(" ifunc ")($gp)\n"                          \
+#  define C_ASM_TAIL_CALL(tfunc, ifunc) \
+    ".set    noreorder\n"               \
+    ".cpload $t9\n"                     \
+    ".set    reorder\n"                 \
+    "lw $t9, %got(" ifunc               \
+    ")($gp)\n"                          \
     "jr $t9\n"
 #elif defined(ASM_TAIL_CALL)
 #  define C_ASM_TAIL_CALL(tfunc, ifunc) \

``````````

</details>


https://github.com/llvm/llvm-project/pull/76894


More information about the cfe-commits mailing list