[Lldb-commits] [PATCH] D26243: Refactor Timer class

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 2 07:14:13 PDT 2016


labath created this revision.
labath added reviewers: tberghammer, clayborg.
labath added a subscriber: lldb-commits.
Herald added a subscriber: mgorny.

While removing TimeValue from this class I noticed a lot of room for small
simplifications here. Main are:

- instead of complicated start-stop dances to compute own time, each Timer just starts the timer once, and keeps track of the durations of child timers. Then the own time can be computed at the end by subtracting the two values.
- remove double accounting in TimerStack - the stack object already knows the number of timers.

The interface does not lend itself well to unit testing, but I have added a
couple of tests which can (and did) catch any obvious errors.


https://reviews.llvm.org/D26243

Files:
  include/lldb/Core/Timer.h
  source/Core/Timer.cpp
  unittests/Core/CMakeLists.txt
  unittests/Core/TimerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26243.76699.patch
Type: text/x-patch
Size: 10247 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20161102/d41096fa/attachment.bin>


More information about the lldb-commits mailing list