MCPcopy Index your code
hub / github.com/python/mypy / transform_if_stmt

Function transform_if_stmt

mypyc/irbuild/statement.py:594–609  ·  view source on GitHub ↗
(builder: IRBuilder, stmt: IfStmt)

Source from the content-addressed store, hash-verified

592
593
594def transform_if_stmt(builder: IRBuilder, stmt: IfStmt) -> None:
595 if_body, next = BasicBlock(), BasicBlock()
596 else_body = BasicBlock() if stmt.else_body else next
597
598 # If statements are normalized
599 assert len(stmt.expr) == 1
600
601 process_conditional(builder, stmt.expr[0], if_body, else_body)
602 builder.activate_block(if_body)
603 builder.accept(stmt.body[0])
604 builder.goto(next)
605 if stmt.else_body:
606 builder.activate_block(else_body)
607 builder.accept(stmt.else_body)
608 builder.goto(next)
609 builder.activate_block(next)
610
611
612def transform_while_stmt(builder: IRBuilder, s: WhileStmt) -> None:

Callers 1

visit_if_stmtMethod · 0.90

Calls 6

BasicBlockClass · 0.90
process_conditionalFunction · 0.90
lenFunction · 0.85
activate_blockMethod · 0.45
acceptMethod · 0.45
gotoMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…