Statistic: Only print statistics on exit for -stats
Statistic: Only print statistics on exit for -stats

Previously enabling the statistics with EnableStatistics() would lead to
them getting printed to stderr/-info-output-file on exit. However
frontends may want a way to enable statistics and do the printing on
their own instead of the forced printing on exit.

This changes the code so that only the -stats option enables printing on
exit, EnableStatistics() only enables the tracking but requires invoking
one of the PrintStatistics() variants.

Differential Revision: https://reviews.llvm.org/D24819

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@282425 91177308-0d34-0410-b5e6-96231b3b80d8

apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm