emu/profile.h: Hopefully convince clang that profile scope helpers are important even in non-profile builds.

This commit is contained in:
Vas Crabb 2023-03-25 06:01:49 +11:00
parent 5f97af903c
commit 395d41d0e9

View File

@ -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() { }
};