[all-commits] [llvm/llvm-project] cf9276: [libc++] Reduces std::to_chars instantiations.

mordante via All-commits all-commits at lists.llvm.org
Wed Jun 22 09:47:23 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cf927669eba9c768bfe3bf1cdebc7c03993831e8
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2022-06-22 (Wed, 22 Jun 2022)

  Changed paths:
    M libcxx/include/__type_traits/conditional.h
    M libcxx/include/charconv
    M libcxx/include/type_traits

  Log Message:
  [libc++] Reduces std::to_chars instantiations.

Instead of instantiating all functions called by std::to_chars for the
integral types only instantiate them for 32 and 64 bit integral types.
This results in a smaller binary when using different types.

In an example using the types: signed char, short, int, long, long long,
unsigned char, unsigned short, unsigned int, unsigned long, and
unsigned long long this saved 2792 bytes of code size. For libc++.so.1
is saves 688 bytes of code size (64-bit Linux).

This was discovered while investigating a solution for #52709.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D128215

More information about the All-commits mailing list