diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/ADT/ilist.h | 7 | ||||
-rw-r--r-- | include/llvm/Instruction.h | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/ADT/ilist.h b/include/llvm/ADT/ilist.h index bd2fd0d..6619f0a 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; diff --git a/include/llvm/Instruction.h b/include/llvm/Instruction.h index 9a7f769..a9cc000 100644 --- a/include/llvm/Instruction.h +++ b/include/llvm/Instruction.h @@ -101,6 +101,10 @@ public: /// immediately before the specified instruction. void insertBefore(Instruction *InsertPos); + /// insertAfter - Insert an unlinked instructions into a basic block + /// immediately after the specified instruction. + void insertAfter(Instruction *InsertPos); + /// moveBefore - Unlink this instruction from its current basic block and /// insert it into the basic block that MovePos lives in, right before /// MovePos. |