[llvm-commits] [compiler-rt] r149274 - in /compiler-rt/trunk/lib/asan: asan_allocator.cc asan_internal.h

Kostya Serebryany kcc at google.com
Mon Jan 30 12:55:02 PST 2012


Author: kcc
Date: Mon Jan 30 14:55:02 2012
New Revision: 149274

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

Modified:
    compiler-rt/trunk/lib/asan/asan_allocator.cc
    compiler-rt/trunk/lib/asan/asan_internal.h

Modified: compiler-rt/trunk/lib/asan/asan_allocator.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_allocator.cc?rev=149274&r1=149273&r2=149274&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_allocator.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_allocator.cc Mon Jan 30 14:55:02 2012
@@ -35,6 +35,10 @@
 #include "asan_thread.h"
 #include "asan_thread_registry.h"
 
+#ifdef _WIN32
+#include <intrin.h>
+#endif
+
 namespace __asan {
 
 #define  REDZONE FLAG_redzone
@@ -59,10 +63,6 @@
   return (a & (alignment - 1)) == 0;
 }
 
-#ifdef _WIN32
-#include <intrin.h>
-#endif
-
 static inline size_t Log2(size_t x) {
   CHECK(IsPowerOfTwo(x));
 #if defined(_WIN64)

Modified: compiler-rt/trunk/lib/asan/asan_internal.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_internal.h?rev=149274&r1=149273&r2=149274&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_internal.h (original)
+++ compiler-rt/trunk/lib/asan/asan_internal.h Mon Jan 30 14:55:02 2012
@@ -20,9 +20,7 @@
 
 #include <stdlib.h>  // for size_t, uintptr_t, etc.
 
-#if !defined(_WIN32)
-#include <stdint.h>  // for __WORDSIZE
-#else
+#if defined(_WIN32)
 // There's no <stdint.h> in Visual Studio 9, so we have to define [u]int*_t.
 typedef unsigned __int8  uint8_t;
 typedef unsigned __int16 uint16_t;
@@ -32,16 +30,8 @@
 typedef __int16          int16_t;
 typedef __int32          int32_t;
 typedef __int64          int64_t;
-
-// Visual Studio does not define ssize_t.
-#ifdef _WIN64
-typedef int64_t ssize_t;
-#define __WORDSIZE 64
 #else
-typedef int32_t ssize_t;
-#define __WORDSIZE 32
-#endif
-
+# include <stdint.h>  // for __WORDSIZE
 #endif  // _WIN32
 
 // If __WORDSIZE was undefined by the platform, define it in terms of the





More information about the llvm-commits mailing list