aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/Statistic.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-30 05:01:08 +0000
committerChris Lattner <sabre@nondot.org>2010-03-30 05:01:08 +0000
commit49a2bb23d1391c8be45985518d4c5e99ff11b864 (patch)
tree4d82da3bf6130ae2a0bd7ca077e4db5fcfce1f40 /lib/Support/Statistic.cpp
parent9f9f6d19dd67926446fb89a7b2dc0bda6353645b (diff)
downloadexternal_llvm-49a2bb23d1391c8be45985518d4c5e99ff11b864.zip
external_llvm-49a2bb23d1391c8be45985518d4c5e99ff11b864.tar.gz
external_llvm-49a2bb23d1391c8be45985518d4c5e99ff11b864.tar.bz2
rename GetLibSupportInfoOutputFile -> CreateInfoOutputFile and
have it always return a new stream to simplify clients. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99874 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Statistic.cpp')
-rw-r--r--lib/Support/Statistic.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Support/Statistic.cpp b/lib/Support/Statistic.cpp
index f88094a..40589c5 100644
--- a/lib/Support/Statistic.cpp
+++ b/lib/Support/Statistic.cpp
@@ -32,8 +32,8 @@
#include <cstring>
using namespace llvm;
-// GetLibSupportInfoOutputFile - Return a file stream to print our output on.
-namespace llvm { extern raw_ostream *GetLibSupportInfoOutputFile(); }
+// CreateInfoOutputFile - Return a file stream to print our output on.
+namespace llvm { extern raw_ostream *CreateInfoOutputFile(); }
/// -stats - Command line option to cause transformations to emit stats about
/// what they did.
@@ -96,7 +96,7 @@ StatisticInfo::~StatisticInfo() {
if (Stats.empty()) return;
// Get the stream to write to.
- raw_ostream &OutStream = *GetLibSupportInfoOutputFile();
+ raw_ostream &OutStream = *CreateInfoOutputFile();
// Figure out how long the biggest Value and Name fields are.
unsigned MaxNameLen = 0, MaxValLen = 0;
@@ -125,9 +125,8 @@ StatisticInfo::~StatisticInfo() {
}
- OutStream << '\n'; // Flush the output stream...
+ OutStream << '\n'; // Flush the output stream.
OutStream.flush();
- if (&OutStream != &outs() && &OutStream != &errs())
- delete &OutStream; // Close the file.
+ delete &OutStream; // Close the file.
}