aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Timer.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2021-06-11 15:18:25 -0700
committerAdrian Prantl <aprantl@apple.com>2021-06-11 16:35:43 -0700
commit541ccd1c1bb23e1e20a382844b35312c0caffd79 (patch)
treea8654906fa2061e39e4bcb3457801b804738f5f6 /llvm/lib/Support/Timer.cpp
parent0276cc742bfc0829a56dba043625510b0f61326a (diff)
downloadllvm-541ccd1c1bb23e1e20a382844b35312c0caffd79.zip
llvm-541ccd1c1bb23e1e20a382844b35312c0caffd79.tar.gz
llvm-541ccd1c1bb23e1e20a382844b35312c0caffd79.tar.bz2
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. Differential Revision: https://reviews.llvm.org/D103575
Diffstat (limited to 'llvm/lib/Support/Timer.cpp')
-rw-r--r--llvm/lib/Support/Timer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp
index 6e592db..8d421db 100644
--- a/llvm/lib/Support/Timer.cpp
+++ b/llvm/lib/Support/Timer.cpp
@@ -174,7 +174,7 @@ void Timer::stopTimer() {
Running = false;
Time += TimeRecord::getCurrentTime(false);
Time -= StartTime;
- Signposts->endInterval(this, getName());
+ Signposts->endInterval(this);
}
void Timer::clear() {