Fixed lint errors:
[oota-llvm.git] / include / llvm / ADT / ilist.h
index bd2fd0df87199828d7225fef5866a81dffd558e4..6bfc10009d16b8a15a7b6247c87d4b39de44bcd6 100644 (file)
@@ -370,7 +370,8 @@ public:
   }
 
   iterator insert(iterator where, NodeTy *New) {
-    NodeTy *CurNode = where.getNodePtrUnchecked(), *PrevNode = this->getPrev(CurNode);
+    NodeTy *CurNode = where.getNodePtrUnchecked();
+    NodeTy *PrevNode = this->getPrev(CurNode);
     this->setNext(New, CurNode);
     this->setPrev(New, PrevNode);
 
@@ -384,6 +385,13 @@ public:
     return New;
   }
 
+  iterator insertAfter(iterator where, NodeTy *New) {
+    if (empty()) 
+      return insert(begin(), New);
+    else
+      return insert(++where, New);
+  }
+
   NodeTy *remove(iterator &IT) {
     assert(IT != end() && "Cannot remove end of list!");
     NodeTy *Node = &*IT;
@@ -396,7 +404,7 @@ public:
       Head = NextNode;
     this->setPrev(NextNode, PrevNode);
     IT = NextNode;
-    removeNodeFromList(Node);  // Notify traits that we removed a node...
+    this->removeNodeFromList(Node);  // Notify traits that we removed a node...
 
     // Set the next/prev pointers of the current node to null.  This isn't
     // strictly required, but this catches errors where a node is removed from
@@ -415,7 +423,7 @@ public:
 
   // erase - remove a node from the controlled sequence... and delete it.
   iterator erase(iterator where) {
-    deleteNode(remove(where));
+    this->deleteNode(remove(where));
     return where;
   }