Adopt ABORT throughout the compiler

Convert a bunch of places where we're dumping to stderr and calling
`abort` over to using `ABORT` such that the message gets printed to
the pretty stack trace. This ensures it gets picked up by
CrashReporter.
This commit is contained in:
Hamish Knight
2025-05-19 20:55:01 +01:00
parent b8fc71c684
commit edca7c85ad
42 changed files with 757 additions and 670 deletions

View File

@@ -231,19 +231,22 @@ void RequirementMachine::checkCompletionResult(CompletionResult result) const {
break;
case CompletionResult::MaxRuleCount:
llvm::errs() << "Rewrite system exceeded maximum rule count\n";
dump(llvm::errs());
abort();
ABORT([&](auto &out) {
out << "Rewrite system exceeded maximum rule count\n";
dump(out);
});
case CompletionResult::MaxRuleLength:
llvm::errs() << "Rewrite system exceeded rule length limit\n";
dump(llvm::errs());
abort();
ABORT([&](auto &out) {
out << "Rewrite system exceeded rule length limit\n";
dump(out);
});
case CompletionResult::MaxConcreteNesting:
llvm::errs() << "Rewrite system exceeded concrete type nesting depth limit\n";
dump(llvm::errs());
abort();
ABORT([&](auto &out) {
out << "Rewrite system exceeded concrete type nesting depth limit\n";
dump(out);
});
}
}