mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 13:11:39 +01:00
Add an insertBefore method for attaching previously unattached instructions,
such as those created by clone(), to a basic block. llvm-svn: 52424
This commit is contained in:
parent
609a53ac86
commit
79605db969
@ -102,6 +102,10 @@ public:
|
||||
///
|
||||
void eraseFromParent();
|
||||
|
||||
/// insertBefore - Insert an unlinked instructions into a basic block
|
||||
/// immediately before the specified instruction.
|
||||
void insertBefore(Instruction *InsertPos);
|
||||
|
||||
/// moveBefore - Unlink this instruction from its current basic block and
|
||||
/// insert it into the basic block that MovePos lives in, right before
|
||||
/// MovePos.
|
||||
|
@ -68,6 +68,12 @@ void Instruction::eraseFromParent() {
|
||||
getParent()->getInstList().erase(this);
|
||||
}
|
||||
|
||||
/// insertBefore - Insert an unlinked instructions into a basic block
|
||||
/// immediately before the specified instruction.
|
||||
void Instruction::insertBefore(Instruction *InsertPos) {
|
||||
InsertPos->getParent()->getInstList().insert(InsertPos, this);
|
||||
}
|
||||
|
||||
/// moveBefore - Unlink this instruction from its current basic block and
|
||||
/// insert it into the basic block that MovePos lives in, right before
|
||||
/// MovePos.
|
||||
|
Loading…
x
Reference in New Issue
Block a user