For PR411:
[oota-llvm.git] / include / llvm / BasicBlock.h
index 551ca4d6c2ea8747c3ace703645d39d93905adb3..0ca8eae1a3ef01e1865083e111d85b594c55d162 100644 (file)
@@ -85,6 +85,11 @@ public:
         BasicBlock *getPrev()       { return Prev; }
   const BasicBlock *getPrev() const { return Prev; }
 
+  /// use_back - Specialize the methods defined in Value, as we know that an
+  /// BasicBlock can only be used by Instructions (specifically PHI and terms).
+  Instruction       *use_back()       { return cast<Instruction>(*use_begin());}
+  const Instruction *use_back() const { return cast<Instruction>(*use_begin());}
+  
   /// getTerminator() - If this is a well formed basic block, then this returns
   /// a pointer to the terminator instruction.  If it is not, then you get a
   /// null pointer back.
@@ -147,6 +152,7 @@ public:
         InstListType &getInstList()       { return InstList; }
 
   virtual void print(std::ostream &OS) const { print(OS, 0); }
+  void print(std::ostream *OS) const { if (OS) print(*OS); }
   void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const;
 
   /// Methods for support type inquiry through isa, cast, and dyn_cast: