[compiler-rt] r178627 - [Sanitizer] Kill the remainders of platform defines in favor of SANITIZER_ defines

Alexey Samsonov samsonov at google.com
Wed Apr 3 00:24:36 PDT 2013


Author: samsonov
Date: Wed Apr  3 02:24:35 2013
New Revision: 178627

URL: http://llvm.org/viewvc/llvm-project?rev=178627&view=rev
Log:
[Sanitizer] Kill the remainders of platform defines in favor of SANITIZER_ defines

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_procmaps.h
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_itanium.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_linux.cc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_mac.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.cc?rev=178627&r1=178626&r2=178627&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_allocator.cc Wed Apr  3 02:24:35 2013
@@ -20,11 +20,11 @@ extern "C" void *__libc_malloc(__sanitiz
 extern "C" void __libc_free(void *ptr);
 # define LIBC_MALLOC __libc_malloc
 # define LIBC_FREE __libc_free
-#else  // __linux__ && !ANDROID
+#else  // SANITIZER_LINUX && !SANITIZER_ANDROID
 # include <stdlib.h>
 # define LIBC_MALLOC malloc
 # define LIBC_FREE free
-#endif  // __linux__ && !ANDROID
+#endif  // SANITIZER_LINUX && !SANITIZER_ANDROID
 
 namespace __sanitizer {
 

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc?rev=178627&r1=178626&r2=178627&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc Wed Apr  3 02:24:35 2013
@@ -767,4 +767,4 @@ void AdjustStackSizeLinux(void *attr_, i
 
 }  // namespace __sanitizer
 
-#endif  // __linux__
+#endif  // SANITIZER_LINUX

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc?rev=178627&r1=178626&r2=178627&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc Wed Apr  3 02:24:35 2013
@@ -341,4 +341,4 @@ void InitTlsSize() {
 
 }  // namespace __sanitizer
 
-#endif  // __APPLE__
+#endif  // SANITIZER_MAC

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc?rev=178627&r1=178626&r2=178627&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.cc Wed Apr  3 02:24:35 2013
@@ -34,7 +34,7 @@
 #if SANITIZER_LINUX
 #include <sys/vfs.h>
 #include <sys/epoll.h>
-#endif // __linux__
+#endif // SANITIZER_LINUX
 
 namespace __sanitizer {
   unsigned struct_utsname_sz = sizeof(struct utsname);
@@ -53,13 +53,13 @@ namespace __sanitizer {
   unsigned struct_statfs_sz = sizeof(struct statfs);
   unsigned struct_epoll_event_sz = sizeof(struct epoll_event);
   unsigned struct_timespec_sz = sizeof(struct timespec);
-#endif // __linux__
+#endif // SANITIZER_LINUX
 
 #if SANITIZER_LINUX && !SANITIZER_ANDROID
   unsigned struct_dirent64_sz = sizeof(struct dirent64);
   unsigned struct_rlimit64_sz = sizeof(struct rlimit64);
   unsigned struct_statfs64_sz = sizeof(struct statfs64);
-#endif // __linux__ && !__ANDROID__
+#endif // SANITIZER_LINUX && !SANITIZER_ANDROID
 
   void* __sanitizer_get_msghdr_iov_iov_base(void* msg, int idx) {
     return ((struct msghdr *)msg)->msg_iov[idx].iov_base;
@@ -80,4 +80,4 @@ namespace __sanitizer {
 
 COMPILER_CHECK(sizeof(__sanitizer_pthread_attr_t) >= sizeof(pthread_attr_t));
 
-#endif  // __linux__ || __APPLE__
+#endif  // SANITIZER_LINUX || SANITIZER_MAC

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h?rev=178627&r1=178626&r2=178627&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_limits_posix.h Wed Apr  3 02:24:35 2013
@@ -34,13 +34,13 @@ namespace __sanitizer {
   extern unsigned struct_statfs_sz;
   extern unsigned struct_epoll_event_sz;
   extern unsigned struct_timespec_sz;
-#endif // __linux__
+#endif // SANITIZER_LINUX
 
 #if SANITIZER_LINUX && !SANITIZER_ANDROID
   extern unsigned struct_dirent64_sz;
   extern unsigned struct_rlimit64_sz;
   extern unsigned struct_statfs64_sz;
-#endif // __linux__ && !__ANDROID__
+#endif // SANITIZER_LINUX && !SANITIZER_ANDROID
 
   void* __sanitizer_get_msghdr_iov_iov_base(void* msg, int idx);
   uptr __sanitizer_get_msghdr_iov_iov_len(void* msg, int idx);

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc?rev=178627&r1=178626&r2=178627&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_posix.cc Wed Apr  3 02:24:35 2013
@@ -230,4 +230,4 @@ int internal_isatty(fd_t fd) {
 
 }  // namespace __sanitizer
 
-#endif  // __linux__ || __APPLE_
+#endif  // SANITIZER_LINUX || __APPLE_

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_procmaps.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_procmaps.h?rev=178627&r1=178626&r2=178627&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_procmaps.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_procmaps.h Wed Apr  3 02:24:35 2013
@@ -98,14 +98,14 @@ class MemoryMappingLayout {
     return false;
   }
 
-# if defined __linux__
+# if SANITIZER_LINUX
   ProcSelfMapsBuff proc_self_maps_;
   char *current_;
 
   // Static mappings cache.
   static ProcSelfMapsBuff cached_proc_self_maps_;
   static StaticSpinMutex cache_lock_;  // protects cached_proc_self_maps_.
-# elif defined __APPLE__
+# elif SANITIZER_MAC
   template<u32 kLCSegment, typename SegmentCommand>
   bool NextSegmentLoad(uptr *start, uptr *end, uptr *offset,
                        char filename[], uptr filename_size,

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux.cc?rev=178627&r1=178626&r2=178627&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stoptheworld_linux.cc Wed Apr  3 02:24:35 2013
@@ -382,4 +382,4 @@ uptr SuspendedThreadsList::RegisterCount
 }
 }  // namespace __sanitizer
 
-#endif  // __linux__
+#endif  // SANITIZER_LINUX

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_itanium.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_itanium.cc?rev=178627&r1=178626&r2=178627&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_itanium.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_itanium.cc Wed Apr  3 02:24:35 2013
@@ -41,4 +41,4 @@ const char *__sanitizer::Demangle(const
   return MangledName;
 }
 
-#endif  // __APPLE__ || __linux__
+#endif  // SANITIZER_MAC || SANITIZER_LINUX

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_linux.cc?rev=178627&r1=178626&r2=178627&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_linux.cc Wed Apr  3 02:24:35 2013
@@ -28,7 +28,7 @@
 #include <sys/wait.h>
 #include <unistd.h>
 
-#if !SANITIZER_ANDROID && !SANITIZER_ANDROID
+#if !SANITIZER_ANDROID
 #include <link.h>
 #endif
 
@@ -123,11 +123,11 @@ bool StartSymbolizerSubprocess(const cha
   return true;
 }
 
-#if SANITIZER_ANDROID || SANITIZER_ANDROID
+#if SANITIZER_ANDROID
 uptr GetListOfModules(LoadedModule *modules, uptr max_modules) {
   UNIMPLEMENTED();
 }
-#else  // ANDROID
+#else  // SANITIZER_ANDROID
 typedef ElfW(Phdr) Elf_Phdr;
 
 struct DlIteratePhdrData {
@@ -177,8 +177,8 @@ uptr GetListOfModules(LoadedModule *modu
   dl_iterate_phdr(dl_iterate_phdr_cb, &data);
   return data.current_n;
 }
-#endif  // ANDROID
+#endif  // SANITIZER_ANDROID
 
 }  // namespace __sanitizer
 
-#endif  // __linux__
+#endif  // SANITIZER_LINUX

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_mac.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_mac.cc?rev=178627&r1=178626&r2=178627&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_mac.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_symbolizer_mac.cc Wed Apr  3 02:24:35 2013
@@ -25,10 +25,11 @@ bool StartSymbolizerSubprocess(const cha
 }
 
 uptr GetListOfModules(LoadedModule *modules, uptr max_modules) {
-  // FIXME: Actually implement this on Mac.
+  // FIXME: Actually implement this on Mac. Just using MemoryMappingLayout
+  // may be enough for this on Mac.
   return 0;
 }
 
 }  // namespace __sanitizer
 
-#endif  // __APPLE__
+#endif  // SANITIZER_MAC





More information about the llvm-commits mailing list