aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
diff options
context:
space:
mode:
authorMike Crowe <mac@mcrowe.com>2023-06-26 05:44:14 +0000
committerPiotr Zegar <me@piotrzegar.pl>2023-06-26 09:05:06 +0000
commitec89cb9a81529fd41fb37b8e62203a2e9f23bd54 (patch)
tree999ba543330f030beca8b59f573ab40f563ca957 /llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
parent3b85be3df23cfb8fb4d1f0656eac3214cf400c72 (diff)
downloadllvm-ec89cb9a81529fd41fb37b8e62203a2e9f23bd54.zip
llvm-ec89cb9a81529fd41fb37b8e62203a2e9f23bd54.tar.gz
llvm-ec89cb9a81529fd41fb37b8e62203a2e9f23bd54.tar.bz2
[clang-tidy] Add modernize-printf-to-std-print check
Add FormatStringConverter utility class that is capable of converting printf-style format strings into std::print-style format strings along with recording a set of casts to wrap the arguments as required and removing now-unnecessary calls to std::string::c_str() and std::string::data() Use FormatStringConverter to implement a new clang-tidy check that is capable of converting calls to printf, fprintf, absl::PrintF, absl::FPrintF, or any functions configured by an option to calls to std::print and std::println, or other functions configured by options. In other words, the check turns: fprintf(stderr, "The %s is %3d\n", description.c_str(), value); into: std::println(stderr, "The {} is {:3}", description, value); if it can. std::print and std::println can do almost anything that standard printf can, but the conversion has some some limitations that are described in the documentation. If conversion is not possible then the call remains unchanged. Depends on D153716 Reviewed By: PiotrZSL Differential Revision: https://reviews.llvm.org/D149280
Diffstat (limited to 'llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp')
0 files changed, 0 insertions, 0 deletions