mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-07 01:38:26 +00:00
add a new insertAfter method, patch by Tom Jablin!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62158 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
acca9559f4
commit
3ff704fa2b
@ -384,6 +384,13 @@ public:
|
||||
return New;
|
||||
}
|
||||
|
||||
iterator insertAfter(iterator where, NodeTy *New) {
|
||||
if (empty())
|
||||
return insert(begin(), New);
|
||||
else
|
||||
return insert(++where, New);
|
||||
}
|
||||
|
||||
NodeTy *remove(iterator &IT) {
|
||||
assert(IT != end() && "Cannot remove end of list!");
|
||||
NodeTy *Node = &*IT;
|
||||
|
@ -101,6 +101,10 @@ public:
|
||||
/// immediately before the specified instruction.
|
||||
void insertBefore(Instruction *InsertPos);
|
||||
|
||||
/// insertAfter - Insert an unlinked instructions into a basic block
|
||||
/// immediately after the specified instruction.
|
||||
void insertAfter(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.
|
||||
|
@ -74,6 +74,12 @@ void Instruction::insertBefore(Instruction *InsertPos) {
|
||||
InsertPos->getParent()->getInstList().insert(InsertPos, this);
|
||||
}
|
||||
|
||||
/// insertAfter - Insert an unlinked instructions into a basic block
|
||||
/// immediately after the specified instruction.
|
||||
void Instruction::insertAfter(Instruction *InsertPos) {
|
||||
InsertPos->getParent()->getInstList().insertAfter(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