[compiler-rt] [Sanitizer][NFC] Fix up comment in atomic_store of sanitizer_atomic_c… (PR #79740)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 28 00:36:31 PST 2024


https://github.com/Enna1 created https://github.com/llvm/llvm-project/pull/79740

…lang_*.h

>From 15a294c47a5b3f79f2ccfa22c05ed99b80739e95 Mon Sep 17 00:00:00 2001
From: Enna1 <xumingjie.enna1 at bytedance.com>
Date: Sun, 28 Jan 2024 16:32:33 +0800
Subject: [PATCH] [Sanitizer][NFC] Fix up comment in atomic_store of
 sanitizer_atomic_clang_*.h

---
 compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang_other.h | 2 +-
 compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang_x86.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang_other.h b/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang_other.h
index 4a39889e534a00..557082a636b879 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang_other.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang_other.h
@@ -63,7 +63,7 @@ inline void atomic_store(volatile T *a, typename T::Type v, memory_order mo) {
   DCHECK(!((uptr)a % sizeof(*a)));
 
   if (sizeof(*a) < 8 || sizeof(void*) == 8) {
-    // Assume that aligned loads are atomic.
+    // Assume that aligned stores are atomic.
     if (mo == memory_order_relaxed) {
       a->val_dont_use = v;
     } else if (mo == memory_order_release) {
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang_x86.h b/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang_x86.h
index 51597b49274128..b81a354d209872 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang_x86.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang_x86.h
@@ -76,7 +76,7 @@ inline void atomic_store(volatile T *a, typename T::Type v, memory_order mo) {
   DCHECK(!((uptr)a % sizeof(*a)));
 
   if (sizeof(*a) < 8 || sizeof(void*) == 8) {
-    // Assume that aligned loads are atomic.
+    // Assume that aligned stores are atomic.
     if (mo == memory_order_relaxed) {
       a->val_dont_use = v;
     } else if (mo == memory_order_release) {



More information about the llvm-commits mailing list