Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: esc <[email protected]>
  • Loading branch information
kc611 and esc authored Aug 29, 2023
1 parent d2331e7 commit 688b43b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions numba_rvsdg/core/datastructures/basic_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def declare_backedge(self, target: str) -> None:
self.backedges.append(target)

def replace_jump_targets(self, jump_targets: list[str]) -> None:
"""Replaces jump targets of this block by the given tuple.
"""Replaces jump targets of this block by the given list.
This method replaces the jump targets of the current BasicBlock.
The provided jump targets must be in the same order as their
Expand All @@ -103,23 +103,23 @@ def replace_jump_targets(self, jump_targets: list[str]) -> None:
Parameters
----------
jump_targets: Tuple
The new jump target tuple. Must be ordered.
jump_targets: List
The new jump target list. Must be ordered.
"""
self._jump_targets.clear()
self._jump_targets.extend(jump_targets)

def replace_backedges(self, backedges: list[str]) -> None:
"""Replaces back edges of this block by the given tuple.
"""Replaces back edges of this block by the given list.
This method replaces the back edges of the current BasicBlock.
The provided back edges must be in the same order as their
intended original replacements.
Parameters
----------
backedges: Tuple
The new back edges tuple. Must be ordered.
backedges: List
The new back edges list. Must be ordered.
"""
self.backedges.clear()
self.backedges.extend(backedges)
Expand Down Expand Up @@ -256,7 +256,7 @@ class SyntheticBranch(SyntheticBlock):
branch_value_table: Dict[int, str] = field(default_factory=lambda: {})

def replace_jump_targets(self, jump_targets: list[str]) -> None:
"""Replaces jump targets of this block by the given tuple.
"""Replaces jump targets of this block by the given list.
This method replaces the jump targets of the current BasicBlock.
The provided jump targets must be in the same order as their
Expand All @@ -269,8 +269,8 @@ def replace_jump_targets(self, jump_targets: list[str]) -> None:
Parameters
----------
jump_targets: Tuple
The new jump target tuple. Must be ordered.
jump_targets: List
The new jump target list. Must be ordered.
"""

old_branch_value_table = self.branch_value_table.copy()
Expand Down
4 changes: 2 additions & 2 deletions numba_rvsdg/core/datastructures/scfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ def insert_block(
# TODO: needs a diagram and documentaion
# initialize new block
new_block = block_type(
name=new_name, _jump_targets=list(successors), backedges=[]
name=new_name, _jump_targets=successors, backedges=[]
)
# add block to self
self.add_block(new_block)
Expand Down Expand Up @@ -656,7 +656,7 @@ def insert_block_and_control_blocks(
# initialize new block, which will hold the branching table
new_block = SyntheticHead(
name=new_name,
_jump_targets=list(successors),
_jump_targets=successors,
backedges=[],
variable=branch_variable,
branch_value_table=branch_value_table,
Expand Down

0 comments on commit 688b43b

Please sign in to comment.