[PATCH] D36071: [compiler-rt] [builtins] Only include immintrin.h if it is used

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 30 23:26:10 PDT 2017

mstorsjo created this revision.
Herald added subscribers: kristof.beyls, dberris, aemerson.

This fixes building emutls.c for Windows on ARM/MinGW with clang.



Index: lib/builtins/emutls.c
--- lib/builtins/emutls.c
+++ lib/builtins/emutls.c
@@ -102,7 +102,6 @@
 #include <malloc.h>
 #include <stdio.h>
 #include <assert.h>
-#include <immintrin.h>
 static LPCRITICAL_SECTION emutls_mutex;
 static DWORD emutls_tls_index = TLS_OUT_OF_INDEXES;
@@ -203,6 +202,7 @@
 /* Provide atomic load/store functions for emutls_get_index if built with MSVC.
 #if !defined(__ATOMIC_RELEASE)
+#include <immintrin.h>
 enum { __ATOMIC_ACQUIRE = 2, __ATOMIC_RELEASE = 3 };

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36071.108862.patch
Type: text/x-patch
Size: 571 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170731/310e56f9/attachment.bin>

More information about the llvm-commits mailing list