File tree Expand file tree Collapse file tree 1 file changed +2
-20
lines changed
src/bloqade/qasm2/dialects/expr Expand file tree Collapse file tree 1 file changed +2
-20
lines changed Original file line number Diff line number Diff line change 1
1
from kirin import ir , types , lowering
2
2
from kirin .decl import info , statement
3
+ from kirin .dialects import func
3
4
from kirin .print .printer import Printer
4
- from kirin .dialects .func .attrs import Signature
5
5
6
6
from ._dialect import dialect
7
7
8
8
9
- class GateFuncOpCallableInterface (ir .CallableStmtInterface ["GateFunction" ]):
10
-
11
- @classmethod
12
- def get_callable_region (cls , stmt : "GateFunction" ) -> ir .Region :
13
- return stmt .body
14
-
15
-
16
9
@statement (dialect = dialect )
17
- class GateFunction (ir . Statement ):
10
+ class GateFunction (func . Function ):
18
11
"""Special Function for qasm2 gate subroutine."""
19
12
20
13
name = "gate.func"
21
- traits = frozenset (
22
- {
23
- ir .IsolatedFromAbove (),
24
- ir .SymbolOpInterface (),
25
- ir .HasSignature (),
26
- GateFuncOpCallableInterface (),
27
- }
28
- )
29
- sym_name : str = info .attribute ()
30
- signature : Signature = info .attribute ()
31
- body : ir .Region = info .region (multi = True )
32
14
33
15
def print_impl (self , printer : Printer ) -> None :
34
16
with printer .rich (style = "red" ):
You can’t perform that action at this time.
0 commit comments