← 输入框|github.com|刷新
Skip to content

Remove redundant Return node after processing an ASR through subroutine_from_function pass #2420

Closed

Description

@anutosh491

From #2419

When we go from

def func() -> S:
    return pi

To something like

def func(r: Out[S]) -> None:
    r = pi

Or any cases like this where the subroutine_from_function pass is involved, we don't get rid of the redundant Return node in the function body.

                                    (=
                                        (Var 3 _lpython_return_variable)
                                        (IntrinsicScalarFunction
                                            SymbolicPi
                                            []
                                            0
                                            (SymbolicExpression)
                                            ()
                                        )
                                        ()
                                    )
                                    (Return)

Whereas x->m_return_var points to nullptr so we don't need this node.

Activity

  1. certik commented on Nov 14, 2023

    @certik
    Contributor

    Looks like that this is fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions