Skip to content

Commit 82a21eb

Browse files
committed
Sema: Undo changes in chronological order in SolverTrail::undo()
1 parent 3c3f4bb commit 82a21eb

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

lib/Sema/CSTrail.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -730,21 +730,10 @@ void SolverTrail::undo(unsigned toIndex) {
730730
ASSERT(!UndoActive);
731731
UndoActive = true;
732732

733-
// FIXME: Undo all changes in the correct order!
734733
for (unsigned i = Changes.size(); i > toIndex; i--) {
735734
auto change = Changes[i - 1];
736-
if (change.Kind == ChangeKind::UpdatedTypeVariable) {
737-
LLVM_DEBUG(llvm::dbgs() << "- "; change.dump(llvm::dbgs(), CS, 0));
738-
change.undo(CS);
739-
}
740-
}
741-
742-
for (unsigned i = Changes.size(); i > toIndex; i--) {
743-
auto change = Changes[i - 1];
744-
if (change.Kind != ChangeKind::UpdatedTypeVariable) {
745-
LLVM_DEBUG(llvm::dbgs() << "- "; change.dump(llvm::dbgs(), CS, 0));
746-
change.undo(CS);
747-
}
735+
LLVM_DEBUG(llvm::dbgs() << "- "; change.dump(llvm::dbgs(), CS, 0));
736+
change.undo(CS);
748737
}
749738

750739
Changes.resize(toIndex);

0 commit comments

Comments
 (0)