Skip to content
This repository was archived by the owner on Jan 1, 2023. It is now read-only.

Commit d886719

Browse files
committed
[Support] Make printAllJSONValues public, for custom output.
Summary: This changes the static method TimerGroup::printAllJSONValues from private to public, to match the static method TimerGroup::printAll. When trying to drive the reporting machinery by hand, the existing API is _almost_ flexible enough, but this entrypoint is required to intermix printing timers with other non-timer output. The underlying motive here is a Swift change to consolidate the collection of timers, LLVM statistics and other (non-assert-dependent) counters into JSON files, which requires a bit of manual intervention in LLVM's stat and timer output routines. See swiftlang/swift#8477 for details. Reviewers: MatzeB Reviewed By: MatzeB Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31566 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299371 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 7726df8 commit d886719

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/llvm/Support/Timer.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ class TimerGroup {
207207
/// This static method prints all timers and clears them all out.
208208
static void printAll(raw_ostream &OS);
209209

210+
/// Prints all timers as JSON key/value pairs, and clears them all out.
211+
static const char *printAllJSONValues(raw_ostream &OS, const char *delim);
212+
210213
/// Ensure global timer group lists are initialized. This function is mostly
211214
/// used by the Statistic code to influence the construction and destruction
212215
/// order of the global timer lists.
@@ -221,7 +224,6 @@ class TimerGroup {
221224
void printJSONValue(raw_ostream &OS, const PrintRecord &R,
222225
const char *suffix, double Value);
223226
const char *printJSONValues(raw_ostream &OS, const char *delim);
224-
static const char *printAllJSONValues(raw_ostream &OS, const char *delim);
225227
};
226228

227229
} // end namespace llvm

0 commit comments

Comments
 (0)