This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Abstract scoped timer logic behind LLDB_SCOPED_TIMER (NFC)
ClosedPublic

Authored by JDevlieghere on Dec 21 2020, 1:41 PM.

Details

Summary

This patch introduces a LLDB_SCOPED_TIMER macro to hide the needlessly repetitive creation of scoped timers in LLDB. It's similar to the LLDB_LOG(F) macro.

Diff Detail

Event Timeline

JDevlieghere created this revision.Dec 21 2020, 1:41 PM
JDevlieghere requested review of this revision.Dec 21 2020, 1:41 PM
mib accepted this revision.Dec 21 2020, 2:44 PM

LGTM.

This revision is now accepted and ready to land.Dec 21 2020, 2:44 PM

You can't put these declarations inside do {} while(0) -- the additional scope works against us in this case, and forces a premature timer termination. Other than that, this seems fine...

You can't put these declarations inside do {} while(0) -- the additional scope works against us in this case, and forces a premature timer termination. Other than that, this seems fine...

Wow, I totally did that on autopilot 🤡

Herald added a project: Restricted Project. · View Herald TranscriptDec 22 2020, 9:10 AM