File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -90,13 +90,16 @@ void SILBasicBlock::remove(SILInstruction *I) {
90
90
InstList.remove (I);
91
91
}
92
92
93
+ // / Returns the iterator following the erased instruction, STL-style.
93
94
SILBasicBlock::iterator SILBasicBlock::erase (SILInstruction *I) {
94
95
// Notify the delete handlers that this instruction is going away.
95
96
getModule ().notifyDeleteHandlers (&*I);
96
97
auto *F = getParent ();
97
- auto II = InstList.erase (I);
98
+ // LLVM does not currently implement ilist::erase correctly. Compensate.
99
+ iterator next = std::next (SILBasicBlock::iterator (I));
100
+ InstList.erase (I);
98
101
F->getModule ().deallocateInst (I);
99
- return II ;
102
+ return next ;
100
103
}
101
104
102
105
// / This method unlinks 'self' from the containing SILFunction and deletes it.
You can’t perform that action at this time.
0 commit comments