[support] Prepare TimeProfiler for cross-thread support
authormbs <mbs@modular.com>
Fri, 16 Sep 2022 16:20:10 +0000 (10:20 -0600)
committerJoe Loser <joeloser@fastmail.com>
Fri, 16 Sep 2022 16:20:18 +0000 (10:20 -0600)
commit7061a3f3f89df1d8ae0afc03550da2c4f0dfbe8b
tree3e43af4e73d726dd0556146362d248692ee9d486
parent9cbdef610339e2b762ba5fa98a4db044bba19d0d
[support] Prepare TimeProfiler for cross-thread support

This NFC prepares the TimeProfiler to support the construction
and completion of time profiling 'entries' across threads.

Add ClockType alias so we can change the clock in one place.
(trivial) Use c++ usings instead of typedefs
Rename Entry to TimeTraceProfilerEntry since this type will eventually become public.
Add an intro comment.
Add some smoke unit tests.

Reviewed By: russell.gallop, rriddle, lattner, jloser

Differential Revision: https://reviews.llvm.org/D133153
llvm/include/llvm/Support/TimeProfiler.h
llvm/lib/Support/TimeProfiler.cpp
llvm/unittests/Support/CMakeLists.txt
llvm/unittests/Support/TimeProfilerTest.cpp [new file with mode: 0644]