[llvm] r208023 - Include intrin.h before windows.h as a workaround for the x64 self-host

Reid Kleckner reid at kleckner.net
Mon May 5 17:57:33 PDT 2014


Author: rnk
Date: Mon May  5 19:57:33 2014
New Revision: 208023

URL: http://llvm.org/viewvc/llvm-project?rev=208023&view=rev
Log:
Include intrin.h before windows.h as a workaround for the x64 self-host

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.

Modified:
    llvm/trunk/lib/Support/Atomic.cpp

Modified: llvm/trunk/lib/Support/Atomic.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Atomic.cpp?rev=208023&r1=208022&r2=208023&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Atomic.cpp (original)
+++ llvm/trunk/lib/Support/Atomic.cpp Mon May  5 19:57:33 2014
@@ -17,6 +17,7 @@
 using namespace llvm;
 
 #if defined(_MSC_VER)
+#include <Intrin.h>
 #include <windows.h>
 #undef MemoryFence
 #endif





More information about the llvm-commits mailing list