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
// 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;
}