Add a helper method

llvm-svn: 22768
This commit is contained in:
Chris Lattner 2005-08-12 22:14:06 +00:00
parent 1344253e3f
commit e09bbc800c
1 changed files with 8 additions and 0 deletions

View File

@ -102,6 +102,14 @@ 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.
void BasicBlock::moveBefore(BasicBlock *MovePos) {
MovePos->getParent()->getBasicBlockList().splice(MovePos,
getParent()->getBasicBlockList(), this);
}
TerminatorInst *BasicBlock::getTerminator() {
if (InstList.empty()) return 0;