[PATCH] D59416: [Legacy][TimePasses] allow -time-passes reporting into a custom stream

Fedor Sergeev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 05:23:13 PDT 2019


fedor.sergeev marked 2 inline comments as done.
fedor.sergeev added inline comments.


================
Comment at: include/llvm/IR/PassTimingInfo.h:32
 /// If -time-passes has been specified, report the timings immediately and then
-/// reset the timers to zero.
-void reportAndResetTimings();
+/// reset the timers to zero. By default it uses info-output-file stream.
+void reportAndResetTimings(raw_ostream *OutStream = nullptr);
----------------
philip.pfaffe wrote:
> Sorry, this second nit got lost: Is it clear from context what `info-output-file` is? Otherwise reference `CreateInfoOutputFile()` instead.
Well, both of these would require a search through sources if you do not know what it is.
info-output-file is a command-line level control, CreateInfoOutputFile is an API control.
I really do not have any preferences here.


================
Comment at: unittests/IR/TimePassesTest.cpp:29
+
+namespace {
+struct Pass1 : public ModulePass {
----------------
philip.pfaffe wrote:
> Is this one still necessary?
well... as I see it is quite common through the unittests to use anonymous namespaces to hide test stuff
(I gather to avoid any clashes with LLVM interfaces).
Say, LegacyPassManagerTest does pretty much the same.
Its just that weird requirement of INITIALIZE_PASS for legacy passes to be inside namespace llvm that requires
extra namespace busywork.

I'm open for any suggestions here.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59416/new/

https://reviews.llvm.org/D59416





More information about the llvm-commits mailing list