Skip to content

Commit 64161c3

Browse files
committed
Trigger delete notifications only when instructions are erased
We don't want to be notified when instructions are removed and later inserted at a different place, e.g. as part of SILInstruction::moveBefore.
1 parent 5e4bb4b commit 64161c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/SIL/SILBasicBlock.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ void SILBasicBlock::push_front(SILInstruction *I) {
7575
}
7676

7777
void SILBasicBlock::remove(SILInstruction *I) {
78-
// Notify the delete handlers that this instruction is going away.
79-
getModule().notifyDeleteHandlers(&*I);
8078
InstList.remove(I);
8179
}
8280

8381
void SILBasicBlock::erase(SILInstruction *I) {
82+
// Notify the delete handlers that this instruction is going away.
83+
getModule().notifyDeleteHandlers(&*I);
8484
InstList.erase(I);
8585
}
8686

0 commit comments

Comments
 (0)