]> granicus.if.org Git - clang/commitdiff
Add missing include guards into headers in lib/Headers. While it may appear
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sun, 14 Jul 2013 05:41:45 +0000 (05:41 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sun, 14 Jul 2013 05:41:45 +0000 (05:41 +0000)
that these headers should not be included more than once, they are in fact
included twice when building our builtins module (in order for it to generate
submodules for them), and without this, any modular build enabling AVX and
including any builtin header fails.

Testing this is tricky because including any of these headers in a modular
build is liable to fail, due to unrelated builtin headers in the same module
including headers which might not be available on the system running the tests.
Suggestion on that front are welcome (but we're getting close to being able to
run a buildbot that has modules enabled for all tests, which would nicely solve
the testing problem).

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

lib/Headers/avx2intrin.h
lib/Headers/avxintrin.h
lib/Headers/rdseedintrin.h
lib/Headers/rtmintrin.h

index 63b1efc1053746627ba26dfab18822a0288cfc16..1887fc80e630f2b1f96e39d706d38e5ae179b631 100644 (file)
@@ -25,6 +25,9 @@
 #error "Never use <avx2intrin.h> directly; include <immintrin.h> instead."
 #endif
 
+#ifndef __AVX2INTRIN_H
+#define __AVX2INTRIN_H
+
 /* SSE4 Multiple Packed Sums of Absolute Difference.  */
 #define _mm256_mpsadbw_epu8(X, Y, M) __builtin_ia32_mpsadbw256((X), (Y), (M))
 
@@ -1199,3 +1202,5 @@ _mm_srlv_epi64(__m128i __X, __m128i __Y)
   (__m256i)__builtin_ia32_gatherq_q256((__v4di)_mm256_setzero_si256(), \
              (const __v4di *)__m, (__v4di)__i, \
              (__v4di)_mm256_set1_epi64x(-1), (s)); })
+
+#endif /* __AVX2INTRIN_H */
index 0683a65facc97c332d7fe6642a39b16f21a1f044..f522ac72f24301ce6dacf2f1a49f2ba4855778dd 100644 (file)
@@ -25,6 +25,9 @@
 #error "Never use <avxintrin.h> directly; include <immintrin.h> instead."
 #endif
 
+#ifndef __AVXINTRIN_H
+#define __AVXINTRIN_H
+
 typedef double __v4df __attribute__ ((__vector_size__ (32)));
 typedef float __v8sf __attribute__ ((__vector_size__ (32)));
 typedef long long __v4di __attribute__ ((__vector_size__ (32)));
@@ -1220,3 +1223,5 @@ _mm256_storeu2_m128i(__m128i *__addr_hi, __m128i *__addr_lo, __m256i __a)
   __v128 = _mm256_extractf128_si256(__a, 1);
   __builtin_ia32_storedqu((char *)__addr_hi, (__v16qi)__v128);
 }
+
+#endif /* __AVXINTRIN_H */
index 54aabd177a1dd191040169c37220e9785556a12e..0fef1fa496802addd9b8dd4663ba9919366facf4 100644 (file)
@@ -25,6 +25,9 @@
 #error "Never use <rdseedintrin.h> directly; include <x86intrin.h> instead."
 #endif
 
+#ifndef __RDSEEDINTRIN_H
+#define __RDSEEDINTRIN_H
+
 #ifdef __RDSEED__
 static __inline__ int __attribute__((__always_inline__, __nodebug__))
 _rdseed16_step(unsigned short *__p)
@@ -46,3 +49,4 @@ _rdseed64_step(unsigned long long *__p)
 }
 #endif
 #endif /* __RDSEED__ */
+#endif /* __RDSEEDINTRIN_H */
index bdc2b994264fef11a269ac81a407bb68dfe73e0b..26149ca8522dd6cbc41846ad19e5923b1c7ca589 100644 (file)
@@ -25,6 +25,9 @@
 #error "Never use <rtmintrin.h> directly; include <immintrin.h> instead."
 #endif
 
+#ifndef __RTMINTRIN_H
+#define __RTMINTRIN_H
+
 #define _XBEGIN_STARTED   (~0u)
 #define _XABORT_EXPLICIT  (1 << 0)
 #define _XABORT_RETRY     (1 << 1)
@@ -47,3 +50,5 @@ _xend(void)
 }
 
 #define _xabort(imm) __builtin_ia32_xabort((imm))
+
+#endif /* __RTMINTRIN_H */