-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Printer: print MISSING_SSA_VALUE instead of abort #119
Conversation
cb2d02f
to
c4c0558
Compare
The latest commit contains a way to show more information, similar to the earlier error message. It would be really cool if we could combine this more with the diagnostics (to e.g. have the On way to fix this, might be to allow adding diagnostic messages to SSAValues or doing two separate passes over the IR, the first one adding all these error messages, the second one actually printing. Anyway, I feel that the current version gives us not quite the best of both worlds, but already quite a lot. Edit: This current version prints as: %0 : !i32 = arith.addi(%MISSING_SSA_VALUE : !i32, %MISSING_SSA_VALUE : !i32)
^-------------------------------------------------------------------------------------------------
| ERROR: SSAValue is not part of the IR, are you sure all operations are added before their uses?
--------------------------------------------------------------------------------------------------
^-------------------------------------------------------------------------------------------------
| ERROR: SSAValue is not part of the IR, are you sure all operations are added before their uses?
-------------------------------------------------------------------------------------------------- |
Hi @webmiche, thank you for working on this. Your current version is a very good improvement for my debugging workflow! |
No, it does not. I added a testcase to reflect this behavior :) |
Hey! Thanks a lot for working on this, this should greatly improve debugging ;) |
Last commit make a little rewrite on the logic of Printer._print_message. I code some logic to highlight the position of missing SSA value.
|
c175b89
to
c859775
Compare
…ssa_value instead of getting from dict again.
c859775
to
358cbdd
Compare
Nice! Is this ready to be merged, or do you guys want to add anything else? |
Waiting for you approval, and then we can merge :) |
closes #86. This changes the behavior on missing SSAValues from aborting with an exception to printing
%MISSING_SSA_VALUE
. While I feel that it makes sense to not abort if not needed, I feel that this current version does not really give insight into what went wrong. Still, how do you guys feel about this change?Edit: this means that an add with missing operands is printed as:
Instead of failing with a KeyError and the message