diff options
author | Chris Lattner <sabre@nondot.org> | 2006-09-23 04:03:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-09-23 04:03:45 +0000 |
commit | a71965b1adf6bfeddfd3b38fdf7df9b4412bc6c2 (patch) | |
tree | e8b1b797d470bf8ede84e56a383af087b5e94419 /lib/VMCore/BasicBlock.cpp | |
parent | f10c17f986f2986d0501046aa13a08db4886dd77 (diff) |
add method, correct comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30584 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/BasicBlock.cpp')
-rw-r--r-- | lib/VMCore/BasicBlock.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/VMCore/BasicBlock.cpp b/lib/VMCore/BasicBlock.cpp index 5ec497a88e..afdd79e6aa 100644 --- a/lib/VMCore/BasicBlock.cpp +++ b/lib/VMCore/BasicBlock.cpp @@ -103,14 +103,21 @@ void BasicBlock::eraseFromParent() { getParent()->getBasicBlockList().erase(this); } -/// moveBefore - Unlink this instruction from its current function and -/// insert it into the function that MovePos lives in, right before -/// MovePos. +/// moveBefore - Unlink this basic block from its current function and +/// insert it into the function that MovePos lives in, right before MovePos. void BasicBlock::moveBefore(BasicBlock *MovePos) { MovePos->getParent()->getBasicBlockList().splice(MovePos, getParent()->getBasicBlockList(), this); } +/// moveAfter - Unlink this basic block from its current function and +/// insert it into the function that MovePos lives in, right after MovePos. +void BasicBlock::moveAfter(BasicBlock *MovePos) { + Function::iterator I = MovePos; + MovePos->getParent()->getBasicBlockList().splice(++I, + getParent()->getBasicBlockList(), this); +} + TerminatorInst *BasicBlock::getTerminator() { if (InstList.empty()) return 0; |