summaryrefslogtreecommitdiffstats
path: root/llvm/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
commite09bbc800c90ca12f65926b8fd013f693c6f5525 (patch)
treece7d9d2fc5b413a19554e7d5f7ed54c9f8ba7b7f /llvm/lib/VMCore/BasicBlock.cpp
parent1344253e3ffd7176f6f2b028248bcaafffddd1f3 (diff)
downloadbcm5719-llvm-e09bbc800c90ca12f65926b8fd013f693c6f5525.tar.gz
bcm5719-llvm-e09bbc800c90ca12f65926b8fd013f693c6f5525.zip
Add a helper method
llvm-svn: 22768
Diffstat (limited to 'llvm/lib/VMCore/BasicBlock.cpp')
-rw-r--r--llvm/lib/VMCore/BasicBlock.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/BasicBlock.cpp b/llvm/lib/VMCore/BasicBlock.cpp
index 66344db1501..ab7798c3866 100644
--- a/llvm/lib/VMCore/BasicBlock.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud