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

dealing with subdir() #120

Open
dcbaker opened this issue Nov 30, 2022 · 0 comments
Open

dealing with subdir() #120

dcbaker opened this issue Nov 30, 2022 · 0 comments
Labels
difficulty:hard frontend Specific the frontend and/or AST MIR Issues related to the MIR (Mid level IR)

Comments

@dcbaker
Copy link
Owner

dcbaker commented Nov 30, 2022

subdir is a pain. Ideally, we'd deal with it entirely at the AST level, because you'd have subdir('foo'). No variables, no keywords, just a basic "here is a subdir". We don't. we have two annoying cases that make handling it at the AST level really, really, really hard:

x = 'foo'
if host_machine.system() == 'windows'
    x = 'bar'
endif
subdir(x)

This cannot be handled at the AST level, because we can't know what X is until we get to the MIR passes that check host machine and lower away dead variables.

Second, we need to handle the subdir('foo', if_found : bar). This can be handled at the AST level.

So, I have two choices. Do as much of the lowering in the AST as possible, but then do some of it at the MIR level. Or, I move it all to the MIR level and deal with that annoyance.

@dcbaker dcbaker added frontend Specific the frontend and/or AST MIR Issues related to the MIR (Mid level IR) labels Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty:hard frontend Specific the frontend and/or AST MIR Issues related to the MIR (Mid level IR)
Projects
None yet
Development

No branches or pull requests

1 participant