[llvm-commits] [compiler-rt] r149281 - in /compiler-rt/trunk/lib/asan: asan_mac.cc asan_procmaps.h

Kostya Serebryany kcc at google.com
Mon Jan 30 14:11:04 PST 2012


Author: kcc
Date: Mon Jan 30 16:11:04 2012
New Revision: 149281

URL: http://llvm.org/viewvc/llvm-project?rev=149281&view=rev
Log:
[asan] ifdef/include cleanup

Modified:
    compiler-rt/trunk/lib/asan/asan_mac.cc
    compiler-rt/trunk/lib/asan/asan_procmaps.h

Modified: compiler-rt/trunk/lib/asan/asan_mac.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_mac.cc?rev=149281&r1=149280&r2=149281&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_mac.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_mac.cc Mon Jan 30 16:11:04 2012
@@ -24,6 +24,7 @@
 
 #include <crt_externs.h>  // for _NSGetEnviron
 #include <mach-o/dyld.h>
+#include <mach-o/loader.h>
 #include <sys/mman.h>
 #include <sys/resource.h>
 #include <sys/ucontext.h>

Modified: compiler-rt/trunk/lib/asan/asan_procmaps.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_procmaps.h?rev=149281&r1=149280&r2=149281&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_procmaps.h (original)
+++ compiler-rt/trunk/lib/asan/asan_procmaps.h Mon Jan 30 16:11:04 2012
@@ -15,9 +15,6 @@
 #define ASAN_PROCMAPS_H
 
 #include "asan_internal.h"
-#if defined __APPLE__
-#include <mach-o/loader.h>
-#endif
 
 namespace __asan {
 
@@ -33,11 +30,6 @@
                               char filename[], size_t filename_size);
   ~AsanProcMaps();
  private:
-#if defined __APPLE__
-  template<uint32_t kLCSegment, typename SegmentCommand>
-  bool NextSegmentLoad(uintptr_t *start, uintptr_t *end, uintptr_t *offset,
-                       char filename[], size_t filename_size);
-#endif
   // Default implementation of GetObjectNameAndOffset.
   // Quite slow, because it iterates through the whole process map for each
   // lookup.
@@ -63,6 +55,9 @@
   size_t proc_self_maps_buff_len_;
   char *current_;
 #elif defined __APPLE__
+  template<uint32_t kLCSegment, typename SegmentCommand>
+  bool NextSegmentLoad(uintptr_t *start, uintptr_t *end, uintptr_t *offset,
+                       char filename[], size_t filename_size);
   int current_image_;
   uint32_t current_magic_;
   int current_load_cmd_count_;





More information about the llvm-commits mailing list