Skip to content

Commit f94685e

Browse files
committed
[CSTrail] NFC: Add dump() methods to SolverTrail
1 parent f18b772 commit f94685e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

include/swift/Sema/CSTrail.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ class SolverTrail {
260260

261261
void undo(unsigned toIndex);
262262

263+
SWIFT_DEBUG_DUMP;
264+
void dump(raw_ostream &OS, unsigned fromIndex = 0,
265+
unsigned indent = 0) const LLVM_ATTRIBUTE_USED;
266+
263267
private:
264268
ConstraintSystem &CS;
265269

lib/Sema/CSTrail.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,3 +880,11 @@ void SolverTrail::dumpActiveScopeChanges(llvm::raw_ostream &out,
880880
out.indent(indent);
881881
out << ")\n";
882882
}
883+
884+
void SolverTrail::dump() const { dump(llvm::errs()); }
885+
886+
void SolverTrail::dump(raw_ostream &OS, unsigned fromIndex,
887+
unsigned indent) const {
888+
for (unsigned i = fromIndex; i < Changes.size(); ++i)
889+
Changes[i].dump(OS, CS, indent);
890+
}

0 commit comments

Comments
 (0)