-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[MIR] Implement debug info #31005
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
Comments
It might certainly be possible that by the translation time we do not retain enough information to build good debuginfo. In that case MIR itself should be adjusted to carry enough data. |
While working on #32803 I've found that we're still missing information on arguments, closure captures and returns. For arguments, I tried leaving them anonymous, as gcc and clang do for Our options involve:
That last option would also help with closure captures, as they are effectively fields of the first argument. As for returns, old trans seems to use the closing brace of the function ( |
Filed #32949 for uninitialized variables always being in scope during their initialization. |
Get all (but one) of debuginfo tests to pass with MIR codegen. I didn't get much feedback in #31005 so I went ahead and implemented something simple. Closes #31005, as MIR debuginfo should work now for most usecases. The `no-debug-attribute` test no longer assumes variables are in scope of `return`. We might also want to revisit that in #32949, but the test is more reliable now either way. In order to get one last function in the `associated-type` test pass, this PR also fixes #32790.
Currently we do not emit any debuginfo from the MIR translator.
It doesn’t seem like there should be many issues implementing support, other than
DebugLoc
wanting aast::NodeId
, which eventually gets passed down totrans::debuginfo::metadata::scope_metadata
.Precondition to this work is to either decouple
trans::debuginfo
and its DIScope-building-related functionality from theNodeId
or create a independent code for MIR’s use.The text was updated successfully, but these errors were encountered: