[llvm-commits] CVS: llvm/lib/Support/Statistic.cpp SystemUtils.cpp Timer.cpp

Bill Wendling isanbard at gmail.com
Thu Dec 7 12:28:43 PST 2006



Changes in directory llvm/lib/Support:

Statistic.cpp updated: 1.20 -> 1.21
SystemUtils.cpp updated: 1.47 -> 1.48
Timer.cpp updated: 1.47 -> 1.48
---
Log message:

Removed more <iostream> includes


---
Diffs of the changes:  (+11 -12)

 Statistic.cpp   |    5 ++---
 SystemUtils.cpp |    4 ++--
 Timer.cpp       |   14 +++++++-------
 3 files changed, 11 insertions(+), 12 deletions(-)


Index: llvm/lib/Support/Statistic.cpp
diff -u llvm/lib/Support/Statistic.cpp:1.20 llvm/lib/Support/Statistic.cpp:1.21
--- llvm/lib/Support/Statistic.cpp:1.20	Wed Dec  6 12:20:44 2006
+++ llvm/lib/Support/Statistic.cpp	Thu Dec  7 14:28:15 2006
@@ -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...
   }
 }


Index: llvm/lib/Support/SystemUtils.cpp
diff -u llvm/lib/Support/SystemUtils.cpp:1.47 llvm/lib/Support/SystemUtils.cpp:1.48
--- llvm/lib/Support/SystemUtils.cpp:1.47	Wed Dec  6 19:30:31 2006
+++ llvm/lib/Support/SystemUtils.cpp	Thu Dec  7 14:28:15 2006
@@ -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"


Index: llvm/lib/Support/Timer.cpp
diff -u llvm/lib/Support/Timer.cpp:1.47 llvm/lib/Support/Timer.cpp:1.48
--- llvm/lib/Support/Timer.cpp:1.47	Wed Dec  6 11:46:32 2006
+++ llvm/lib/Support/Timer.cpp	Thu Dec  7 14:28:15 2006
@@ -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...
   }
 






More information about the llvm-commits mailing list