diff --git a/numba_rvsdg/core/datastructures/basic_block.py b/numba_rvsdg/core/datastructures/basic_block.py index f78b872..a89d16e 100644 --- a/numba_rvsdg/core/datastructures/basic_block.py +++ b/numba_rvsdg/core/datastructures/basic_block.py @@ -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 @@ -103,14 +103,14 @@ 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 @@ -118,8 +118,8 @@ def replace_backedges(self, backedges: list[str]) -> None: 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) @@ -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 @@ -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() diff --git a/numba_rvsdg/core/datastructures/scfg.py b/numba_rvsdg/core/datastructures/scfg.py index ac2cd26..3e3a96d 100644 --- a/numba_rvsdg/core/datastructures/scfg.py +++ b/numba_rvsdg/core/datastructures/scfg.py @@ -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) @@ -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,