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 | 4091f4690aa8d0d5d2103e2cc0de4ee50200084e (patch) | |
tree | e4e59d51971a3d32e5a401bec10aa75548533dd3 /llvm/lib | |
parent | 1da0ab2f584d9afef67d7172d50d71f057a65189 (diff) | |
download | bcm5719-llvm-4091f4690aa8d0d5d2103e2cc0de4ee50200084e.tar.gz bcm5719-llvm-4091f4690aa8d0d5d2103e2cc0de4ee50200084e.zip |
add method, correct comment
llvm-svn: 30584
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/VMCore/BasicBlock.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/BasicBlock.cpp b/llvm/lib/VMCore/BasicBlock.cpp index 5ec497a88e6..afdd79e6aa4 100644 --- a/llvm/lib/VMCore/BasicBlock.cpp +++ b/llvm/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; |