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

Look at the output of -Z save-analysis-json #4

Open
llogiq opened this issue May 1, 2016 · 2 comments
Open

Look at the output of -Z save-analysis-json #4

llogiq opened this issue May 1, 2016 · 2 comments

Comments

@llogiq
Copy link
Owner

llogiq commented May 1, 2016

The rust compiler currently implements something similar to this project, so in the name of reducing duplication, it would be good to find out and document what it does and where we can augment it with our own analysis.

@nrc
Copy link

nrc commented May 1, 2016

You should look at the save-analysis crate you can implement data dumpers to dump data in any format you like (currently we format JSON and CSV) and I'm very open to dumping more data if there is some missing. I would strongly recommend you use that. We intend to support the API long term (it will be used to power IDEs, etc.) and will be relatively stable. We can also customise to your needs. Any approach that uses the compiler internals or crate metadata is likely to break very often.

@eddyb
Copy link

eddyb commented Nov 4, 2016

For the intended purposes of metacollect, MIR seems way more relevant than save-analysis.

Since rust-lang/rust#37400, all you need to do is tcx.item_mir(def_id) to get it, even from a lint.
NB: cross-crate MIR exists only for constants, const fn or #[inline]/generic functions.

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

3 participants