Skip to content

Commit

Permalink
Add constructor in YieldOp
Browse files Browse the repository at this point in the history
  • Loading branch information
math-fehr committed May 10, 2024
1 parent 96a8fdf commit 54e27ef
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion xdsl_pdl/dialects/irdl_extension.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import annotations
from typing import Sequence

from xdsl.irdl import (
AttrSizedOperandSegments,
Expand All @@ -7,7 +8,7 @@
region_def,
var_operand_def,
)
from xdsl.ir import Dialect, Region
from xdsl.ir import Dialect, Region, SSAValue

from xdsl.dialects.irdl import AttributeType
from xdsl.parser import DictionaryAttr, Parser
Expand Down Expand Up @@ -50,5 +51,15 @@ class YieldOp(IRDLOperation):

assembly_format = "attr-dict $args"

def __init__(
self,
args: Sequence[SSAValue],
attr_dict: DictionaryAttr | None = None,
):
super().__init__(
operands=args,
attributes=attr_dict.data if attr_dict is not None else None,
)


IRDLExtension = Dialect("irdl_ext", [CheckSubsetOp, YieldOp])

0 comments on commit 54e27ef

Please sign in to comment.