[PATCH] D21338: cc1_main: Do not print statistics in -disable_free mode.

Matthias Braun via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 14 13:13:47 PDT 2016


MatzeB created this revision.
MatzeB added reviewers: doug.gregor, bkramer.
MatzeB added a subscriber: cfe-commits.
MatzeB set the repository for this revision to rL LLVM.
Herald added a subscriber: mcrosier.

llvm statistics are currently printed when the destructor of a
"static ManagedStatic<StatisticInfo> StatInfo" in llvm runs.
This destructor currently runs in each case as part of llvm_shutdown()
which is run even in disable_free mode as part of main(). I assume that
this hasn't always been the case.

Removing the special code here avoids the statistics getting printed
twice.

Repository:
  rL LLVM

http://reviews.llvm.org/D21338

Files:
  tools/driver/cc1_main.cpp

Index: tools/driver/cc1_main.cpp
===================================================================
--- tools/driver/cc1_main.cpp
+++ tools/driver/cc1_main.cpp
@@ -126,8 +126,6 @@
 
   // When running with -disable-free, don't do any destruction or shutdown.
   if (Clang->getFrontendOpts().DisableFree) {
-    if (llvm::AreStatisticsEnabled() || Clang->getFrontendOpts().ShowStats)
-      llvm::PrintStatistics();
     BuryPointer(std::move(Clang));
     return !Success;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21338.60732.patch
Type: text/x-patch
Size: 479 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160614/317a1ef5/attachment.bin>


More information about the cfe-commits mailing list