[all-commits] [llvm/llvm-project] 035217: Allow signposts to take advantage of deferred stri...
adrian-prantl via All-commits
all-commits at lists.llvm.org
Mon Jun 14 16:53:57 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 035217ff515b8ecdc871e39fa840f3cba1b9cec7
https://github.com/llvm/llvm-project/commit/035217ff515b8ecdc871e39fa840f3cba1b9cec7
Author: Adrian Prantl <aprantl at apple.com>
Date: 2021-06-14 (Mon, 14 Jun 2021)
Changed paths:
M lldb/include/lldb/Utility/Timer.h
M lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
M lldb/source/Utility/Timer.cpp
M llvm/include/llvm/Support/Signposts.h
M llvm/lib/Support/Signposts.cpp
M llvm/lib/Support/Timer.cpp
Log Message:
-----------
Allow signposts to take advantage of deferred string substitution
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 uses 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.
This reapplies the previously reverted patch with additional include
order fixes for non-modular builds of LLDB.
Differential Revision: https://reviews.llvm.org/D103575
More information about the All-commits
mailing list