mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-114058: Foundations of the Tier2 redundancy eliminator (GH-115085)
--------- Co-authored-by: Mark Shannon <9448417+markshannon@users.noreply.github.com> Co-authored-by: Jules <57632293+JuliaPoo@users.noreply.github.com> Co-authored-by: Guido van Rossum <gvanrossum@users.noreply.github.com>
This commit is contained in:
parent
ccc76c3e88
commit
7cce857622
25 changed files with 3137 additions and 140 deletions
|
@ -168,11 +168,11 @@ class Stack:
|
|||
self.top_offset.push(var)
|
||||
return ""
|
||||
|
||||
def flush(self, out: CWriter) -> None:
|
||||
def flush(self, out: CWriter, cast_type: str = "PyObject *") -> None:
|
||||
out.start_line()
|
||||
for var in self.variables:
|
||||
if not var.peek:
|
||||
cast = "(PyObject *)" if var.type else ""
|
||||
cast = f"({cast_type})" if var.type else ""
|
||||
if var.name not in UNUSED and not var.is_array():
|
||||
if var.condition:
|
||||
out.emit(f"if ({var.condition}) ")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue