7979from mypyc .irbuild .builder import IRBuilder
8080from mypyc .irbuild .constant_fold import constant_fold_expr
8181from mypyc .irbuild .for_helpers import (
82- _create_iterable_lexpr ,
83- _is_supported_forloop_iter ,
8482 comprehension_helper ,
83+ create_synthetic_nameexpr ,
84+ expr_has_specialized_for_helper ,
8585 for_loop_helper ,
8686 sequence_from_generator_preallocate_helper ,
8787 translate_list_comprehension ,
@@ -419,7 +419,7 @@ def translate_any_call(builder: IRBuilder, expr: CallExpr, callee: RefExpr) -> V
419419 arg = expr .args [0 ]
420420 if isinstance (arg , GeneratorExpr ):
421421 return any_all_helper (builder , arg , builder .false , lambda x : x , builder .true )
422- elif _is_supported_forloop_iter (builder , arg ):
422+ elif expr_has_specialized_for_helper (builder , arg ):
423423 retval = Register (bool_rprimitive )
424424 builder .assign (retval , builder .false (), - 1 )
425425 loop_exit = BasicBlock ()
@@ -435,7 +435,7 @@ def body_insts() -> None:
435435 builder .activate_block (false_block )
436436
437437 index_type = builder ._analyze_iterable_item_type (arg )
438- index = _create_iterable_lexpr (index_name , index_type )
438+ index = create_synthetic_nameexpr (index_name , index_type )
439439 index_reg = builder .add_local_reg (index .node , builder .type_to_rtype (index_type )) # type: ignore [arg-type]
440440
441441 for_loop_helper (builder , index , arg , body_insts , None , is_async = False , line = expr .line )
@@ -457,7 +457,7 @@ def translate_all_call(builder: IRBuilder, expr: CallExpr, callee: RefExpr) -> V
457457 builder .false ,
458458 )
459459
460- elif _is_supported_forloop_iter (builder , arg ):
460+ elif expr_has_specialized_for_helper (builder , arg ):
461461 retval = Register (bool_rprimitive )
462462 builder .assign (retval , builder .true (), - 1 )
463463 loop_exit = BasicBlock ()
@@ -473,7 +473,7 @@ def body_insts() -> None:
473473 builder .activate_block (true_block )
474474
475475 index_type = builder ._analyze_iterable_item_type (arg )
476- index = _create_iterable_lexpr (index_name , index_type )
476+ index = create_synthetic_nameexpr (index_name , index_type )
477477 index_reg = builder .add_local_reg (index .node , builder .type_to_rtype (index_type )) # type: ignore [arg-type]
478478
479479 for_loop_helper (builder , index , arg , body_insts , None , is_async = False , line = expr .line )
0 commit comments