From 564eb20e0deecd173a7b990dcfd0e57fb045c522 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Tue, 25 May 2021 17:21:01 -0700 Subject: [PATCH] Revert "[lldb] Avoid format string in LLDB_SCOPED_TIMER" Right after pushing, I remembered that this was added to silence a GCC warning (https://reviews.llvm.org/D99120). This reverts my patch and adds a comment. --- lldb/include/lldb/Utility/Timer.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lldb/include/lldb/Utility/Timer.h b/lldb/include/lldb/Utility/Timer.h index edc064b..0249c69 100644 --- a/lldb/include/lldb/Utility/Timer.h +++ b/lldb/include/lldb/Utility/Timer.h @@ -74,9 +74,11 @@ private: } // namespace lldb_private +// Use a format string because LLVM_PRETTY_FUNCTION might not be a string +// literal. #define LLDB_SCOPED_TIMER() \ static ::lldb_private::Timer::Category _cat(LLVM_PRETTY_FUNCTION); \ - ::lldb_private::Timer _scoped_timer(_cat, LLVM_PRETTY_FUNCTION) + ::lldb_private::Timer _scoped_timer(_cat, "%s", LLVM_PRETTY_FUNCTION) #define LLDB_SCOPED_TIMERF(...) \ static ::lldb_private::Timer::Category _cat(LLVM_PRETTY_FUNCTION); \ ::lldb_private::Timer _scoped_timer(_cat, __VA_ARGS__) -- 2.7.4