]> granicus.if.org Git - clang/commitdiff
[lib/Headers] Break the module import cycle between _Builtin_intrinsics.sse and _Buil...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 27 Mar 2013 05:12:34 +0000 (05:12 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 27 Mar 2013 05:12:34 +0000 (05:12 +0000)
Module "sse" implicitly exports module "sse2".
This is bad because we also have module "sse2" export module "sse" (as intended) so we end up with a cycle
in the module import graph:
1. sse2 -> (also imports) sse
2. sse -> (also imports) sse2

To eliminate the cycle remove 2.; importing module "sse2" will also import module "sse", but just importing
module "sse" will not also import module "sse2".

rdar://13240552

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

lib/Headers/module.map
lib/Headers/xmmintrin.h

index b24bccc12056a70a7575a5872f22513a6cc9768d..1b476a5e554c801cc59f661a023fe76e865da779 100644 (file)
@@ -33,7 +33,6 @@ module _Builtin_intrinsics [system] {
     explicit module sse {
       requires sse
       export mmx
-      export * // note: for hackish <emmintrin.h> dependency
       header "xmmintrin.h"
     }
 
index b3b23cb7d0d4d6efc676c3296fa8f1ed5c45e4af..8c5fc9528cf0b7c641276f5ecf026bc7f7eb8704 100644 (file)
@@ -983,10 +983,12 @@ do { \
 #define _m_ _mm_
 #define _m_ _mm_
 
+#if !__has_feature(modules)
 /* Ugly hack for backwards-compatibility (compatible with gcc) */
 #ifdef __SSE2__
 #include <emmintrin.h>
 #endif
+#endif
 
 #endif /* __SSE__ */