aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/BasicBlock.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-12 22:14:06 +0000
committerChris Lattner <sabre@nondot.org>2005-08-12 22:14:06 +0000
commit6a13aed525f586fc8f475ce17ce7f6cf77ddd2f4 (patch)
tree2fda09b5cffe3329712381a1d96410e1f5cbf29a /lib/VMCore/BasicBlock.cpp
parent07216eabb7e749dc38f521e73485db553cefc8d4 (diff)
Add a helper method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22768 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/BasicBlock.cpp')
-rw-r--r--lib/VMCore/BasicBlock.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/VMCore/BasicBlock.cpp b/lib/VMCore/BasicBlock.cpp
index 66344db150..ab7798c386 100644
--- a/lib/VMCore/BasicBlock.cpp
+++ b/lib/VMCore/BasicBlock.cpp
@@ -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;