File tree Expand file tree Collapse file tree 5 files changed +4
-10
lines changed Expand file tree Collapse file tree 5 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,9 @@ branch-restructuring.
74
74
75
75
``` python
76
76
# Example: for loop with branch and early exit
77
+
78
+ from numba_rvsdg.rendering.rendering import render_func
79
+
77
80
def foo (n ):
78
81
c = 0
79
82
for i in range (n):
@@ -82,17 +85,8 @@ def foo(n):
82
85
break
83
86
return c
84
87
85
- flow = ByteFlow.from_bytecode(foo)
86
- ByteFlowRenderer().render_byteflow(flow).view(" initial" )
87
-
88
- cflow = flow._join_returns()
89
- ByteFlowRenderer().render_byteflow(cflow).view(" closed" )
90
-
91
- lflow = cflow._restructure_loop()
92
- ByteFlowRenderer().render_byteflow(lflow).view(" loop restructured" )
88
+ render_func(foo)
93
89
94
- bflow = lflow._restructure_branch()
95
- ByteFlowRenderer().render_byteflow(bflow).view(" branch restructured" )
96
90
```
97
91
98
92
![ initial] ( docs/images/initial.png " initial ")
You can’t perform that action at this time.
0 commit comments