[compiler-rt] [compiler-rt][rtsan] NFC: Rename rtsan_on->rtsan_enable rtsan_off->rtsan_disable (PR #106727)
Chris Apple via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 30 06:28:28 PDT 2024
https://github.com/cjappl created https://github.com/llvm/llvm-project/pull/106727
This better matches lsan_enable and disable, which we are trying to emulate.
>From 3ddf387678ed390b403f61c7649841f0ed56f9a8 Mon Sep 17 00:00:00 2001
From: Chris Apple <cja-private at pm.me>
Date: Fri, 30 Aug 2024 06:26:54 -0700
Subject: [PATCH] [compiler-rt][rtsan] NFC: Rename rtsan_on->rtsan_enable
rtsan_off->rtsan_disable
---
compiler-rt/lib/rtsan/rtsan.cpp | 4 ++--
compiler-rt/lib/rtsan/rtsan.h | 6 +++---
compiler-rt/lib/rtsan/tests/rtsan_test_functional.cpp | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/compiler-rt/lib/rtsan/rtsan.cpp b/compiler-rt/lib/rtsan/rtsan.cpp
index 8a7ff03c611c65..b2c4616b5fd0dc 100644
--- a/compiler-rt/lib/rtsan/rtsan.cpp
+++ b/compiler-rt/lib/rtsan/rtsan.cpp
@@ -58,11 +58,11 @@ SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_realtime_exit() {
__rtsan::GetContextForThisThread().RealtimePop();
}
-SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_off() {
+SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_disable() {
__rtsan::GetContextForThisThread().BypassPush();
}
-SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_on() {
+SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_enable() {
__rtsan::GetContextForThisThread().BypassPop();
}
diff --git a/compiler-rt/lib/rtsan/rtsan.h b/compiler-rt/lib/rtsan/rtsan.h
index 3d665c98aed184..ae23609f97d2dc 100644
--- a/compiler-rt/lib/rtsan/rtsan.h
+++ b/compiler-rt/lib/rtsan/rtsan.h
@@ -38,11 +38,11 @@ SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_realtime_exit();
// Disable all RTSan error reporting.
// Injected into the code if "nosanitize(realtime)" is on a function.
-SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_off();
+SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_disable();
// Re-enable all RTSan error reporting.
-// The counterpart to `__rtsan_off`.
-SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_on();
+// The counterpart to `__rtsan_disable`.
+SANITIZER_INTERFACE_ATTRIBUTE void __rtsan_enable();
SANITIZER_INTERFACE_ATTRIBUTE void
__rtsan_expect_not_realtime(const char *intercepted_function_name);
diff --git a/compiler-rt/lib/rtsan/tests/rtsan_test_functional.cpp b/compiler-rt/lib/rtsan/tests/rtsan_test_functional.cpp
index 6e7ab016a4c6b2..5a86957170dcec 100644
--- a/compiler-rt/lib/rtsan/tests/rtsan_test_functional.cpp
+++ b/compiler-rt/lib/rtsan/tests/rtsan_test_functional.cpp
@@ -204,10 +204,10 @@ TEST(TestRtsan, ThrowingAnExceptionDiesWhenRealtime) {
TEST(TestRtsan, DoesNotDieIfTurnedOff) {
std::mutex mutex;
auto RealtimeUnsafeFunc = [&]() {
- __rtsan_off();
+ __rtsan_disable();
mutex.lock();
mutex.unlock();
- __rtsan_on();
+ __rtsan_enable();
};
RealtimeInvoke(RealtimeUnsafeFunc);
}
More information about the llvm-commits
mailing list