Extend comment on ParserMatchClass .td field, and add some missing
[oota-llvm.git] / include / llvm / BasicBlock.h
index d0bd25a0db45a02e36bbe8b88512459c98934e70..cc5c8355db0cf52fffe9aa7e947d362d14ce0d7c 100644 (file)
@@ -22,6 +22,7 @@
 namespace llvm {
 
 class TerminatorInst;
+struct LLVMContext;
 
 template<> struct ilist_traits<Instruction>
   : public SymbolTableListTraits<Instruction, BasicBlock> {
@@ -46,7 +47,7 @@ template<> struct ilist_traits<Instruction>
   Instruction *ensureHead(Instruction*) const { return createSentinel(); }
   static void noteHead(Instruction*, Instruction*) {}
 private:
-  mutable ILIST_NODE<Instruction> Sentinel;
+  mutable ilist_node<Instruction> Sentinel;
 };
 
 /// This represents a single basic block in LLVM. A basic block is simply a
@@ -82,9 +83,13 @@ private:
   /// 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,
+  explicit BasicBlock(const Twine &Name = "", Function *Parent = 0,
                       BasicBlock *InsertBefore = 0);
 public:
+  /// getContext - Get the context in which this basic block lives,
+  /// or null if it is not currently attached to a function.
+  LLVMContext &getContext() const;
+  
   /// Instruction iterators...
   typedef InstListType::iterator                              iterator;
   typedef InstListType::const_iterator                  const_iterator;
@@ -92,7 +97,7 @@ public:
   /// 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,
+  static BasicBlock *Create(const Twine &Name = "", Function *Parent = 0,
                             BasicBlock *InsertBefore = 0) {
     return new BasicBlock(Name, Parent, InsertBefore);
   }
@@ -227,7 +232,7 @@ public:
   /// cause a degenerate basic block to be formed, having a terminator inside of
   /// the basic block).
   ///
-  BasicBlock *splitBasicBlock(iterator I, const std::string &BBName = "");
+  BasicBlock *splitBasicBlock(iterator I, const Twine &BBName = "");
 };
 
 } // End llvm namespace