Improve indentation in debugging output

This commit is contained in:
Timofey Solonin
2022-11-17 23:06:13 +08:00
parent 3c401a1c7e
commit 3f366947e4
11 changed files with 167 additions and 128 deletions

View File

@@ -3958,7 +3958,7 @@ SolutionResult ConstraintSystem::salvage() {
int i = 0;
for (auto &solution : viable) {
log << "---Ambiguous solution #" << i++ << "---\n";
solution.dump(log);
solution.dump(log, solverState->getCurrentIndent());
log << "\n";
}
}
@@ -4692,13 +4692,15 @@ bool ConstraintSystem::diagnoseAmbiguityWithFixes(
return true;
if (isDebugMode()) {
auto &log = llvm::errs();
auto indent = solverState->getCurrentIndent();
auto &log = llvm::errs().indent(indent);
log << "--- Ambiguity: Considering #" << solutions.size()
<< " solutions with fixes ---\n";
int i = 0;
for (auto &solution : solutions) {
log << "\n--- Solution #" << i++ << "---\n";
solution.dump(log);
log << "\n";
log.indent(indent) << "--- Solution #" << i++ << "---\n";
solution.dump(log, indent);
log << "\n";
}
}