gccrs: Implement quick-check for Unicode
commit5eb4e5093aaf6964370b7daa231b926ca592eeb0
authorRaiki Tamura <tamaron1203@gmail.com>
Sat, 2 Dec 2023 12:01:59 +0000 (2 21:01 +0900)
committerArthur Cohen <arthur.cohen@embecosm.com>
Wed, 7 Feb 2024 11:40:21 +0000 (7 12:40 +0100)
tree85c7ea8c6d8fcfdaab10b2e3f5c4768c71b79ad3
parentf89186f962421f6d972035fc4b4c20490e7b1c5b
gccrs: Implement quick-check for Unicode

gcc/rust/ChangeLog:

* rust-lang.cc (run_rust_tests): Add test.
* rust-system.h: Add <algorithm>.
* util/make-rust-unicode.py: Output NFC_Quick_Check table.
* util/rust-codepoint.h (struct Codepoint): Add is_supplementary
method.
* util/rust-unicode-data.h: Generated.
* util/rust-unicode.cc (binary_search_sorted_array): Removed.
(lookup_cc): Remove namespace.
(is_alphabetic): Use std::binary_search
(nfc_quick_check): New function.
(nfc_normalize): Use nfc_quick_check.
(is_nfc_qc_maybe): New function.
(is_nfc_qc_no): New function.
(rust_nfc_qc_test): New test.
* util/rust-unicode.h (is_nfc_qc_no): New function.
(is_nfc_qc_maybe): New function.
(enum class): New enum class.
(nfc_quick_check): New function.
(rust_nfc_qc_test): New test.

Signed-off-by: Raiki Tamura <tamaron1203@gmail.com>
gcc/rust/rust-lang.cc
gcc/rust/rust-system.h
gcc/rust/util/make-rust-unicode.py
gcc/rust/util/rust-codepoint.h
gcc/rust/util/rust-unicode-data.h
gcc/rust/util/rust-unicode.cc
gcc/rust/util/rust-unicode.h