[PATCH] D57835: Fix -ftime-report with -x ir

Fedor Sergeev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 15 15:24:47 PDT 2019


fedor.sergeev added a comment.

In D57835#1387622 <https://reviews.llvm.org/D57835#1387622>, @arsenm wrote:

> I partially solved the problem with double printing the reports.  It's from this in cc1_main:
>
>   // If any timers were active but haven't been destroyed yet, print theirp
>   // results now.  This happens in -disable-free mode.
>   llvm::TimerGroup::printAll(llvm::errs());
>   
>
> On a source file, -ftime-report  -disable-free prints one report. -ftime-report without disable-free prints 2. For the IR file, both happen either way and it double prints. The printing destructor can still be called from the ManagedStatic in PassTimingInfo


I dont quite understand what clang is doing in terms of timers (and what -disable-free is/how does it interact with -ftime-report).
However if after doing printAll() you expect that there wont be any other reports then you should call clearAll() immediately after.


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

https://reviews.llvm.org/D57835





More information about the cfe-commits mailing list