]> granicus.if.org Git - clang/commitdiff
cc1_main: Do not print statistics twice in -disable_free mode.
authorMatthias Braun <matze@braunis.de>
Wed, 15 Jun 2016 19:24:55 +0000 (19:24 +0000)
committerMatthias Braun <matze@braunis.de>
Wed, 15 Jun 2016 19:24:55 +0000 (19:24 +0000)
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.

Differential Revision: http://reviews.llvm.org/D21338

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272820 91177308-0d34-0410-b5e6-96231b3b80d8

tools/driver/cc1_main.cpp

index df315b8c0a63dfef6b9f9bf77e31582b9d4272d5..d78a31e67a2f94f2a45cbf84814b4f0d3826d141 100644 (file)
@@ -126,8 +126,6 @@ int cc1_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
 
   // 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;
   }