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
Preserve local variables names in NIR #3386
Merged
WojciechMazur
merged 13 commits into
scala-native:main
from
WojciechMazur:nir/preserve-local-names-info
Aug 17, 2023
Merged
Preserve local variables names in NIR #3386
WojciechMazur
merged 13 commits into
scala-native:main
from
WojciechMazur:nir/preserve-local-names-info
Aug 17, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WojciechMazur
force-pushed
the
nir/preserve-local-names-info
branch
from
August 2, 2023 21:06
822cd05
to
e5cbe5c
Compare
WojciechMazur
force-pushed
the
nir/preserve-local-names-info
branch
3 times, most recently
from
August 10, 2023 16:33
f323475
to
07e09e9
Compare
… used to provide better debug informations in the future Revert "Add optional `name: Option[String]` to Val.{Local, Var} allowing to preserve original name of ValDef. It would be used to provide better debug informations in the future" This reverts commit 0779259. Remove backward compat for static calls. No longer needed in 0.5.x Store name of ValDef in Inst.Let "Add optional `name: Option[String]` to `Val.Local` allowing to preserve original name of method args. Ensure that Inst.Let and Val.Local created by Buffer.let have the same name wip
Revert "Remove backward compat for static calls. No longer needed in 0.5.x" This reverts commit 04f12eb. wip
Better names preserving in MergeProcessor
…n Defn. Fix found optimizer issues
…s terminates with non-zero exit code
WojciechMazur
force-pushed
the
nir/preserve-local-names-info
branch
from
August 11, 2023 13:20
07e09e9
to
d828d1e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enriches
Defn.Define
with additional fieldlocalNames: Map[Local, String]
containing original name of local variables (bothval
andvar
) allowing us to emit additional debug informations in the future.The following snippet now compiles to NIR containing local names:
The literal values are now assigned to local variables (e.g. x, y) to allow for correct mapping of them in debug metadata. The copy operator is effectivelly no-op. It could only affect
Val.StructValue
andVal.ArrayValue
which currently cannot be assigned to variables (low level primitives)The size of binaries might slightly increase. Scalalib 2.13 now takes 24,104 kB vs 23,910 kB previously (when compared to last NIR encoding changes in #3346)
TODO: