[Sanitizers][Darwin] Rename Apple macro SANITIZER_MAC -> SANITIZER_APPLE

Initial introduction of the new macro before obsoleting the old one - the old name was really confusing.
Also moved SANITIZER_WATCHOS and SANITIZER_TVOS definitions under common #if defined(__APPLE__) block

Differential Revision: https://reviews.llvm.org/D125816
This commit is contained in:
Mariusz Borsa 2022-05-09 11:34:22 -07:00
parent dd7233bc67
commit 77014b9a13

View file

@ -56,7 +56,9 @@
#endif #endif
#if defined(__APPLE__) #if defined(__APPLE__)
# define SANITIZER_MAC 1 # define SANITIZER_APPLE 1
// SANITIZER_MAC will be deprecated/removed in the future
# define SANITIZER_MAC SANITIZER_APPLE
# include <TargetConditionals.h> # include <TargetConditionals.h>
# if TARGET_OS_OSX # if TARGET_OS_OSX
# define SANITIZER_OSX 1 # define SANITIZER_OSX 1
@ -68,30 +70,31 @@
# else # else
# define SANITIZER_IOS 0 # define SANITIZER_IOS 0
# endif # endif
# if TARGET_OS_WATCH
# define SANITIZER_WATCHOS 1
# else
# define SANITIZER_WATCHOS 0
# endif
# if TARGET_OS_TV
# define SANITIZER_TVOS 1
# else
# define SANITIZER_TVOS 0
# endif
# if TARGET_OS_SIMULATOR # if TARGET_OS_SIMULATOR
# define SANITIZER_IOSSIM 1 # define SANITIZER_IOSSIM 1
# else # else
# define SANITIZER_IOSSIM 0 # define SANITIZER_IOSSIM 0
# endif # endif
#else #else
# define SANITIZER_MAC 0 # define SANITIZER_APPLE 0
# define SANITIZER_MAC SANITIZER_APPLE
# define SANITIZER_IOS 0 # define SANITIZER_IOS 0
# define SANITIZER_WATCHOS 0
# define SANITIZER_TVOS 0
# define SANITIZER_IOSSIM 0 # define SANITIZER_IOSSIM 0
# define SANITIZER_OSX 0 # define SANITIZER_OSX 0
#endif #endif
#if defined(__APPLE__) && TARGET_OS_IPHONE && TARGET_OS_WATCH
# define SANITIZER_WATCHOS 1
#else
# define SANITIZER_WATCHOS 0
#endif
#if defined(__APPLE__) && TARGET_OS_IPHONE && TARGET_OS_TV
# define SANITIZER_TVOS 1
#else
# define SANITIZER_TVOS 0
#endif
#if defined(_WIN32) #if defined(_WIN32)
# define SANITIZER_WINDOWS 1 # define SANITIZER_WINDOWS 1
#else #else
@ -124,7 +127,7 @@
#endif #endif
#define SANITIZER_POSIX \ #define SANITIZER_POSIX \
(SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_MAC || \ (SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_APPLE || \
SANITIZER_NETBSD || SANITIZER_SOLARIS) SANITIZER_NETBSD || SANITIZER_SOLARIS)
#if __LP64__ || defined(_WIN64) #if __LP64__ || defined(_WIN64)
@ -286,7 +289,7 @@
#elif SANITIZER_RISCV64 #elif SANITIZER_RISCV64
# define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 38) # define SANITIZER_MMAP_RANGE_SIZE FIRST_32_SECOND_64(1ULL << 32, 1ULL << 38)
#elif defined(__aarch64__) #elif defined(__aarch64__)
# if SANITIZER_MAC # if SANITIZER_APPLE
# if SANITIZER_OSX || SANITIZER_IOSSIM # if SANITIZER_OSX || SANITIZER_IOSSIM
# define SANITIZER_MMAP_RANGE_SIZE \ # define SANITIZER_MMAP_RANGE_SIZE \
FIRST_32_SECOND_64(1ULL << 32, 1ULL << 47) FIRST_32_SECOND_64(1ULL << 32, 1ULL << 47)
@ -343,7 +346,7 @@
# define MSC_PREREQ(version) 0 # define MSC_PREREQ(version) 0
#endif #endif
#if SANITIZER_MAC && defined(__x86_64__) #if SANITIZER_APPLE && defined(__x86_64__)
# define SANITIZER_NON_UNIQUE_TYPEINFO 0 # define SANITIZER_NON_UNIQUE_TYPEINFO 0
#else #else
# define SANITIZER_NON_UNIQUE_TYPEINFO 1 # define SANITIZER_NON_UNIQUE_TYPEINFO 1
@ -371,7 +374,7 @@
# define SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT 0 # define SANITIZER_SUPPRESS_LEAK_ON_PTHREAD_EXIT 0
#endif #endif
#if SANITIZER_FREEBSD || SANITIZER_MAC || SANITIZER_NETBSD || SANITIZER_SOLARIS #if SANITIZER_FREEBSD || SANITIZER_APPLE || SANITIZER_NETBSD || SANITIZER_SOLARIS
# define SANITIZER_MADVISE_DONTNEED MADV_FREE # define SANITIZER_MADVISE_DONTNEED MADV_FREE
#else #else
# define SANITIZER_MADVISE_DONTNEED MADV_DONTNEED # define SANITIZER_MADVISE_DONTNEED MADV_DONTNEED
@ -395,7 +398,7 @@
// Enable ability to support sanitizer initialization that is // Enable ability to support sanitizer initialization that is
// compatible with the sanitizer library being loaded via // compatible with the sanitizer library being loaded via
// `dlopen()`. // `dlopen()`.
#if SANITIZER_MAC #if SANITIZER_APPLE
# define SANITIZER_SUPPORTS_INIT_FOR_DLOPEN 1 # define SANITIZER_SUPPORTS_INIT_FOR_DLOPEN 1
#else #else
# define SANITIZER_SUPPORTS_INIT_FOR_DLOPEN 0 # define SANITIZER_SUPPORTS_INIT_FOR_DLOPEN 0