[PATCH] D146771: [support] Provide overload to PrintNumber that use C++ types

Paul Kirth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 23 16:48:10 PDT 2023


paulkirth created this revision.
paulkirth added reviewers: jhenderson, junhee-yoo.
Herald added a subscriber: kristof.beyls.
Herald added a project: All.
paulkirth requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.

This attempts to address an issue with overload resolution for `PrintNumber`
with `size_t` parameters on Darwin, brought up in
https://reviews.llvm.org/D146492.

On Aarch64 Darwin, `uint64_t` has a different typedef than `size_t`
(e.g., `unsigned long long` vs. `unsigned long`), whereas on Linux and
Windows they are the same.

This commit also reverts the static_cast's added in
064e2497e2ebe9ac30ac96923a26a52484300fdf <https://reviews.llvm.org/rG064e2497e2ebe9ac30ac96923a26a52484300fdf>, since they are no longer
needed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146771

Files:
  llvm/include/llvm/Support/JSON.h
  llvm/include/llvm/Support/ScopedPrinter.h
  llvm/tools/llvm-readobj/ELFDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146771.507921.patch
Type: text/x-patch
Size: 6357 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230323/8ecbbb58/attachment.bin>


More information about the llvm-commits mailing list