Merge pull request #62053 from abdulowork/improve-type-checker-debugging-indentation

Improve indentation in type checker debugging output
This commit is contained in:
Pavel Yaskevich
2022-11-30 12:11:27 -08:00
committed by GitHub
11 changed files with 193 additions and 144 deletions

View File

@@ -3954,7 +3954,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";
}
}
@@ -4688,13 +4688,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";
}
}