Skip to content

gh-87092: bring compiler code closer to a preprocessing-opt-assembler organisation #97644

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

Merged
merged 12 commits into from
Oct 5, 2022
Prev Previous commit
Next Next commit
mark's review comments
  • Loading branch information
iritkatriel committed Oct 3, 2022
commit 85751ea45c49539918a806bb33fc8d9d011b8ef5
10 changes: 5 additions & 5 deletions Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -7975,8 +7975,8 @@ scan_block_for_local(int target, basicblock *b, bool unsafe_to_start,
#undef MAYBE_PUSH

static int
add_checks_for_loads_of_unknown_variables(basicblock *entryblock,
struct compiler *c)
add_checks_for_loads_of_uninitialized_variables(basicblock *entryblock,
struct compiler *c)
{
basicblock **stack = make_cfg_traversal_stack(entryblock);
if (stack == NULL) {
Expand Down Expand Up @@ -8639,7 +8639,7 @@ assemble(struct compiler *c, int addNone)
}
nlocalsplus -= numdropped;

/** Desugaring **/
/** Map labels to targets and mark exception handlers **/
if (translate_jump_labels_to_targets(g->g_entryblock)) {
goto error;
}
Expand All @@ -8658,7 +8658,7 @@ assemble(struct compiler *c, int addNone)
if (optimize_cfg(g, consts, c->c_const_cache)) {
goto error;
}
if (add_checks_for_loads_of_unknown_variables(g->g_entryblock, c) < 0) {
if (add_checks_for_loads_of_uninitialized_variables(g->g_entryblock, c) < 0) {
goto error;
}

Expand All @@ -8669,11 +8669,11 @@ assemble(struct compiler *c, int addNone)
propagate_line_numbers(g->g_entryblock);
guarantee_lineno_for_exits(g->g_entryblock, c->u->u_firstlineno);

/** Assembly **/
if (push_cold_blocks_to_end(g, code_flags) < 0) {
goto error;
}

/** Assembly **/
int maxdepth = stackdepth(g->g_entryblock, code_flags);
if (maxdepth < 0) {
goto error;
Expand Down