diff gen/logger.h @ 994:18ad5601dff7

Use LLVM OStream wrapper instead of <iostream> in the logger. llvm::OStream provides all std::ostream functionality (by holding a std::ostream* internally), but * doesn't include <iostream>, avoiding per-file overhead. * allows the stream pointer to be null, and the (inlined) operators do nothing when that's the case. (This also allows removal of the ofstream("/dev/null") hack Logger used when disabled, which presumably wasn't very portable)
author Frits van Bommel <fvbommel wxs.nl>
date Thu, 26 Feb 2009 14:51:02 +0100
parents 1700239cab2e
children e7f0c2b48047
line wrap: on
line diff
--- a/gen/logger.h	Thu Feb 26 15:24:20 2009 +0100
+++ b/gen/logger.h	Thu Feb 26 14:51:02 2009 +0100
@@ -1,7 +1,7 @@
 #ifndef _llvmd_gen_logger_h_
 #define _llvmd_gen_logger_h_
 
-#include <iostream>
+#include "llvm/Support/Streams.h"
 
 struct Loc;
 
@@ -9,7 +9,7 @@
 {
     void indent();
     void undent();
-    std::ostream& cout();
+    llvm::OStream cout();
     void println(const char* fmt, ...);
     void print(const char* fmt, ...);
     void enable();