[all-commits] [llvm/llvm-project] c2018f: [NFC][Support] Refactor FormatVariadic code. (#106...

Rahul Joshi via All-commits all-commits at lists.llvm.org
Thu Sep 5 09:01:41 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c2018fa40fd081a10af4f3294362db9634d9a282
      https://github.com/llvm/llvm-project/commit/c2018fa40fd081a10af4f3294362db9634d9a282
  Author: Rahul Joshi <rjoshi at nvidia.com>
  Date:   2024-09-05 (Thu, 05 Sep 2024)

  Changed paths:
    M llvm/include/llvm/Support/FormatCommon.h
    M llvm/include/llvm/Support/FormatVariadic.h
    M llvm/lib/Support/FormatVariadic.cpp
    M llvm/unittests/Support/FormatVariadicTest.cpp

  Log Message:
  -----------
  [NFC][Support] Refactor FormatVariadic code. (#106610)

- Rename `Align` field in ReplacementItem/FmtAlign to `Width` to 
  accurately reflect its use.
- Change both `Width` and `Index` in ReplacementItem to 32-bit int 
  instead of size_t (as 64-bits seems excessive in this context).
- Eliminate the use of `Empty` ReplacementType, and use the
  existing std::optional<> instead to indicate that.
- Eliminate some boilerplate type code in formatv().
- Eliminate the loop in `splitLiteralAndReplacement`. The existing
  code will never loop back.
- Directly use constructor instead of std::make_pair.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list