(builder: IRBuilder)
| 179 | |
| 180 | |
| 181 | def populate_switch_for_generator_class(builder: IRBuilder) -> None: |
| 182 | cls = builder.fn_info.generator_class |
| 183 | line = builder.fn_info.fitem.line |
| 184 | |
| 185 | builder.activate_block(cls.switch_block) |
| 186 | for label, true_block in enumerate(cls.continuation_blocks): |
| 187 | false_block = BasicBlock() |
| 188 | comparison = builder.binary_op(cls.next_label_reg, Integer(label), "==", line) |
| 189 | builder.add_bool_branch(comparison, true_block, false_block) |
| 190 | builder.activate_block(false_block) |
| 191 | |
| 192 | builder.add(RaiseStandardError(RaiseStandardError.STOP_ITERATION, None, line)) |
| 193 | builder.add(Unreachable()) |
| 194 | |
| 195 | |
| 196 | def add_raise_exception_blocks_to_generator_class(builder: IRBuilder, line: int) -> None: |
no test coverage detected
searching dependent graphs…