Skip to content

Commit 55e4c6d

Browse files
authored
[Instruction] Add missing implementation for moveAfter(InstListType::iterator) (#143093)
Commit 8e70273 introduced a declaration for `Instruction::moveAfter(InstListType::iterator)`. However, its implementation is missing. This PR adds it.
1 parent c3b870e commit 55e4c6d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

llvm/lib/IR/Instruction.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,22 @@ void Instruction::moveBeforePreserving(BasicBlock::iterator MovePos) {
191191

192192
void Instruction::moveAfter(Instruction *MovePos) {
193193
auto NextIt = std::next(MovePos->getIterator());
194-
// We want this instruction to be moved to before NextIt in the instruction
194+
// We want this instruction to be moved to after NextIt in the instruction
195195
// list, but before NextIt's debug value range.
196196
NextIt.setHeadBit(true);
197197
moveBeforeImpl(*MovePos->getParent(), NextIt, false);
198198
}
199199

200+
void Instruction::moveAfter(InstListType::iterator MovePos) {
201+
// We want this instruction to be moved to after NextIt in the instruction
202+
// list, but before NextIt's debug value range.
203+
MovePos.setHeadBit(true);
204+
moveBeforeImpl(*MovePos->getParent(), MovePos, false);
205+
}
206+
200207
void Instruction::moveAfterPreserving(Instruction *MovePos) {
201208
auto NextIt = std::next(MovePos->getIterator());
202-
// We want this instruction and its debug range to be moved to before NextIt
209+
// We want this instruction and its debug range to be moved to after NextIt
203210
// in the instruction list, but before NextIt's debug value range.
204211
NextIt.setHeadBit(true);
205212
moveBeforeImpl(*MovePos->getParent(), NextIt, true);

0 commit comments

Comments
 (0)