From: Matthias Braun Date: Wed, 15 Jun 2016 19:24:55 +0000 (+0000) Subject: cc1_main: Do not print statistics twice in -disable_free mode. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=64b34088df61c46c67c0e2e40ad51701c21d6e44;p=clang cc1_main: Do not print statistics twice in -disable_free mode. llvm statistics are currently printed when the destructor of a "static ManagedStatic 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 --- diff --git a/tools/driver/cc1_main.cpp b/tools/driver/cc1_main.cpp index df315b8c0a..d78a31e67a 100644 --- a/tools/driver/cc1_main.cpp +++ b/tools/driver/cc1_main.cpp @@ -126,8 +126,6 @@ int cc1_main(ArrayRef 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; }