[compiler-rt] 1962389 - [Sanitizer][Darwin] Add explanation for Apple platform macros

Julian Lettner via llvm-commits llvm-commits at lists.llvm.org
Mon May 23 11:59:50 PDT 2022


Author: Julian Lettner
Date: 2022-05-23T11:59:44-07:00
New Revision: 1962389979be0b755969311bd2630b4a1c15ac2c

URL: https://github.com/llvm/llvm-project/commit/1962389979be0b755969311bd2630b4a1c15ac2c
DIFF: https://github.com/llvm/llvm-project/commit/1962389979be0b755969311bd2630b4a1c15ac2c.diff

LOG: [Sanitizer][Darwin] Add explanation for Apple platform macros

Differential Revision: https://reviews.llvm.org/D126229

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/sanitizer_platform.h

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
index edf32843189c..66141dc09114 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
@@ -55,6 +55,13 @@
 #  define SANITIZER_SOLARIS 0
 #endif
 
+// - SANITIZER_APPLE: all Apple code
+//   - TARGET_OS_OSX: macOS
+//   - SANITIZER_IOS: devices (iOS and iOS-like)
+//     - SANITIZER_WATCHOS
+//     - SANITIZER_TVOS
+//   - SANITIZER_IOSSIM: simulators (iOS and iOS-like)
+//   - SANITIZER_DRIVERKIT
 #if defined(__APPLE__)
 #  define SANITIZER_APPLE 1
 // SANITIZER_MAC will be deprecated/removed in the future
@@ -93,11 +100,11 @@
 #else
 #  define SANITIZER_APPLE 0
 #  define SANITIZER_MAC SANITIZER_APPLE
+#  define SANITIZER_OSX 0
 #  define SANITIZER_IOS 0
 #  define SANITIZER_WATCHOS 0
 #  define SANITIZER_TVOS 0
 #  define SANITIZER_IOSSIM 0
-#  define SANITIZER_OSX 0
 #  define SANITIZER_DRIVERKIT 0
 #endif
 


        


More information about the llvm-commits mailing list