aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-08 05:21:50 +0000
committerChris Lattner <sabre@nondot.org>2005-08-08 05:21:50 +0000
commit0fe34d89126c594e0e8378d978a593350189fedf (patch)
tree7bd937c3b941937c6e864aac00764c92b3a5efe7
parent287921d1889e101cb7f5cfa031a34ebe53a9a4a0 (diff)
add new helper function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22698 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/Instruction.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp
index 2bce2dcd22..342614ef47 100644
--- a/lib/VMCore/Instruction.cpp
+++ b/lib/VMCore/Instruction.cpp
@@ -65,6 +65,15 @@ void Instruction::eraseFromParent() {
getParent()->getInstList().erase(this);
}
+/// moveBefore - Unlink this instruction from its current basic block and
+/// insert it into the basic block that MovePos lives in, right before
+/// MovePos.
+void Instruction::moveBefore(Instruction *MovePos) {
+ MovePos->getParent()->getInstList().splice(MovePos,getParent()->getInstList(),
+ this);
+}
+
+
const char *Instruction::getOpcodeName(unsigned OpCode) {
switch (OpCode) {
// Terminators