Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented visit_SubroutineCall for the symbolic pass #2335

Merged
merged 3 commits into from
Sep 24, 2023

Conversation

anutosh491
Copy link
Collaborator

@anutosh491 anutosh491 commented Sep 23, 2023

This Pr is built on top of #2331 (hence this could be rebased once the previous pr is merged) and visit_SubroutineCall allows us to add any level of abstraction/nesting while passing symbolic variables to a function. Consider symbolics_09.py

def addInteger(x: S, y: S, z: S, i: i32):
    _i: S = S(i)
    print(x + y + z + _i)

def call_addInteger():
    a: S = Symbol("x")
    b: S = Symbol("y")
    c: S = pi
    d: S = sin(a)
    e: S = cos(b)
    addInteger(c, d, e, 2)
    addInteger(c, sin(a), cos(b), 2)
    addInteger(pi, sin(Symbol("x")), cos(Symbol("y")), 2)

def main0():
    call_addInteger()

@anutosh491
Copy link
Collaborator Author

I think so I had also overlooked the case of printing a simple symbolic integer during my GSoC project.

from lpython import S

def main0():
    print(S(10))

Support for this has been added in visit_Print through this PR.

@anutosh491 anutosh491 marked this pull request as draft September 23, 2023 11:01
@anutosh491 anutosh491 marked this pull request as ready for review September 24, 2023 08:54
@anutosh491
Copy link
Collaborator Author

I think so this is ready now ( Built on top of #2331 so that should be merged first and then this can be rebased after that).

@certik certik force-pushed the Implement_visit_SubroutineCall branch from 6038d2c to 37cc6eb Compare September 24, 2023 15:18
@certik certik merged commit f76dff7 into lcompilers:main Sep 24, 2023
12 checks passed
@anutosh491 anutosh491 deleted the Implement_visit_SubroutineCall branch September 25, 2023 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants