[Lldb-commits] [PATCH] D103575: Allow signposts to take advantage of deferred string substitution
Adrian Prantl via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Jun 2 17:29:24 PDT 2021
aprantl created this revision.
aprantl added reviewers: JDevlieghere, dsanders, jroelofs.
Herald added subscribers: dexonsmith, hiraditya.
aprantl requested review of this revision.
Herald added a project: LLVM.
This is more an RFC at this point. I'm curious about feedback!
One nice feature of the os_signpost API is that format string substitutions happen in the consumer, not the logging application. LLVM's current Signpost class doesn't take advantage of this though and instead always uses a static `"Begin/End %s" ` format string.
This patch is proof of concept for how to use variadic macros to allow the API to be used as intended. Unfortunately, the primary use-case I had in mind (the `LLDB_SCOPED_TIMER()` macro) does not get much better from this, because `__PRETTY_FUNCTION__` is *not* a macro, but a static string, so signposts created by `LLDB_SCOPED_TIMER()` still use a static `"%s"` format string. At least `LLDB_SCOPED_TIMERF()` works as intended.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 9583 bytes
Desc: not available
More information about the lldb-commits