[PATCH] D38098: Removed platform-specific ifdefs from sanitizer_procmaps.h

Yicheng Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 20 13:51:30 PDT 2017


Vurchin created this revision.
Herald added subscribers: krytarowski, emaste.

Removed platform-specific ifdefs for linux, mac, freebsd and netbsd from sanitizer_procmaps.h


https://reviews.llvm.org/D38098

Files:
  lib/sanitizer_common/sanitizer_linux.h
  lib/sanitizer_common/sanitizer_procmaps.h
  lib/sanitizer_common/sanitizer_procmaps_common.cc
  lib/sanitizer_common/sanitizer_procmaps_freebsd.cc
  lib/sanitizer_common/sanitizer_procmaps_linux.cc


Index: lib/sanitizer_common/sanitizer_procmaps_linux.cc
===================================================================
--- lib/sanitizer_common/sanitizer_procmaps_linux.cc
+++ lib/sanitizer_common/sanitizer_procmaps_linux.cc
@@ -14,6 +14,7 @@
 #if SANITIZER_LINUX
 #include "sanitizer_common.h"
 #include "sanitizer_procmaps.h"
+#include "sanitizer_linux.h"
 
 namespace __sanitizer {
 
Index: lib/sanitizer_common/sanitizer_procmaps_freebsd.cc
===================================================================
--- lib/sanitizer_common/sanitizer_procmaps_freebsd.cc
+++ lib/sanitizer_common/sanitizer_procmaps_freebsd.cc
@@ -14,6 +14,7 @@
 #if SANITIZER_FREEBSD || SANITIZER_NETBSD
 #include "sanitizer_common.h"
 #if SANITIZER_FREEBSD
+#include "sanitizer_linux.h"
 #include "sanitizer_freebsd.h"
 #endif
 #include "sanitizer_procmaps.h"
Index: lib/sanitizer_common/sanitizer_procmaps_common.cc
===================================================================
--- lib/sanitizer_common/sanitizer_procmaps_common.cc
+++ lib/sanitizer_common/sanitizer_procmaps_common.cc
@@ -17,6 +17,7 @@
 #include "sanitizer_common.h"
 #include "sanitizer_placement_new.h"
 #include "sanitizer_procmaps.h"
+#include "sanitizer_linux.h"
 
 namespace __sanitizer {
 
Index: lib/sanitizer_common/sanitizer_procmaps.h
===================================================================
--- lib/sanitizer_common/sanitizer_procmaps.h
+++ lib/sanitizer_common/sanitizer_procmaps.h
@@ -20,10 +20,7 @@
 
 namespace __sanitizer {
 
-  struct MemoryMappingLayoutData;
-  struct ProcSelfMapsBuff;
-// Reads process memory map in an OS-specific way.
-void ReadProcMaps(ProcSelfMapsBuff *proc_maps);
+struct MemoryMappingLayoutData;
 
 // Memory protection masks.
 static const uptr kProtectionRead = 1;
Index: lib/sanitizer_common/sanitizer_linux.h
===================================================================
--- lib/sanitizer_common/sanitizer_linux.h
+++ lib/sanitizer_common/sanitizer_linux.h
@@ -28,6 +28,9 @@
 // the one in <dirent.h>, which is used by readdir().
 struct linux_dirent;
 
+struct ProcSelfMapsBuff;
+void ReadProcMaps(ProcSelfMapsBuff *proc_maps);
+
 // Syscall wrappers.
 uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
 uptr internal_sigaltstack(const void* ss, void* oss);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38098.116065.patch
Type: text/x-patch
Size: 2315 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170920/9ec4303d/attachment.bin>


More information about the llvm-commits mailing list