[compiler-rt] [TSan] Add lock_during_write flag on Apple platforms to avoid deadlock (PR #157928)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 10 11:49:38 PDT 2025
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 origin/main HEAD --extensions h,c,cpp,inc -- compiler-rt/test/tsan/Darwin/write-interpose.c compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp compiler-rt/lib/tsan/rtl/tsan_flags.cpp compiler-rt/lib/tsan/rtl/tsan_flags.h compiler-rt/lib/tsan/rtl/tsan_flags.inc compiler-rt/lib/tsan/rtl/tsan_interceptors.h compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp compiler-rt/lib/tsan/rtl/tsan_rtl.cpp compiler-rt/lib/tsan/rtl/tsan_rtl.h
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/lib/tsan/rtl/tsan_flags.cpp b/compiler-rt/lib/tsan/rtl/tsan_flags.cpp
index 50632d201..c7413b0cc 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_flags.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_flags.cpp
@@ -24,7 +24,7 @@
namespace __sanitizer {
template <>
-inline bool FlagHandler<LockDuringWriteSetting>::Parse(const char *value) {
+inline bool FlagHandler<LockDuringWriteSetting>::Parse(const char* value) {
if (internal_strcmp(value, "on") == 0) {
*t_ = kLockDuringAllWrites;
return true;
@@ -42,7 +42,7 @@ inline bool FlagHandler<LockDuringWriteSetting>::Parse(const char *value) {
}
template <>
-inline bool FlagHandler<LockDuringWriteSetting>::Format(char *buffer,
+inline bool FlagHandler<LockDuringWriteSetting>::Format(char* buffer,
uptr size) {
switch (*t_) {
case kLockDuringAllWrites:
``````````
</details>
https://github.com/llvm/llvm-project/pull/157928
More information about the llvm-commits
mailing list