[Legacy][TimePasses] allow -time-passes reporting into a custom stream
authorFedor Sergeev <fedor.sergeev@azul.com>
Fri, 22 Mar 2019 23:11:08 +0000 (23:11 +0000)
committerFedor Sergeev <fedor.sergeev@azul.com>
Fri, 22 Mar 2019 23:11:08 +0000 (23:11 +0000)
commitec74378e93febd5414f30cf2e833eb3ce9273717
tree3465f8b3e3ef2df73c9b6223042da0741b8c0cdc
parentb0ae52d814d7de99a06c45c8be43db7536434a94
[Legacy][TimePasses] allow -time-passes reporting into a custom stream

As a followup to newpm -time-passes fix (D59366), now adding a similar
functionality to legacy time-passes.

Enhancing llvm::reportAndResetTimings to accept an optional stream
for reporting output. By default it still reports into the stream created
by CreateInfoOutputFile (-info-output-file).

Also fixing to actually reset after printing as declared.

Reviewed By: philip.pfaffe
Differential Revision: https://reviews.llvm.org/D59416

llvm-svn: 356824
llvm/include/llvm/IR/PassTimingInfo.h
llvm/include/llvm/Support/Timer.h
llvm/lib/IR/PassTimingInfo.cpp
llvm/lib/Support/Timer.cpp
llvm/unittests/IR/TimePassesTest.cpp