[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
Wed Jul 10 04:58:33 PDT 2024
================
@@ -250,29 +250,79 @@ class __basic_format_arg_value {
__handle __handle_;
};
+ // Visiting a value for formatting is dispatched via a function pointer to prevent
+ // unused formatters from being instantiated. This can lead to significant code size
+ // reductions on statically linked targets esp. at lower optimization levels.
+
+ void (__basic_format_arg_value::*__format_)(
+ basic_format_parse_context<_CharT>& __parse_ctx, _Context& __ctx, bool __parse) const;
----------------
mordante wrote:
yes size/performance before and with the changes. If you use your own files can you add them to the review? We can remove them later but it makes it easier to test the changes locally.
https://github.com/llvm/llvm-project/pull/98003
More information about the libcxx-commits
mailing list