Skip to content

Callable

CallableStmtInterface dataclass

CallableStmtInterface()

Bases: StmtTrait, ABC, Generic[StmtType]

A trait that indicates that a statement is a callable statement.

A callable statement is a statement that can be called as a function.

get_callable_region abstractmethod classmethod

get_callable_region(stmt: StmtType) -> Region

Returns the body of the callable region

Source code in src/kirin/ir/traits/callable.py
21
22
23
24
25
@classmethod
@abstractmethod
def get_callable_region(cls, stmt: "StmtType") -> "Region":
    """Returns the body of the callable region"""
    ...

HasSignature dataclass

HasSignature()

Bases: StmtTrait, ABC

A trait that indicates that a statement has a function signature attribute.