Fix some null checks to actually test the part that needs checking.
[oota-llvm.git] / include / llvm / Analysis / LoopInfo.h
index 238a0f627d470d1ed7a625eb759b575f2c1735d7..62f19e3c29eea69f35652146e1febcdae1dac875 100644 (file)
@@ -217,10 +217,10 @@ public:
   /// the mapping in the LoopInfo class.
   void removeBlockFromLoop(BasicBlock *BB);
 
-  void print(OStream &O, unsigned Depth = 0) const {
-    if (O.stream()) print(*O.stream(), Depth);
-  }
   void print(std::ostream &O, unsigned Depth = 0) const;
+  void print(std::ostream *O, unsigned Depth = 0) const {
+    if (O) print(*O, Depth);
+  }
   void dump() const;
 private:
   friend class LoopInfo;
@@ -283,10 +283,11 @@ public:
   virtual bool runOnFunction(Function &F);
 
   virtual void releaseMemory();
-  void print(OStream &O, const Module* = 0) const {
-    if (O.stream()) print(*O.stream());
-  }
+
   void print(std::ostream &O, const Module* = 0) const;
+  void print(std::ostream *O, const Module* M = 0) const {
+    if (O) print(*O, M);
+  }
 
   virtual void getAnalysisUsage(AnalysisUsage &AU) const;