summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compiler-rt/lib/asan/asan_allocator.cc4
-rw-r--r--compiler-rt/lib/asan/asan_allocator.h3
2 files changed, 3 insertions, 4 deletions
diff --git a/compiler-rt/lib/asan/asan_allocator.cc b/compiler-rt/lib/asan/asan_allocator.cc
index 4d422a7a9ac..8a37c8d24db 100644
--- a/compiler-rt/lib/asan/asan_allocator.cc
+++ b/compiler-rt/lib/asan/asan_allocator.cc
@@ -38,10 +38,6 @@
#include "sanitizer/asan_interface.h"
#include "sanitizer_common/sanitizer_atomic.h"
-#if defined(_WIN32) && !defined(__clang__)
-#include <intrin.h>
-#endif
-
namespace __asan {
#define REDZONE ((uptr)(flags()->redzone))
diff --git a/compiler-rt/lib/asan/asan_allocator.h b/compiler-rt/lib/asan/asan_allocator.h
index 1e936c3054a..79de7fe3a24 100644
--- a/compiler-rt/lib/asan/asan_allocator.h
+++ b/compiler-rt/lib/asan/asan_allocator.h
@@ -182,6 +182,9 @@ void asan_mz_force_lock();
void asan_mz_force_unlock();
// Log2 and RoundUpToPowerOfTwo should be inlined for performance.
+#if defined(_WIN32) && !defined(__clang__)
+#include <intrin.h>
+#endif
static inline uptr Log2(uptr x) {
CHECK(IsPowerOfTwo(x));
OpenPOWER on IntegriCloud