Revert BuildVectorSDNode related patches: 65426, 65427, and 65296.
[oota-llvm.git] / include / llvm / BasicBlock.h
index 47478f2009a15994525129d911877d9b72fc4206..780aca5ef6df3176d508aafe5f74142aff57d17a 100644 (file)
@@ -22,8 +22,6 @@
 namespace llvm {
 
 class TerminatorInst;
-template <class Term, class BB> class SuccIterator;  // Successor Iterator
-template <class Ptr, class USE_iterator> class PredIterator;
 
 template<> struct ilist_traits<Instruction>
   : public SymbolTableListTraits<Instruction, BasicBlock> {
@@ -74,7 +72,9 @@ public:
   typedef InstListType::iterator                              iterator;
   typedef InstListType::const_iterator                  const_iterator;
 
-  // allocate space for exactly zero operands
+  /// Create - Creates a new BasicBlock. If the Parent parameter is specified,
+  /// the basic block is automatically inserted at either the end of the
+  /// function (if InsertBefore is 0), or before the specified basic block.
   static BasicBlock *Create(const std::string &Name = "", Function *Parent = 0,
                             BasicBlock *InsertBefore = 0) {
     return new BasicBlock(Name, Parent, InsertBefore);
@@ -134,6 +134,16 @@ public:
     return const_cast<BasicBlock*>(this)->getSinglePredecessor();
   }
 
+  /// getUniquePredecessor - If this basic block has a unique predecessor block,
+  /// return the block, otherwise return a null pointer.
+  /// Note that unique predecessor doesn't mean single edge, there can be 
+  /// multiple edges from the unique predecessor to this block (for example 
+  /// a switch statement with multiple cases having the same destination).
+  BasicBlock *getUniquePredecessor();
+  const BasicBlock *getUniquePredecessor() const {
+    return const_cast<BasicBlock*>(this)->getUniquePredecessor();
+  }
+
   //===--------------------------------------------------------------------===//
   /// Instruction iterator methods
   ///
@@ -155,10 +165,6 @@ public:
   const InstListType &getInstList() const { return InstList; }
         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:
   static inline bool classof(const BasicBlock *) { return true; }
   static inline bool classof(const Value *V) {