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

gh-121404: move calculation of module start location from compiler_body up to compiler_codegen #122127

Merged
merged 2 commits into from
Jul 22, 2024

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Jul 22, 2024

This moves the calculation of the start location of a module to compiler_codegen, which is the entry point, from compiler_body, which is also called recursively. The former will be a "compiler" function and the latter a "codegen" function once the #121404 refactor is complete.

@@ -1151,9 +1151,6 @@ compiler_enter_scope(struct compiler *c, identifier name, int scope_type,
}
ADDOP_I(c, loc, RESUME, RESUME_AT_FUNC_START);

if (u->u_scope_type == COMPILER_SCOPE_MODULE) {
loc.lineno = -1;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not doing anything - loc is a local variable and we're exiting the function.

@iritkatriel iritkatriel merged commit d5a12b4 into python:main Jul 22, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants