This is an archive of the discontinued LLVM Phabricator instance.

[Support] Add a public API to allow clearing all (static) timer groups.
ClosedPublic

Authored by graydon on Aug 16 2018, 4:01 PM.

Details

Summary

Formerly, all timer groups were automatically cleared when printed out. In
https://reviews.llvm.org/rL324788 this behaviour was changed to not-clearing
timers on printout, to allow printing timers more than once, but as a result
clients (specifically Swift) that relied on the clear-on-print behaviour to
inhibit duplicate timer printing on shutdown were broken.

Rather than revert that change, this change adds a new API that enables
clients that _want_ to clear all timers to do so explicitly.

Diff Detail

Repository
rL LLVM

Event Timeline

graydon created this revision.Aug 16 2018, 4:01 PM
george.karpenkov accepted this revision.Aug 16 2018, 5:35 PM

Thanks for fixing up the comments!

Ideally, the test in Support/TimerTest should be updated as well, but I understand that it does not have any tests on TimerGroup yet.

This revision is now accepted and ready to land.Aug 16 2018, 5:35 PM
This revision was automatically updated to reflect the committed changes.