r212512 - Headers: conditionalise more declarations

Reid Kleckner rnk at google.com
Tue Jul 8 13:00:27 PDT 2014


As mentioned on IRC, we should just merge this with
test/Headers/ms-intrin.cpp with another RUN line for WoA.


On Mon, Jul 7, 2014 at 10:46 PM, Saleem Abdulrasool <compnerd at compnerd.org>
wrote:

> 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>
> +
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140708/414a047e/attachment.html>


More information about the cfe-commits mailing list