[PATCH] D63284: [libc++] Keep __regex_word in sync with ctype_base

Mikhail Maltsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 14 02:01:49 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL363363: [libc++] Keep __regex_word in sync with ctype_base (authored by miyuki, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D63284?vs=204572&id=204725#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63284/new/

https://reviews.llvm.org/D63284

Files:
  libcxx/trunk/include/__locale
  libcxx/trunk/include/regex


Index: libcxx/trunk/include/regex
===================================================================
--- libcxx/trunk/include/regex
+++ libcxx/trunk/include/regex
@@ -1001,16 +1001,7 @@
     typedef locale                  locale_type;
     typedef ctype_base::mask        char_class_type;
 
-#if defined(__mips__) && defined(__GLIBC__)
-    static const char_class_type __regex_word = static_cast<char_class_type>(_ISbit(15));
-#elif defined(__NetBSD__)
-    // NetBSD defines classes up to 0x2000
-    // see sys/ctype_bits.h, _CTYPE_Q
-    static const char_class_type __regex_word = 0x8000;
-#else
-    static const char_class_type __regex_word = 0x80;
-#endif
-
+    static const char_class_type __regex_word = ctype_base::__regex_word;
 private:
     locale __loc_;
     const ctype<char_type>* __ct_;
Index: libcxx/trunk/include/__locale
===================================================================
--- libcxx/trunk/include/__locale
+++ libcxx/trunk/include/__locale
@@ -408,6 +408,11 @@
     static const mask punct  = _ISpunct;
     static const mask xdigit = _ISxdigit;
     static const mask blank  = _ISblank;
+#if defined(__mips__)
+    static const mask __regex_word = static_cast<char_class_type>(_ISbit(15));
+#else
+    static const mask __regex_word = 0x80;
+#endif
 #elif defined(_LIBCPP_MSVCRT_LIKE)
     typedef unsigned short mask;
     static const mask space  = _SPACE;
@@ -420,6 +425,7 @@
     static const mask punct  = _PUNCT;
     static const mask xdigit = _HEX;
     static const mask blank  = _BLANK;
+    static const mask __regex_word = 0x80;
 # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT
 #elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__)
 # ifdef __APPLE__
@@ -441,8 +447,12 @@
 
 # if defined(__NetBSD__)
     static const mask blank  = _CTYPE_BL;
+    // NetBSD defines classes up to 0x2000
+    // see sys/ctype_bits.h, _CTYPE_Q
+    static const mask __regex_word = 0x8000;
 # else
     static const mask blank  = _CTYPE_B;
+    static const mask __regex_word = 0x80;
 # endif
 #elif defined(__sun__) || defined(_AIX)
     typedef unsigned int mask;
@@ -456,6 +466,7 @@
     static const mask punct  = _ISPUNCT;
     static const mask xdigit = _ISXDIGIT;
     static const mask blank  = _ISBLANK;
+    static const mask __regex_word = 0x80;
 #elif defined(_NEWLIB_VERSION)
     // Same type as Newlib's _ctype_ array in newlib/libc/include/ctype.h.
     typedef char mask;
@@ -469,6 +480,7 @@
     static const mask punct  = _P;
     static const mask xdigit = _X | _N;
     static const mask blank  = _B;
+    static const mask __regex_word = 0x80;
 # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT
 # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA
 # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_XDIGIT
@@ -484,6 +496,7 @@
     static const mask punct  = 1<<7;
     static const mask xdigit = 1<<8;
     static const mask blank  = 1<<9;
+    static const mask __regex_word = 1<<10;
 #endif
     static const mask alnum  = alpha | digit;
     static const mask graph  = alnum | punct;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63284.204725.patch
Type: text/x-patch
Size: 3074 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190614/8617d8af/attachment.bin>


More information about the llvm-commits mailing list