[libcxx-commits] [PATCH] D125761: [libc++] Lets to_chars use header implementation.
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue May 31 09:36:43 PDT 2022
ldionne accepted this revision.
ldionne added inline comments.
This revision is now accepted and ready to land.
================
Comment at: libcxx/include/__config:119-120
# define _LIBCPP_ABI_BITSET_VECTOR_BOOL_CONST_SUBSCRIPT_RETURN_BOOL
+// Remove std::to_chars base 10 implementation from the dylib.
+// The implementation moved the header.
+# define _LIBCPP_ABI_DO_NOT_EXPORT_TO_CHARS_BASE_10
----------------
================
Comment at: libcxx/src/ryu/d2s.cpp:529
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c0, 2);
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __c1, 2);
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __d0, 2);
- _VSTD::memcpy(_Mid -= 2, __DIGIT_TABLE + __d1, 2);
+ _VSTD::memcpy(_Mid -= 2, __itoa::__digits_base_10 + __c0, 2);
+ _VSTD::memcpy(_Mid -= 2, __itoa::__digits_base_10 + __c1, 2);
----------------
To consider: If this increases our diff with "upstream" Ryu, it might be better to either `#define __DIGIT_TABLE __itoa::__digits_base_10`, or `static constexpr auto& __DIGIT_TABLE = __itoa::__digits_base_10;`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125761/new/
https://reviews.llvm.org/D125761
More information about the libcxx-commits
mailing list