summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/ilist.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-13 07:43:51 +0000
committerChris Lattner <sabre@nondot.org>2009-01-13 07:43:51 +0000
commit3ff704fa2b67d6c857142218c5aca3058b6239fc (patch)
tree0b5169e2b5954c3730fdb4cea98d534143f7d990 /include/llvm/ADT/ilist.h
parentacca9559f4fdf99de62537592d7d63409229857b (diff)
downloadllvm-3ff704fa2b67d6c857142218c5aca3058b6239fc.tar.gz
llvm-3ff704fa2b67d6c857142218c5aca3058b6239fc.tar.bz2
llvm-3ff704fa2b67d6c857142218c5aca3058b6239fc.tar.xz
add a new insertAfter method, patch by Tom Jablin!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62158 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/ilist.h')
-rw-r--r--include/llvm/ADT/ilist.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/ADT/ilist.h b/include/llvm/ADT/ilist.h
index bd2fd0df87..6619f0a71e 100644
--- a/include/llvm/ADT/ilist.h
+++ b/include/llvm/ADT/ilist.h
@@ -384,6 +384,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;