summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Instruction.cpp
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
commit24a0a43cb0c7f4bb14bf34a2571141cec4507b53 (patch)
tree706d91845da8db3bf947417983ce71509a8368be /llvm/lib/VMCore/Instruction.cpp
parent9dae86a54d1390194fac10433903b27294d8c2f4 (diff)
downloadbcm5719-llvm-24a0a43cb0c7f4bb14bf34a2571141cec4507b53.tar.gz
bcm5719-llvm-24a0a43cb0c7f4bb14bf34a2571141cec4507b53.zip
add new helper function
llvm-svn: 22698
Diffstat (limited to 'llvm/lib/VMCore/Instruction.cpp')
-rw-r--r--llvm/lib/VMCore/Instruction.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Instruction.cpp b/llvm/lib/VMCore/Instruction.cpp
index 2bce2dcd22c..342614ef475 100644
--- a/llvm/lib/VMCore/Instruction.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud