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

Change analysis into proper passes and rearrange data #136

Open
gkoz opened this issue Oct 3, 2015 · 3 comments
Open

Change analysis into proper passes and rearrange data #136

gkoz opened this issue Oct 3, 2015 · 3 comments

Comments

@gkoz
Copy link
Member

gkoz commented Oct 3, 2015

Calling only the analyzers you need from codegen seems limiting and requires workarounds to avoid duplicate work.

A more robust scheme would be to do the analysis first and then let the codegen use that data. Expected benefits:

  • parser cleanup, by moving the patching logic to a separate stage,
  • library cleanup, by removing the bits of analysis from it,
  • analysis stages can rely on the data from earlier ones and agree on viral blacklisting (commenting out) effects,
  • possibly, weaker coupling between stages.

This is just a first approximation, I've not thought about the ways to organize the data. TypeId would probably turn into DefId. We could probably learn a thing or two from rustc.

@EPashkin
Copy link
Member

EPashkin commented Oct 4, 2015

Good long-term objective, but I do not have any ideas how to do it.

gkoz added a commit that referenced this issue Oct 13, 2015
They might return after architecture changes promised in #136
@EPashkin EPashkin mentioned this issue Oct 20, 2015
4 tasks
@gkoz
Copy link
Member Author

gkoz commented Oct 28, 2015

In the (still in progress) ffi_ng branch I'm translating the "gir" representation created by the parser into the "foreign" one. The "foreign" analysis is going to be responsible for applying quirks, creating helper types for unions, tracking visibility and other contagious properties, generating rust FFI type strings etc. The generator just has to iterate through the definitions and do some format!s.

@gkoz
Copy link
Member Author

gkoz commented Jan 24, 2016

I think now's a good time to try implementing some changes to this effect. I intend to continue work on the ffi_ng branch soon.

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

2 participants