[libcxx] r205138 - ARM64: use the alternate string layout on Apple platforms.

Dmitri Gribenko gribozavr at gmail.com
Sun Mar 30 06:35:24 PDT 2014


On Sun, Mar 30, 2014 at 12:34 PM, Tim Northover <tnorthover at apple.com> wrote:
> Author: tnorthover
> Date: Sun Mar 30 06:34:22 2014
> New Revision: 205138
>
> URL: http://llvm.org/viewvc/llvm-project?rev=205138&view=rev
> Log:
> ARM64: use the alternate string layout on Apple platforms.
>
> Modified:
>     libcxx/trunk/include/__config
>
> Modified: libcxx/trunk/include/__config
> URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=205138&r1=205137&r2=205138&view=diff
> ==============================================================================
> --- libcxx/trunk/include/__config (original)
> +++ libcxx/trunk/include/__config Sun Mar 30 06:34:22 2014
> @@ -203,6 +203,10 @@
>
>  #if defined(__clang__)
>
> +#if __APPLE__ && !defined(__i386__) && !defined(__x86_64__) && !defined(__arm__)
> +#define _LIBCPP_ALTERNATE_STRING_LAYOUT
> +#endif
> +
>  #if __has_feature(cxx_alignas)
>  #  define _ALIGNAS_TYPE(x) alignas(x)
>  #  define _ALIGNAS(x) alignas(x)

Hi Tim,

In this and the other commit to libc++, I think it is better to more
explicitly phrase the check for arm64 as

#if __APPLE__ && (defined(__arm64__) || defined(__aarch64__))

to avoid reverse logic.

Also, it is better to use defined(__APPLE__) to be consistent with the
rest of the file (and avoid warnings about using macros that are not
defined?)

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-commits mailing list