r212512 - Headers: conditionalise more declarations
Saleem Abdulrasool
compnerd at compnerd.org
Mon Jul 7 22:46:04 PDT 2014
Author: compnerd
Date: Tue Jul 8 00:46:04 2014
New Revision: 212512
URL: http://llvm.org/viewvc/llvm-project?rev=212512&view=rev
Log:
Headers: conditionalise more declarations
Protect MMX specific declarations under a __MMX__ guard. This header can be
included on non-x86 architectures (e.g. ARM) which do not support the MMX ISA.
Use the preprocessor to prevent these declarations from being processed.
Added:
cfe/trunk/test/Headers/arm-intrin.c
Modified:
cfe/trunk/lib/Headers/Intrin.h
Modified: cfe/trunk/lib/Headers/Intrin.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/Intrin.h?rev=212512&r1=212511&r2=212512&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/Intrin.h (original)
+++ cfe/trunk/lib/Headers/Intrin.h Tue Jul 8 00:46:04 2014
@@ -41,12 +41,14 @@
extern "C" {
#endif
+#if defined(__MMX__)
/* And the random ones that aren't in those files. */
__m64 _m_from_float(float);
__m64 _m_from_int(int _l);
void _m_prefetch(void *);
float _m_to_float(__m64);
int _m_to_int(__m64 _M);
+#endif
/* Other assorted instruction intrinsics. */
void __addfsbyte(unsigned long, unsigned char);
Added: cfe/trunk/test/Headers/arm-intrin.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/arm-intrin.c?rev=212512&view=auto
==============================================================================
--- cfe/trunk/test/Headers/arm-intrin.c (added)
+++ cfe/trunk/test/Headers/arm-intrin.c Tue Jul 8 00:46:04 2014
@@ -0,0 +1,6 @@
+// RUN: %clang -target armv7-windows -I %S/Inputs/include -Xclang -verify -E %s
+// expected-no-diagnostics
+
+typedef __SIZE_TYPE__ size_t;
+#include <Intrin.h>
+
More information about the cfe-commits
mailing list