From 6f0c8f56a3f9ce6dfadd4a483435d0388f5f83ad Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Fri, 12 Sep 2025 05:50:18 +0000 Subject: [PATCH] Convert btorf()/infof() to C++ stringf machinery --- backends/btor/btor.cc | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/backends/btor/btor.cc b/backends/btor/btor.cc index c2b831a44..aa95c512e 100644 --- a/backends/btor/btor.cc +++ b/backends/btor/btor.cc @@ -102,20 +102,16 @@ struct BtorWorker PrettyJson ywmap_json; - void btorf(const char *fmt, ...) YS_ATTRIBUTE(format(printf, 2, 3)) + template + void btorf(FmtString...> fmt, const Args &... args) { - va_list ap; - va_start(ap, fmt); - f << indent << vstringf(fmt, ap); - va_end(ap); + f << indent << fmt.format(args...); } - void infof(const char *fmt, ...) YS_ATTRIBUTE(format(printf, 2, 3)) + template + void infof(FmtString...> fmt, const Args &... args) { - va_list ap; - va_start(ap, fmt); - info_lines.push_back(vstringf(fmt, ap)); - va_end(ap); + info_lines.push_back(fmt.format(args...)); } template