[libcxx-commits] [libcxx] [libc++] Add build flags to optimize <format> and <charconv> for code size. (PR #98003)

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 8 10:14:28 PDT 2024


================
@@ -274,6 +274,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __to_chars_integral_widt
 template <typename _Tp>
 inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
 __to_chars_integral(char* __first, char* __last, _Tp __value, int __base, false_type) {
+# ifndef _LIBCPP_CHARCONV_OPTIMIZE_SIZE
----------------
mordante wrote:

I'm not thrilled with this option. Options have a cost; they need to be tested in our CI to see whether the tests are passing when a option is added.  If you want to pursue this option I like to see the size it saves and the performance it costs. The dylib also contains part of this code, that should also be #ifdef'ed. I know you use LTO to strip the binary, but the library should not depend on that.

https://github.com/llvm/llvm-project/pull/98003


More information about the libcxx-commits mailing list