Include intrin.h before windows.h as a workaround for the x64 self-host
authorReid Kleckner <reid@kleckner.net>
Tue, 6 May 2014 00:57:33 +0000 (00:57 +0000)
committerReid Kleckner <reid@kleckner.net>
Tue, 6 May 2014 00:57:33 +0000 (00:57 +0000)
On x64, windows.h doesn't include intrin.h for intrinsics.  It just
declares them in the global namespace and uses them, expecting the
compiler to lower it as a builtin.  We basically need to do this in
clang, eventually.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208023 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Atomic.cpp

index 9559ad729570d5c6814a43f825df4d17a5878d39..2ef32b08ef282d549d223bc2c8cc9d01595ac257 100644 (file)
@@ -17,6 +17,7 @@
 using namespace llvm;
 
 #if defined(_MSC_VER)
+#include <Intrin.h>
 #include <windows.h>
 #undef MemoryFence
 #endif