diff --git a/lldb/include/lldb/Utility/Timer.h b/lldb/include/lldb/Utility/Timer.h index edc064b23b57..0249c697b8ed 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__)