Removed more <iostream> includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32321 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Support/Statistic.cpp b/lib/Support/Statistic.cpp
index 19cfff3..8c08271 100644
--- a/lib/Support/Statistic.cpp
+++ b/lib/Support/Statistic.cpp
@@ -23,9 +23,8 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Streams.h"
#include "llvm/ADT/StringExtras.h"
-#include <sstream>
-#include <iostream>
#include <algorithm>
using namespace llvm;
@@ -100,7 +99,7 @@
// Free all accumulated statistics...
delete AccumStats;
AccumStats = 0;
- if (OutStream != &std::cerr && OutStream != &std::cout)
+ if (OutStream != cerr.stream() && OutStream != cout.stream())
delete OutStream; // Close the file...
}
}
diff --git a/lib/Support/SystemUtils.cpp b/lib/Support/SystemUtils.cpp
index 1242511..1d2c108 100644
--- a/lib/Support/SystemUtils.cpp
+++ b/lib/Support/SystemUtils.cpp
@@ -16,12 +16,12 @@
#include "llvm/Support/SystemUtils.h"
#include "llvm/System/Process.h"
#include "llvm/System/Program.h"
-#include <iostream>
using namespace llvm;
bool llvm::CheckBytecodeOutputToConsole(std::ostream* stream_to_check,
bool print_warning) {
- if (stream_to_check == &std::cout && sys::Process::StandardOutIsDisplayed()) {
+ if (stream_to_check == cout.stream() &&
+ sys::Process::StandardOutIsDisplayed()) {
if (print_warning) {
cerr << "WARNING: You're attempting to print out a bytecode file.\n"
<< "This is inadvisable as it may cause display problems. If\n"
diff --git a/lib/Support/Timer.cpp b/lib/Support/Timer.cpp
index a39f169..077995d 100644
--- a/lib/Support/Timer.cpp
+++ b/lib/Support/Timer.cpp
@@ -14,11 +14,11 @@
#include "llvm/Support/Timer.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
+#include "llvm/Support/Streams.h"
#include "llvm/System/Process.h"
#include <algorithm>
#include <fstream>
#include <functional>
-#include <iostream>
#include <map>
using namespace llvm;
@@ -263,17 +263,17 @@
llvm::GetLibSupportInfoOutputFile() {
std::string &LibSupportInfoOutputFilename = getLibSupportInfoOutputFilename();
if (LibSupportInfoOutputFilename.empty())
- return &std::cerr;
+ return cerr.stream();
if (LibSupportInfoOutputFilename == "-")
- return &std::cout;
+ return cout.stream();
std::ostream *Result = new std::ofstream(LibSupportInfoOutputFilename.c_str(),
std::ios::app);
if (!Result->good()) {
- std::cerr << "Error opening info-output-file '"
- << LibSupportInfoOutputFilename << " for appending!\n";
+ cerr << "Error opening info-output-file '"
+ << LibSupportInfoOutputFilename << " for appending!\n";
delete Result;
- return &std::cerr;
+ return cerr.stream();
}
return Result;
}
@@ -342,7 +342,7 @@
TimersToPrint.clear();
- if (OutStream != &std::cerr && OutStream != &std::cout)
+ if (OutStream != cerr.stream() && OutStream != cout.stream())
delete OutStream; // Close the file...
}