Skip to content

Commit a2fd8e1

Browse files
committed
PR: Prefix external API with dunderscores
1 parent 666c853 commit a2fd8e1

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

compiler-rt/lib/radsan/radsan.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@
1414

1515
extern "C" {
1616

17-
SANITIZER_INTERFACE_ATTRIBUTE void radsan_init() {
17+
SANITIZER_INTERFACE_ATTRIBUTE void __radsan_init() {
1818
__radsan::InitializeInterceptors();
1919
}
2020

21-
SANITIZER_INTERFACE_ATTRIBUTE void radsan_realtime_enter() {
21+
SANITIZER_INTERFACE_ATTRIBUTE void __radsan_realtime_enter() {
2222
__radsan::GetContextForThisThread().RealtimePush();
2323
}
2424

25-
SANITIZER_INTERFACE_ATTRIBUTE void radsan_realtime_exit() {
25+
SANITIZER_INTERFACE_ATTRIBUTE void __radsan_realtime_exit() {
2626
__radsan::GetContextForThisThread().RealtimePop();
2727
}
2828

29-
SANITIZER_INTERFACE_ATTRIBUTE void radsan_off() {
29+
SANITIZER_INTERFACE_ATTRIBUTE void __radsan_off() {
3030
__radsan::GetContextForThisThread().BypassPush();
3131
}
3232

33-
SANITIZER_INTERFACE_ATTRIBUTE void radsan_on() {
33+
SANITIZER_INTERFACE_ATTRIBUTE void __radsan_on() {
3434
__radsan::GetContextForThisThread().BypassPop();
3535
}
3636

compiler-rt/lib/radsan/radsan.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,33 @@ extern "C" {
1818
1919
A call to this method is added to the preinit array on Linux systems.
2020
*/
21-
SANITIZER_INTERFACE_ATTRIBUTE void radsan_init();
21+
SANITIZER_INTERFACE_ATTRIBUTE void __radsan_init();
2222

2323
/** Enter real-time context.
2424
2525
When in a real-time context, RADSan interceptors will error if realtime
2626
violations are detected. Calls to this method are injected at the code
2727
generation stage when RADSan is enabled.
2828
*/
29-
SANITIZER_INTERFACE_ATTRIBUTE void radsan_realtime_enter();
29+
SANITIZER_INTERFACE_ATTRIBUTE void __radsan_realtime_enter();
3030

3131
/** Exit the real-time context.
3232
3333
When not in a real-time context, RADSan interceptors will simply forward
3434
intercepted method calls to the real methods.
3535
*/
36-
SANITIZER_INTERFACE_ATTRIBUTE void radsan_realtime_exit();
36+
SANITIZER_INTERFACE_ATTRIBUTE void __radsan_realtime_exit();
3737

3838
/** Disable all RADSan error reporting.
3939
4040
Injected into the code if "nosanitize(realtime)" is on a function.
4141
*/
42-
SANITIZER_INTERFACE_ATTRIBUTE void radsan_off();
42+
SANITIZER_INTERFACE_ATTRIBUTE void __radsan_off();
4343

4444
/** Re-enable all RADSan error reporting.
4545
46-
The counterpart to `radsan_off`.
46+
The counterpart to `__radsan_off`.
4747
*/
48-
SANITIZER_INTERFACE_ATTRIBUTE void radsan_on();
48+
SANITIZER_INTERFACE_ATTRIBUTE void __radsan_on();
4949

5050
} // extern "C"

compiler-rt/lib/radsan/radsan_preinit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
// This code is linked into the main executable when -fsanitize=realtime is in
1919
// the link flags. It can only use exported interface functions.
2020
__attribute__((section(".preinit_array"),
21-
used)) void (*__local_radsan_preinit)(void) = radsan_init;
21+
used)) void (*__local_radsan_preinit)(void) = __radsan_init;
2222

2323
#endif

compiler-rt/lib/radsan/tests/radsan_test_functional.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,10 @@ TEST(TestRadsan, ThrowingAnExceptionDiesWhenRealtime) {
198198
TEST(TestRadsan, DoesNotDieIfTurnedOff) {
199199
std::mutex Mutex{};
200200
auto RealtimeUnsafeFunc = [&]() {
201-
radsan_off();
201+
__radsan_off();
202202
Mutex.lock();
203203
Mutex.unlock();
204-
radsan_on();
204+
__radsan_on();
205205
};
206206
RealtimeInvoke(RealtimeUnsafeFunc);
207207
}

compiler-rt/lib/radsan/tests/radsan_test_utilities.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
namespace radsan_testing {
1919

2020
template <typename Function> void RealtimeInvoke(Function &&Func) {
21-
radsan_realtime_enter();
21+
__radsan_realtime_enter();
2222
std::forward<Function>(Func)();
23-
radsan_realtime_exit();
23+
__radsan_realtime_exit();
2424
}
2525

2626
template <typename Function>

0 commit comments

Comments
 (0)