aboutsummaryrefslogtreecommitdiff
path: root/lldb/packages/Python/lldbsuite
diff options
context:
space:
mode:
authorMike Crowe <mac@mcrowe.com>2023-06-26 18:24:45 +0000
committerPiotr Zegar <me@piotrzegar.pl>2023-06-26 19:05:02 +0000
commit83f875dc94d7a5cc9b2da32e2a7b1502e3b0640c (patch)
tree2c44c5901105f89fa03f52c4020ac33e9a4dc278 /lldb/packages/Python/lldbsuite
parent80ea480d6c03d46a0903fa863547827e705710f9 (diff)
downloadllvm-83f875dc94d7a5cc9b2da32e2a7b1502e3b0640c.zip
llvm-83f875dc94d7a5cc9b2da32e2a7b1502e3b0640c.tar.gz
llvm-83f875dc94d7a5cc9b2da32e2a7b1502e3b0640c.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 'lldb/packages/Python/lldbsuite')
0 files changed, 0 insertions, 0 deletions