Skip to content
Merged
Show file tree
Hide file tree
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
Get rid of spurious warnings
  • Loading branch information
Fidget-Spinner committed Jan 1, 2026
commit 709a45f266bac263aa6101930754c021ea68d88e
2 changes: 2 additions & 0 deletions Lib/test/test_generated_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -2541,6 +2541,8 @@ def test_replace_opcode_binop_one_output_insert(self):
l_stackref = left;
r_stackref = right;
/* End of uop copied from bytecodes for constant evaluation */
(void)l_stackref;
(void)r_stackref;
res = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal(res_stackref));
CHECK_STACK_BOUNDS(1);
stack_pointer[-2] = res;
Expand Down
12 changes: 12 additions & 0 deletions Python/optimizer_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Tools/cases_generator/optimizer_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ def replace_opcode_if_evaluates_pure(
emitter.emit_tokens(self.original_uop, storage, inst=None, emit_braces=False)
self.out.start_line()
emitter.emit("/* End of uop copied from bytecodes for constant evaluation */\n")
for outp in self.original_uop.stack.outputs:
if not outp.name == output_identifier.text:
emitter.emit(f"(void){outp.name}_stackref;\n")

# Output stackref is created from new reference.
emitter.emit(f"{output_identifier.text} = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal({output_identifier.text}_stackref));\n")
Expand Down
Loading