[compiler-rt] [scudo] Add missing thread-safety analysis annotations. (PR #68072)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 3 00:30:50 PDT 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 853e126ce32ac899e6be5d18c632a1814797ca79 bee8776a08f1c0008e15b4babd613de377bb7c8b -- compiler-rt/lib/scudo/standalone/tsd.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/lib/scudo/standalone/tsd.h b/compiler-rt/lib/scudo/standalone/tsd.h
index d41142a2c..7d9095d16 100644
--- a/compiler-rt/lib/scudo/standalone/tsd.h
+++ b/compiler-rt/lib/scudo/standalone/tsd.h
@@ -53,7 +53,8 @@ template <class Allocator> struct alignas(SCUDO_CACHE_LINE_SIZE) TSD {
inline void unlock() NO_THREAD_SAFETY_ANALYSIS { Mutex.unlock(); }
inline uptr getPrecedence() { return atomic_load_relaxed(&Precedence); }
- void commitBack(Allocator *Instance) ASSERT_CAPABILITY(Mutex) REQUIRES(Mutex) {
+ void commitBack(Allocator *Instance) ASSERT_CAPABILITY(Mutex)
+ REQUIRES(Mutex) {
Instance->commitBack(this);
}
@@ -66,7 +67,8 @@ template <class Allocator> struct alignas(SCUDO_CACHE_LINE_SIZE) TSD {
// TODO(chiahungduan): Ideally, we want to do `Mutex.assertHeld` but acquiring
// TSD doesn't always require holding the lock. Add this assertion while the
// lock is always acquired.
- typename Allocator::CacheT &getCache() ASSERT_CAPABILITY(Mutex) REQUIRES(Mutex) {
+ typename Allocator::CacheT &getCache() ASSERT_CAPABILITY(Mutex)
+ REQUIRES(Mutex) {
return Cache;
}
typename Allocator::QuarantineCacheT &getQuarantineCache()
``````````
</details>
https://github.com/llvm/llvm-project/pull/68072
More information about the llvm-commits
mailing list