Refactor TimeProfiler write methods (NFC)
authorAndrew Monshizadeh <amonshiz@gmail.com>
Fri, 6 Mar 2020 22:16:17 +0000 (14:16 -0800)
committerReid Kleckner <rnk@google.com>
Fri, 6 Mar 2020 22:34:56 +0000 (14:34 -0800)
commit3669f0ed4f962f253baa1c08256a3660aafbf9f1
tree8fd657be486fdda070c7bc51c8b2c70200c8e3b6
parentd43fcd0c0410d474a947cf51a3c67aa2e8d5a711
Refactor TimeProfiler write methods (NFC)

Added a write method for TimeTrace that takes two strings representing
file names. The first is any file name that may have been provided by the
user via `time-trace-file` flag, and the second is a fallback that should
be configured by the caller. This method makes it cleaner to write the
trace output because there is no longer a need to check file names at the
caller and simplifies future TimeTrace usages.

Reviewed By: modocache

Differential Revision: https://reviews.llvm.org/D74514
lld/ELF/Driver.cpp
llvm/include/llvm/Support/TimeProfiler.h
llvm/lib/Support/TimeProfiler.cpp