aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/Statistic.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-23 08:43:55 +0000
committerChris Lattner <sabre@nondot.org>2009-08-23 08:43:55 +0000
commitd9ea85ab01fb0f2929ed50223d3758dceea8bcbd (patch)
treebd195c4fd5fbdee13ee748e36b288deaa8c06d15 /lib/Support/Statistic.cpp
parentb515d75856f58a8b3b71d782eb00916d686329ad (diff)
remove some uses of llvm/Support/Streams.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79842 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Statistic.cpp')
-rw-r--r--lib/Support/Statistic.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Support/Statistic.cpp b/lib/Support/Statistic.cpp
index 06496fae91..5ad569899e 100644
--- a/lib/Support/Statistic.cpp
+++ b/lib/Support/Statistic.cpp
@@ -24,16 +24,15 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/Streams.h"
+#include "llvm/Support/raw_ostream.h"
#include "llvm/System/Mutex.h"
#include "llvm/ADT/StringExtras.h"
#include <algorithm>
-#include <ostream>
#include <cstring>
using namespace llvm;
// GetLibSupportInfoOutputFile - Return a file stream to print our output on.
-namespace llvm { extern std::ostream *GetLibSupportInfoOutputFile(); }
+namespace llvm { extern raw_ostream *GetLibSupportInfoOutputFile(); }
/// -stats - Command line option to cause transformations to emit stats about
/// what they did.
@@ -96,7 +95,7 @@ StatisticInfo::~StatisticInfo() {
if (Stats.empty()) return;
// Get the stream to write to.
- std::ostream &OutStream = *GetLibSupportInfoOutputFile();
+ raw_ostream &OutStream = *GetLibSupportInfoOutputFile();
// Figure out how long the biggest Value and Name fields are.
unsigned MaxNameLen = 0, MaxValLen = 0;
@@ -125,8 +124,9 @@ StatisticInfo::~StatisticInfo() {
}
- OutStream << std::endl; // Flush the output stream...
+ OutStream << '\n'; // Flush the output stream...
+ OutStream.flush();
- if (&OutStream != cerr.stream() && &OutStream != cout.stream())
+ if (&OutStream != &outs() && &OutStream != &errs())
delete &OutStream; // Close the file.
}