@@ -20,7 +20,6 @@ def g() -> int:
2020from mypy .nodes import Argument , FuncDef , SymbolNode , Var
2121from mypyc .common import BITMAP_BITS , ENV_ATTR_NAME , SELF_NAME , bitmap_name
2222from mypyc .ir .class_ir import ClassIR
23- from mypyc .ir .func_ir import FuncSignature
2423from mypyc .ir .ops import Call , GetAttr , SetAttr , Value
2524from mypyc .ir .rtypes import RInstance , bitmap_rprimitive , object_rprimitive
2625from mypyc .irbuild .builder import IRBuilder , SymbolTarget
@@ -57,17 +56,17 @@ class is generated, the function environment has not yet been
5756 return env_class
5857
5958
60- def finalize_env_class (builder : IRBuilder , sig : FuncSignature ) -> None :
59+ def finalize_env_class (builder : IRBuilder ) -> None :
6160 """Generate, instantiate, and set up the environment of an environment class."""
6261 instantiate_env_class (builder )
6362
6463 # Iterate through the function arguments and replace local definitions (using registers)
6564 # that were previously added to the environment with references to the function's
6665 # environment class.
6766 if builder .fn_info .is_nested :
68- add_args_to_env (builder , sig , local = False , base = builder .fn_info .callable_class )
67+ add_args_to_env (builder , local = False , base = builder .fn_info .callable_class )
6968 else :
70- add_args_to_env (builder , sig , local = False , base = builder .fn_info )
69+ add_args_to_env (builder , local = False , base = builder .fn_info )
7170
7271
7372def instantiate_env_class (builder : IRBuilder ) -> Value :
@@ -92,15 +91,15 @@ def instantiate_env_class(builder: IRBuilder) -> Value:
9291 return curr_env_reg
9392
9493
95- def load_env_registers (builder : IRBuilder , sig : FuncSignature ) -> None :
94+ def load_env_registers (builder : IRBuilder ) -> None :
9695 """Load the registers for the current FuncItem being visited.
9796
9897 Adds the arguments of the FuncItem to the environment. If the
9998 FuncItem is nested inside of another function, then this also
10099 loads all of the outer environments of the FuncItem into registers
101100 so that they can be used when accessing free variables.
102101 """
103- add_args_to_env (builder , sig , local = True )
102+ add_args_to_env (builder , local = True )
104103
105104 fn_info = builder .fn_info
106105 fitem = fn_info .fitem
@@ -171,7 +170,6 @@ def num_bitmap_args(builder: IRBuilder, args: list[Argument]) -> int:
171170
172171def add_args_to_env (
173172 builder : IRBuilder ,
174- sig : FuncSignature ,
175173 local : bool = True ,
176174 base : FuncInfo | ImplicitClass | None = None ,
177175 reassign : bool = True ,
0 commit comments