r178117 - [lib/Headers] Break the module import cycle between _Builtin_intrinsics.sse and _Builtin_intrinsics.sse2

Argyrios Kyrtzidis akyrtzi at gmail.com
Tue Mar 26 22:12:34 PDT 2013


Author: akirtzidis
Date: Wed Mar 27 00:12:34 2013
New Revision: 178117

URL: http://llvm.org/viewvc/llvm-project?rev=178117&view=rev
Log:
[lib/Headers] Break the module import cycle between _Builtin_intrinsics.sse and _Builtin_intrinsics.sse2

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

Modified:
    cfe/trunk/lib/Headers/module.map
    cfe/trunk/lib/Headers/xmmintrin.h

Modified: cfe/trunk/lib/Headers/module.map
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/module.map?rev=178117&r1=178116&r2=178117&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/module.map (original)
+++ cfe/trunk/lib/Headers/module.map Wed Mar 27 00:12:34 2013
@@ -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"
     }
 

Modified: cfe/trunk/lib/Headers/xmmintrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/xmmintrin.h?rev=178117&r1=178116&r2=178117&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/xmmintrin.h (original)
+++ cfe/trunk/lib/Headers/xmmintrin.h Wed Mar 27 00:12:34 2013
@@ -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__ */
 





More information about the cfe-commits mailing list