[PATCH] D58586: Clear TimerGroup to avoid redundant profile results

Takafumi Kubota via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 23 16:09:17 PST 2019


tk1012 created this revision.
tk1012 added a project: clang.
Herald added a subscriber: cfe-commits.

This patch clears out all timers just after printing all timers.


Repository:
  rC Clang

https://reviews.llvm.org/D58586

Files:
  clang/tools/driver/cc1_main.cpp
  clang/tools/driver/cc1as_main.cpp


Index: clang/tools/driver/cc1as_main.cpp
===================================================================
--- clang/tools/driver/cc1as_main.cpp
+++ clang/tools/driver/cc1as_main.cpp
@@ -590,6 +590,7 @@
   // If any timers were active but haven't been destroyed yet, print their
   // results now.
   TimerGroup::printAll(errs());
+  TimerGroup::clearAll();
 
   return !!Failed;
 }
Index: clang/tools/driver/cc1_main.cpp
===================================================================
--- clang/tools/driver/cc1_main.cpp
+++ clang/tools/driver/cc1_main.cpp
@@ -220,6 +220,7 @@
   // 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();
 
   // Our error handler depends on the Diagnostics object, which we're
   // potentially about to delete. Uninstall the handler now so that any


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58586.188064.patch
Type: text/x-patch
Size: 940 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190224/010f1afa/attachment.bin>


More information about the cfe-commits mailing list