Changes crash messages to start printing verbose forms of instructions, rather than just the ID. Fixes some indentation issues with stacks. Also switches unexpected inst formatting, because now there are lots, and it'd be helpful to know where they are.
This uses a pimpl pattern for Formatter due to the number of member functions on Formatter. Maybe we should refactor that, but this didn't feel like a good place to do so.
Note, I have two concerns about this change... to note them here, to make sure others are considering them when evaluating the implementation:
Some instructions are very verbose to print, as evidenced by the fn_decl printing (which includes function params) or scope printing (which includes scope members).
I'm not sure whether there's a way to simply reduce this, as it seems essential to the requested printing of instructions.
Long-term, we may at least want to limit the number of lines printed here. However, I've already spent a fair amount of time here and I think it's in a good state to evaluate.
Increased complexity in the crash handler may result in crash messages failing to generate.
For example, a crash in Formatter (and its deps, such as InstNamer or location handling) prevents a stack from being printed. I'm pretty sure I've written crashes in Formatter before.
Here's an example crash snippet (generated by adding a crash inside return handling) before:
Note, per side-discussion about the risks, we'll try this out. People will be asked to comment to #toolchain if they use the more detailed info. If nobody's using it, we may back it out (at least in part)
Changes crash messages to start printing verbose forms of instructions, rather than just the ID. Fixes some indentation issues with stacks. Also switches unexpected inst formatting, because now there are lots, and it'd be helpful to know where they are.
This uses a pimpl pattern for Formatter due to the number of member functions on Formatter. Maybe we should refactor that, but this didn't feel like a good place to do so.
Note, I have two concerns about this change... to note them here, to make sure others are considering them when evaluating the implementation:
Here's an example crash snippet (generated by adding a crash inside
return
handling) before:And after: