llvm-project/libcxx/test
Mark de Wever 555214cbcc [libc++][format][2/6] Adds a __output_iterator.
Instead of using a temporary `string` in `__vformat_to_wrapped` use a new
generic iterator. This aids to reduce the number of template instantions
and avoids using a `string` to buffer the entire formatted output.

This changes the type of `format_context` and `wformat_context`, this can
still be done since the code isn't ABI stable yet.

Several approaches have been evaluated:
- Using a __output_buffer base class with:
  - a put function to store the buffer in its internal buffer
  - a virtual flush function to copy the internal buffer to the output
- Using a `function` to forward the output operation to the output buffer,
  much like the next method.
- Using a type erased function point to store the data in the buffer.
The last version resulted in the best performance. For some cases there's
still a loss of speed over the original method. This loss many becomes
apparent when large strings are copied to a pointer like iterator, before
the compiler optimized this using `memcpy`.

Reviewed By: ldionne, vitaut, #libc

Differential Revision: https://reviews.llvm.org/D110495
2022-03-26 16:48:01 +01:00
..
configs [libc++][tests] Use CMake provided paths for includes and libdir instead of hardcoding them 2022-03-16 12:35:06 -04:00
libcxx [libc++][format][2/6] Adds a __output_iterator. 2022-03-26 16:48:01 +01:00
std [libc++][format][2/6] Adds a __output_iterator. 2022-03-26 16:48:01 +01:00
support [libc++] Add a lightweight overridable assertion handler 2022-03-23 15:35:46 -04:00
CMakeLists.txt [runtimes] Remove FOO_TARGET_TRIPLE, FOO_SYSROOT and FOO_GCC_TOOLCHAIN 2022-03-01 08:39:42 -05:00
lit.cfg.py [libc++] Allow specifying custom Lit config files 2020-06-18 10:06:04 -04:00