Skip to content

Commit

Permalink
Adapted rendering to basic block changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kc611 committed Jul 7, 2023
1 parent 0b95844 commit 7ce552e
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions numba_rvsdg/rendering/rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,19 @@ def find_base_header(block: BasicBlock):
if isinstance(src_block, RegionBlock):
continue
src_block = find_base_header(src_block)
for dst_name in src_block.jump_targets:
for idx, dst_name in enumerate(src_block._jump_targets):
dst_name = find_base_header(blocks[dst_name]).name
if dst_name in blocks.keys():
self.g.edge(str(src_block.name), str(dst_name))
else:
raise Exception("unreachable " + str(src_block))
for dst_name in src_block.backedges:
dst_name = find_base_header(blocks[dst_name]).name
if dst_name in blocks.keys():
self.g.edge(
str(src_block.name),
str(dst_name),
style="dashed",
color="grey",
constraint="0",
)
if src_block.backedges[idx]:
self.g.edge(
str(src_block.name),
str(dst_name),
style="dashed",
color="grey",
constraint="0",
)
else:
self.g.edge(str(src_block.name), str(dst_name))
else:
raise Exception("unreachable " + str(src_block))

Expand Down Expand Up @@ -169,8 +166,7 @@ def render_branching_block(
digraph.node(str(name), shape="rect", label=body)

def render_byteflow(self, byteflow: ByteFlow):
"""Renders the provided `ByteFlow` object.
"""
"""Renders the provided `ByteFlow` object."""
self.bcmap_from_bytecode(byteflow.bc)
# render nodes
for name, block in byteflow.scfg.graph.items():
Expand Down

0 comments on commit 7ce552e

Please sign in to comment.