Skip to content
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

push block label sym owner for const and static #24085

Draft
wants to merge 4 commits into
base: devel
Choose a base branch
from

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Sep 8, 2024

fixes #8758, fixes #10828, fixes #12172, fixes #21610, fixes #23803, refs nim-lang/RFCs#276

Based off of #24084 for now but maybe doesn't need it

Another option is to reuse the instantiatedFrom field

@metagn
Copy link
Collaborator Author

metagn commented Sep 8, 2024

As expected the compiler doesn't like that the owner of a symbol needs skips to get to the owning proc, we could add the skips in the required places but that might hurt performance and would take a lot of effort.

For skVar and skLet we have the advantage that they will never use the s.instantiatedFrom symbol, so we can track the "owner" in another field in PContext and give that to instantiatedFrom. Unfortunately skTemp symbols also use sfFromGeneric for some reason (for at least 15 years) so I'm not sure if that would trip the compiler up in some places (seems to just be used to skip semming though). Maybe it already trips the compiler up for skVar and skLet too.

I'll test using instantiatedFrom for now, if it's not considered too hacky I'll polish it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment