diff options
Diffstat (limited to 'llvm/lib/VMCore/Instruction.cpp')
-rw-r--r-- | llvm/lib/VMCore/Instruction.cpp | 9 |
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 |