diff options
| author | Kostya Serebryany <kcc@google.com> | 2012-01-30 20:55:02 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2012-01-30 20:55:02 +0000 |
| commit | 510850c34587d662631babfd1a5e10de113140c2 (patch) | |
| tree | 58f469ea5982bd881ac2ca8c4e6836b3974c1529 | |
| parent | 6291f3a43cadf12034be269c6a44da7e78141f49 (diff) | |
| download | bcm5719-llvm-510850c34587d662631babfd1a5e10de113140c2.tar.gz bcm5719-llvm-510850c34587d662631babfd1a5e10de113140c2.zip | |
[asan] minor ifdef cleanup
llvm-svn: 149274
| -rw-r--r-- | compiler-rt/lib/asan/asan_allocator.cc | 8 | ||||
| -rw-r--r-- | compiler-rt/lib/asan/asan_internal.h | 14 |
2 files changed, 6 insertions, 16 deletions
diff --git a/compiler-rt/lib/asan/asan_allocator.cc b/compiler-rt/lib/asan/asan_allocator.cc index 35d83521c34..3a8f9a7e910 100644 --- a/compiler-rt/lib/asan/asan_allocator.cc +++ b/compiler-rt/lib/asan/asan_allocator.cc @@ -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 @@ static inline bool IsAligned(uintptr_t a, uintptr_t alignment) { 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) diff --git a/compiler-rt/lib/asan/asan_internal.h b/compiler-rt/lib/asan/asan_internal.h index 5be5186fd17..fc92e9c0d16 100644 --- a/compiler-rt/lib/asan/asan_internal.h +++ b/compiler-rt/lib/asan/asan_internal.h @@ -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 __int8 int8_t; 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 |

