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

handling nested function for gcc #26

Open
feiwang3311 opened this issue Jun 27, 2020 · 0 comments
Open

handling nested function for gcc #26

feiwang3311 opened this issue Jun 27, 2020 · 0 comments

Comments

@feiwang3311
Copy link
Collaborator

feiwang3311 commented Jun 27, 2020

  1. flag to support inner functions or not (decided based on if we use gcc or tcc)
  2. when supporting inner functions, generate them in function syntax int f(int x) { ... }
  3. when not supporting inner functions, closure conversions
  4. for cpp codegen compiled with gcc, it seems that we can either use cpp closure or inner functions (not sure if there are differences between them). How do we choose?

Outstanding Problem:
In handling closure codeGen of CPP, we replace the lambda_forward symbol with lambda.
that is to say: if x2 = lambda_forward(x3), then replace all codegen of x2 with x3.
This is current wrong because it generate invalid code for mutually recursive closures.

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

No branches or pull requests

1 participant