mirror of
https://github.com/python/cpython.git
synced 2026-01-06 23:42:34 +00:00
GH-118910: Less boilerplate in the tier 2 optimizer (#118913)
This commit is contained in:
parent
941eea0a27
commit
f5c6b9977a
7 changed files with 275 additions and 473 deletions
|
|
@ -84,14 +84,11 @@ def emit_default(out: CWriter, uop: Uop) -> None:
|
|||
if var.is_array():
|
||||
out.emit(f"for (int _i = {var.size}; --_i >= 0;) {{\n")
|
||||
out.emit(f"{var.name}[_i] = sym_new_not_null(ctx);\n")
|
||||
out.emit(f"if ({var.name}[_i] == NULL) goto out_of_space;\n")
|
||||
out.emit("}\n")
|
||||
elif var.name == "null":
|
||||
out.emit(f"{var.name} = sym_new_null(ctx);\n")
|
||||
out.emit(f"if ({var.name} == NULL) goto out_of_space;\n")
|
||||
else:
|
||||
out.emit(f"{var.name} = sym_new_not_null(ctx);\n")
|
||||
out.emit(f"if ({var.name} == NULL) goto out_of_space;\n")
|
||||
|
||||
|
||||
def write_uop(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue