[libcxx-commits] [libcxx] bcca95d - [libc++] Refactor the selection of string's ABI in __config

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 21 14:54:16 PDT 2023


Author: Louis Dionne
Date: 2023-06-21T17:53:57-04:00
New Revision: bcca95da5ea3e3ff8a829f9e25004ac6b2464928

URL: https://github.com/llvm/llvm-project/commit/bcca95da5ea3e3ff8a829f9e25004ac6b2464928
DIFF: https://github.com/llvm/llvm-project/commit/bcca95da5ea3e3ff8a829f9e25004ac6b2464928.diff

LOG: [libc++] Refactor the selection of string's ABI in __config

This doesn't change the selection, but it expands the conditions to
add comments and make it clearer what's happening. It also removes a
-Wundef instance when we checked __ARM_ARCH_7K__ >= 2 without checking
that it is defined in the first place.

Differential Revision: https://reviews.llvm.org/D153413

Added: 
    

Modified: 
    libcxx/include/__config

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__config b/libcxx/include/__config
index 37fb7f77924f4..7e65dc61fb3e6 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -460,8 +460,17 @@ typedef __char32_t char32_t;
 
 #  if defined(_LIBCPP_COMPILER_CLANG_BASED)
 
-#    if defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) && (!defined(__arm__) || __ARM_ARCH_7K__ >= 2)
-#      define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
+#    if defined(__APPLE__)
+#      if defined(__i386__) || defined(__x86_64__)
+// use old string layout on x86_64 and i386
+#      elif defined(__arm__)
+// use old string layout on arm (which does not include aarch64/arm64), except on watch ABIs
+#        if defined(__ARM_ARCH_7K__) && __ARM_ARCH_7K__ >= 2
+#          define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
+#        endif
+#      else
+#        define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
+#      endif
 #    endif
 
 // Objective-C++ features (opt-in)


        


More information about the libcxx-commits mailing list