Fix some null checks to actually test the part that needs checking.
[oota-llvm.git] / include / llvm / Analysis / LoopInfo.h
index b2bdde07d5cd75bda49f0714f2f2a5470aae31da..62f19e3c29eea69f35652146e1febcdae1dac875 100644 (file)
@@ -35,7 +35,7 @@
 
 namespace llvm {
 
-struct ETForest;
+class ETForest;
 class LoopInfo;
 class PHINode;
 class Instruction;
@@ -218,6 +218,9 @@ public:
   void removeBlockFromLoop(BasicBlock *BB);
 
   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;
@@ -280,7 +283,11 @@ public:
   virtual bool runOnFunction(Function &F);
 
   virtual void releaseMemory();
+
   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;