From 6e353b4df3aa452ed4741a5e5caea02b1a876d8c Mon Sep 17 00:00:00 2001 From: Volodymyr Sapsai Date: Wed, 18 Sep 2019 00:05:45 +0000 Subject: [Timers] Fix printing some `-ftime-report` sections twice. Fixes PR40328. 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` destructor, "DWARF Emission" in `ManagedStatic 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 llvm-svn: 372191 --- clang/tools/driver/driver.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/tools/driver/driver.cpp') diff --git a/clang/tools/driver/driver.cpp b/clang/tools/driver/driver.cpp index eebc8920fe0..f1600490017 100644 --- a/clang/tools/driver/driver.cpp +++ b/clang/tools/driver/driver.cpp @@ -499,6 +499,7 @@ int main(int argc_, const char **argv_) { // 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. -- cgit v1.2.3