Skip to content

Commit

Permalink
core: Remove deprecated methods in Rewriter
Browse files Browse the repository at this point in the history
These methods were deprecated for a while
  • Loading branch information
math-fehr committed Jan 6, 2025
1 parent f8eadae commit d63133c
Showing 1 changed file with 0 additions and 61 deletions.
61 changes: 0 additions & 61 deletions xdsl/rewriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from collections.abc import Sequence
from dataclasses import dataclass, field

from typing_extensions import deprecated

from xdsl.ir import Block, Operation, Region, SSAValue


Expand Down Expand Up @@ -179,53 +177,6 @@ def inline_block(
parent_region.detach_block(source)
source.erase()

@deprecated("Please use `inline_block` instead")
@staticmethod
def inline_block_at_end(
inlined_block: Block, extended_block: Block, arg_values: Sequence[SSAValue] = ()
):
"""
Move the block operations to the end of another block.
This block should not be a parent of the block to move to.
The block operations should not use the block arguments.
"""
Rewriter.inline_block(
inlined_block, InsertPoint.at_end(extended_block), arg_values=arg_values
)

@deprecated("Please use `inline_block` instead")
@staticmethod
def inline_block_at_start(
inlined_block: Block, extended_block: Block, arg_values: Sequence[SSAValue] = ()
):
"""
Move the block operations to the start of another block.
This block should not be a parent of the block to move to.
The block operations should not use the block arguments.
"""
Rewriter.inline_block(
inlined_block, InsertPoint.at_start(extended_block), arg_values=arg_values
)

@deprecated("Please use `inline_block` instead")
@staticmethod
def inline_block_before(
source: Block, op: Operation, arg_values: Sequence[SSAValue] = ()
):
Rewriter.inline_block(source, InsertPoint.before(op), arg_values=arg_values)

@deprecated("Please use `inline_block` instead")
@staticmethod
def inline_block_after(
block: Block, op: Operation, arg_values: Sequence[SSAValue] = ()
):
"""
Move the block operations after another operation.
The block should not be a parent of the operation.
The block operations should not use the block arguments.
"""
Rewriter.inline_block(block, InsertPoint.after(op), arg_values=arg_values)

@staticmethod
def insert_block_after(block: Block | list[Block], target: Block):
"""
Expand Down Expand Up @@ -267,18 +218,6 @@ def insert_op(
else:
insertion_point.block.add_ops(ops)

@deprecated("Please use `insert_op` instead")
@staticmethod
def insert_op_after(op: Operation, new_op: Operation):
"""Inserts a new operation after another operation."""
Rewriter.insert_op(new_op, InsertPoint.after(op))

@deprecated("Please use `insert_op` instead")
@staticmethod
def insert_op_before(op: Operation, new_op: Operation):
"""Inserts a new operation before another operation."""
Rewriter.insert_op(new_op, InsertPoint.before(op))

@staticmethod
def move_region_contents_to_new_regions(region: Region) -> Region:
"""Move the region blocks to a new region."""
Expand Down

0 comments on commit d63133c

Please sign in to comment.