Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions llvm/lib/IR/Instruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,22 @@ void Instruction::moveBeforePreserving(BasicBlock::iterator MovePos) {

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

void Instruction::moveAfter(InstListType::iterator MovePos) {
// We want this instruction to be moved to after NextIt in the instruction
// list, but before NextIt's debug value range.
MovePos.setHeadBit(true);
moveBeforeImpl(*MovePos->getParent(), MovePos, false);
}

void Instruction::moveAfterPreserving(Instruction *MovePos) {
auto NextIt = std::next(MovePos->getIterator());
// We want this instruction and its debug range to be moved to before NextIt
// We want this instruction and its debug range to be moved to after NextIt
// in the instruction list, but before NextIt's debug value range.
NextIt.setHeadBit(true);
moveBeforeImpl(*MovePos->getParent(), NextIt, true);
Expand Down