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

Let the frontends resolve imports while creating the PSyIR tree #2806

Open
sergisiso opened this issue Nov 27, 2024 · 0 comments
Open

Let the frontends resolve imports while creating the PSyIR tree #2806

sergisiso opened this issue Nov 27, 2024 · 0 comments
Assignees

Comments

@sergisiso
Copy link
Collaborator

PSyclone have functionality to resolve imports (use statements) during the transformation phase (symbol_table.resolve_imports) however, this is very slow because it has to retrofit all the changes that are generated with the additional symbol information throughout the tree. It also misses the chance to make frontend improvements derived from that symbol information, e.g. func calls vs arrays, where canonicalisation, ...

We should explore let the frontend resolve the import when the "use" statement is found so the initial tree is already created with that symbol information. This will probably need another script variable to let the generate.py control what imports to chase

RESOLVE_IMPORTS = ["module1", "module2"]

def trans(psyir):
...

I think the default (when RESOLVE_IMPORTS is not in the script ) should be none (as now), but ultimately this could default to all that it manages to find in the -I paths (once we are confident that it works and is fast enough).

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

No branches or pull requests

1 participant