From 395d41d0e9e93203c9c49ce4376a735f76de54b7 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sat, 25 Mar 2023 06:01:49 +1100 Subject: emu/profile.h: Hopefully convince clang that profile scope helpers are important even in non-profile builds. --- src/emu/profiler.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/emu/profiler.h b/src/emu/profiler.h index 1e672463e66..9145f4fb5f8 100644 --- a/src/emu/profiler.h +++ b/src/emu/profiler.h @@ -223,12 +223,15 @@ class dummy_profiler_state public: class scope { + private: + dummy_profiler_state &m_host; + public: scope(scope const &) = delete; scope &operator=(scope const &) = delete; scope(scope &&that) = default; - scope(dummy_profiler_state &host, profile_type type) { } - ~scope() = default; + scope(dummy_profiler_state &host, profile_type type) : m_host(host) { } + ~scope() { m_host.real_stop(); } void stop() { } }; @@ -244,6 +247,9 @@ public: // start/stop [[nodiscard]] auto start(profile_type type) { return scope(*this, type); } + +private: + void real_stop() { } }; -- cgit v1.2.3