Added an automatic cast to "std::ostream*" etc. from OStream. We then can
rework the hacks that had us passing OStream in. We pass in std::ostream*
instead, check for null, and then dispatch to the correct print() method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32636 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp
index 8f62396..2500d58 100644
--- a/lib/CodeGen/DwarfWriter.cpp
+++ b/lib/CodeGen/DwarfWriter.cpp
@@ -137,8 +137,8 @@
   }
   
 #ifndef NDEBUG
-  void print(OStream &O) const {
-    if (O.stream()) print(*O.stream());
+  void print(std::ostream *O) const {
+    if (O) print(*O);
   }
   void print(std::ostream &O) const {
     O << ".debug_" << Tag;
@@ -245,8 +245,8 @@
   void Emit(const Dwarf &DW) const; 
       
 #ifndef NDEBUG
-  void print(OStream &O) {
-    if (O.stream()) print(*O.stream());
+  void print(std::ostream *O) {
+    if (O) print(*O);
   }
   void print(std::ostream &O);
   void dump();
@@ -335,8 +335,8 @@
   void Profile(FoldingSetNodeID &ID) ;
       
 #ifndef NDEBUG
-  void print(OStream &O, unsigned IncIndent = 0) {
-    if (O.stream()) print(*O.stream(), IncIndent);
+  void print(std::ostream *O, unsigned IncIndent = 0) {
+    if (O) print(*O, IncIndent);
   }
   void print(std::ostream &O, unsigned IncIndent = 0);
   void dump();
@@ -386,8 +386,8 @@
   virtual void Profile(FoldingSetNodeID &ID) = 0;
       
 #ifndef NDEBUG
-  void print(OStream &O) {
-    if (O.stream()) print(*O.stream());
+  void print(std::ostream *O) {
+    if (O) print(*O);
   }
   virtual void print(std::ostream &O) = 0;
   void dump();