8000 gh-126835: Move optimization of constant sequence creation from codegen to CFG by Eclips4 · Pull Request #129426 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-126835: Move optimization of constant sequence creation from codegen to CFG #129426

8000 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 16 commits into from
Feb 1, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unused function
  • Loading branch information
Eclips4 committed Jan 29, 2025
commit 009165ba8f95dcea5ca270a1e84ec76f9fdce16c
15 changes: 0 additions & 15 deletions Python/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@ static int codegen_subscript(compiler *, expr_ty);
static int codegen_slice_two_parts(compiler *, expr_ty);
static int codegen_slice(compiler *, expr_ty);

static bool are_all_items_const(asdl_expr_seq *, Py_ssize_t, Py_ssize_t);


static int codegen_with(compiler *, stmt_ty, int);
static int codegen_async_with(compiler *, stmt_ty, int);
static int codegen_async_for(compiler *, stmt_ty);
Expand Down Expand Up @@ -3361,18 +3358,6 @@ codegen_set(compiler *c, expr_ty e)
BUILD_SET, SET_ADD, SET_UPDATE, 0);
}

static bool
are_all_items_const(asdl_expr_seq *seq, Py_ssize_t begin, Py_ssize_t end)
{
for (Py_ssize_t i = begin; i < end; i++) {
expr_ty key = (expr_ty)asdl_seq_GET(seq, i);
if (key == NULL || key->kind != Constant_kind) {
return false;
}
}
return true;
}

static int
codegen_subdict(compiler *c, expr_ty e, Py_ssize_t begin, Py_ssize_t end)
{
Expand Down
Loading
0