Starting from r324788 timer groups aren't cleared automatically when
printed out. As a result some timer groups were printed one more time.
For example, "Pass execution timing report" was printed again in
`ManagedStatic<PassTimingInfo>` destructor, "DWARF Emission" in
`ManagedStatic<Name2PairMap> NamedGroupedTimers` destructor.
Fix by clearing timer groups manually.
Reviewers: thegameg, george.karpenkov
Reviewed By: thegameg
Subscribers: aprantl, jkorous, dexonsmith, ributzka, aras-p, cfe-commits
Differential Revision: https://reviews.llvm.org/D67683
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372191
91177308-0d34-0410-b5e6-
96231b3b80d8
// If any timers were active but haven't been destroyed yet, print their
// results now. This happens in -disable-free mode.
llvm::TimerGroup::printAll(llvm::errs());
+ llvm::TimerGroup::clearAll();
if (llvm::timeTraceProfilerEnabled()) {
SmallString<128> Path(Clang->getFrontendOpts().OutputFile);
// If any timers were active but haven't been destroyed yet, print their
// results now.
TimerGroup::printAll(errs());
+ TimerGroup::clearAll();
return !!Failed;
}
// If any timers were active but haven't been destroyed yet, print their
// results now. This happens in -disable-free mode.
llvm::TimerGroup::printAll(llvm::errs());
+ llvm::TimerGroup::clearAll();
#ifdef _WIN32
// Exit status should not be negative on Win32, unless abnormal termination.