API changes for class Use size reduction, wave 1.
[oota-llvm.git] / include / llvm / BasicBlock.h
index 253a8fa1a06d1f18a5ad7824b81e907cd18554f9..797f50e86476e4fc6c19055b0323a9c5656bf693 100644 (file)
@@ -66,17 +66,22 @@ private :
   BasicBlock(const BasicBlock &);     // Do not implement
   void operator=(const BasicBlock &); // Do not implement
 
-public:
-  /// Instruction iterators...
-  typedef InstListType::iterator                              iterator;
-  typedef InstListType::const_iterator                  const_iterator;
-
   /// BasicBlock ctor - If the function parameter is specified, the basic block
   /// is automatically inserted at either the end of the function (if
   /// InsertBefore is null), or before the specified basic block.
   ///
   explicit BasicBlock(const std::string &Name = "", Function *Parent = 0,
-                      BasicBlock *InsertBefore = 0, BasicBlock *unwindDest = 0);
+                      BasicBlock *InsertBefore = 0, BasicBlock *UnwindDest = 0);
+public:
+  /// Instruction iterators...
+  typedef InstListType::iterator                              iterator;
+  typedef InstListType::const_iterator                  const_iterator;
+
+  // allocate space for exactly zero operands
+  static BasicBlock *Create(const std::string &Name = "", Function *Parent = 0,
+                            BasicBlock *InsertBefore = 0, BasicBlock *UnwindDest = 0) {
+    return new(!!UnwindDest) BasicBlock(Name, Parent, InsertBefore, UnwindDest);
+  }
   ~BasicBlock();
 
   /// getUnwindDest - Returns the BasicBlock that flow will enter if an unwind