r185572 - Dont define __LONG_DOUBLE_128__ unless LongDoubleWidth is really 128bits width.

Bill Schmidt wschmidt at linux.vnet.ibm.com
Wed Jul 3 13:04:05 PDT 2013


On Wed, 2013-07-03 at 19:45 +0000, Roman Divacky wrote:
> Author: rdivacky
> Date: Wed Jul  3 14:45:54 2013
> New Revision: 185572
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=185572&view=rev
> Log:
> Dont define __LONG_DOUBLE_128__ unless LongDoubleWidth is really 128bits width.
> It's not the case on ie. FreeBSD.
> 
> Modified:
>     cfe/trunk/lib/Basic/Targets.cpp
>     cfe/trunk/test/Preprocessor/init.c
> 
> Modified: cfe/trunk/lib/Basic/Targets.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=185572&r1=185571&r2=185572&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Basic/Targets.cpp (original)
> +++ cfe/trunk/lib/Basic/Targets.cpp Wed Jul  3 14:45:54 2013
> @@ -877,7 +877,8 @@ void PPCTargetInfo::getTargetDefines(con
>    Builder.defineMacro("__REGISTER_PREFIX__", "");
> 
>    // FIXME: Should be controlled by command line option.
> -  Builder.defineMacro("__LONG_DOUBLE_128__");
> +  if (LongDoubleWidth == 128)
> +    Builder.defineMacro("__LONG_DOUBLE_128__");

Since long double is 64 bits on FreeBSD, it seems somewhat odd that
there is an f128:64:64 triple in its data layout string.  I assume that
is harmless, but I don't know enough about the uses of the data layout
strings to be sure...

> 
>    if (Opts.AltiVec) {
>      Builder.defineMacro("__VEC__", "10206");
> 
> Modified: cfe/trunk/test/Preprocessor/init.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/init.c?rev=185572&r1=185571&r2=185572&view=diff
> ==============================================================================
> --- cfe/trunk/test/Preprocessor/init.c (original)
> +++ cfe/trunk/test/Preprocessor/init.c Wed Jul  3 14:45:54 2013
> @@ -2826,3 +2826,5 @@
>  //
>  // RUN: %clang_cc1 -triple arm-linux-androideabi -E -dM < /dev/null | FileCheck -check-prefix ANDROID %s
>  // ANDROID: __ANDROID__ 1
> +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-unknown-freebsd < /dev/null | FileCheck -check-prefix PPC64-FREEBSD %s
> +// PPC64-FREEBSD-NOT: #define __LONG_DOUBLE_128__ 1
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 





More information about the cfe-commits mailing list