mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 10:11:06 +01:00
Split SemIR's formatter class into a more typical h+cpp (#5372)
Trying to make it easier to see the API at a glance. The class has become really long, and this doesn't fundamentally change that, but hopefully makes it easier to navigate. The entry structure also had some cruft that I'm removing. I'm trying to keep functions in the same order as they currently are. The delta still looks unhappy because of the churn, but hopefully this at least explains the ordering in formatter.h. You can try using the "Add indent" commit on the PR to see a better before-after delta. --------- Co-authored-by: Dana Jansens <danakj@orodu.net>
This commit is contained in:
co-authored by
Dana Jansens
parent
8ba3da9730
commit
5da87f43da
@@ -569,12 +569,13 @@ auto CompilationUnit::PostCheck() -> void {
|
||||
};
|
||||
|
||||
SemIR::Formatter formatter(&*sem_ir_, should_format_entity);
|
||||
formatter.Format();
|
||||
if (vlog_stream_) {
|
||||
CARBON_VLOG("*** SemIR::File ***\n");
|
||||
formatter.Print(*vlog_stream_);
|
||||
formatter.Write(*vlog_stream_);
|
||||
}
|
||||
if (print) {
|
||||
formatter.Print(*driver_env_->output_stream);
|
||||
formatter.Write(*driver_env_->output_stream);
|
||||
}
|
||||
}
|
||||
if (sem_ir_->has_errors()) {
|
||||
|
||||
Reference in New Issue
Block a user