[all-commits] [llvm/llvm-project] cf931d: [libc++][format] Improves compile-time diagnostics.

Mark de Wever via All-commits all-commits at lists.llvm.org
Tue Jul 18 11:46:22 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cf931d4fa56e38e0c806f5f628c5bab831a45991
      https://github.com/llvm/llvm-project/commit/cf931d4fa56e38e0c806f5f628c5bab831a45991
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2023-07-18 (Tue, 18 Jul 2023)

  Changed paths:
    M libcxx/include/__format/parser_std_format_spec.h

  Log Message:
  -----------
  [libc++][format] Improves compile-time diagnostics.

Then a std-format-spec option is invalid for a type the compile-time
validation will detect its usage and issue a diagnostic. Before it
validated after parsing the entire std-format-spec, which meant the
diagnostic was less precise. It would be possible to do this validation
run-time but that has a performance overhead. When using the format
family of functions, this would be unneeded overhead; the validation was
done at run-time. For the vformat family it would give better
diagnostics.

To avoid paying what you don't use, it has been decided to aim for the
better performance. It's more likely users will use the format family of
functions.

Depends on D155264

Reviewed By: #libc, ldionne

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




More information about the All-commits mailing list