-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: prevent internal errors when for-loop bodies always exit (#269)
--------- - build tuple iteration in an order such that special case of not checking reachability is no longer required - simplify tuple, indexable, and urange looping code - improve tuple iteration code gen - test all combinations of supported iteration types
- Loading branch information
Showing
202 changed files
with
23,141 additions
and
14,678 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from collections import deque | ||
from collections.abc import Iterator | ||
|
||
from puya.ir import models | ||
|
||
|
||
def bfs_block_order(start: models.BasicBlock) -> Iterator[models.BasicBlock]: | ||
q = deque[models.BasicBlock]() | ||
q.append(start) | ||
visited = {start} | ||
while q: | ||
block = q.popleft() | ||
yield block | ||
for succ in block.successors: | ||
if succ not in visited: | ||
q.append(succ) | ||
visited.add(succ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.