+Instruction *ilist_traits<Instruction>::createSentinel() {
+ return new DummyInst();
+}
+iplist<Instruction> &ilist_traits<Instruction>::getList(BasicBlock *BB) {
+ return BB->getInstList();
+}
+
+// Explicit instantiation of SymbolTableListTraits since some of the methods
+// are not in the public header file...
+template class SymbolTableListTraits<Instruction, BasicBlock, Function>;
+
+
+BasicBlock::BasicBlock(const std::string &Name, Function *Parent,
+ BasicBlock *InsertBefore)
+ : Value(Type::LabelTy, Value::BasicBlockVal, Name) {
+ // Initialize the instlist...
+ InstList.setItemParent(this);
+
+ // Make sure that we get added to a function
+ LeakDetector::addGarbageObject(this);
+
+ if (InsertBefore) {
+ assert(Parent &&
+ "Cannot insert block before another block with no function!");
+ Parent->getBasicBlockList().insert(InsertBefore, this);
+ } else if (Parent) {
+ Parent->getBasicBlockList().push_back(this);
+ }
+}
+
+