Skip to content

Commit fe3bb4b

Browse files
committed
clang-format
1 parent 60a85e9 commit fe3bb4b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,14 +701,15 @@ INTERCEPTOR(void, OSSpinLockLock, volatile OSSpinLock *lock) {
701701
#endif // SANITIZER_APPLE
702702

703703
#if SANITIZER_APPLE
704+
// _os_nospin_lock_lock may replace OSSpinLockLock due to deprecation macro.
704705
typedef volatile OSSpinLock *_os_nospin_lock_t;
705706

706707
INTERCEPTOR(void, _os_nospin_lock_lock, _os_nospin_lock_t lock) {
707708
__rtsan_notify_intercepted_call("_os_nospin_lock_lock");
708709
return REAL(_os_nospin_lock_lock)(lock);
709710
}
710-
#endif // SANITIZER_APPLE
711711
#pragma clang diagnostic pop // "-Wdeprecated-declarations"
712+
#endif // SANITIZER_APPLE
712713

713714
#if SANITIZER_APPLE
714715
INTERCEPTOR(void, os_unfair_lock_lock, os_unfair_lock_t lock) {

compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,16 +1109,16 @@ TEST(TestRtsanInterceptors, PthreadJoinDiesWhenRealtime) {
11091109
}
11101110

11111111
#if SANITIZER_APPLE
1112-
11131112
#pragma clang diagnostic push
11141113
// OSSpinLockLock is deprecated, but still in use in libc++
11151114
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
11161115
#undef OSSpinLockLock
11171116
extern "C" {
1118-
typedef int32_t OSSpinLock;
1119-
void OSSpinLockLock(volatile OSSpinLock *__lock);
1120-
typedef volatile OSSpinLock *_os_nospin_lock_t;
1121-
void _os_nospin_lock_lock(_os_nospin_lock_t lock);
1117+
typedef int32_t OSSpinLock;
1118+
void OSSpinLockLock(volatile OSSpinLock *__lock);
1119+
// _os_nospin_lock_lock may replace OSSpinLockLock due to deprecation macro.
1120+
typedef volatile OSSpinLock *_os_nospin_lock_t;
1121+
void _os_nospin_lock_lock(_os_nospin_lock_t lock);
11221122
}
11231123

11241124
TEST(TestRtsanInterceptors, OsSpinLockLockDiesWhenRealtime) {
@@ -1136,7 +1136,6 @@ TEST(TestRtsanInterceptors, OsNoSpinLockLockDiesWhenRealtime) {
11361136
ExpectRealtimeDeath(Func, "_os_nospin_lock_lock");
11371137
ExpectNonRealtimeSurvival(Func);
11381138
}
1139-
#endif // SANITIZER_APPLE
11401139
#pragma clang diagnostic pop //"-Wdeprecated-declarations"
11411140

11421141
TEST(TestRtsanInterceptors, OsUnfairLockLockDiesWhenRealtime) {
@@ -1147,6 +1146,7 @@ TEST(TestRtsanInterceptors, OsUnfairLockLockDiesWhenRealtime) {
11471146
ExpectRealtimeDeath(Func, "os_unfair_lock_lock");
11481147
ExpectNonRealtimeSurvival(Func);
11491148
}
1149+
#endif // SANITIZER_APPLE
11501150

11511151
#if SANITIZER_LINUX
11521152
TEST(TestRtsanInterceptors, SpinLockLockDiesWhenRealtime) {

0 commit comments

Comments
 (0)