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

Mir: Trans Constant Operands #29572

Closed
nikomatsakis opened this issue Nov 4, 2015 · 2 comments
Closed

Mir: Trans Constant Operands #29572

nikomatsakis opened this issue Nov 4, 2015 · 2 comments
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@nikomatsakis
Copy link
Contributor

Translating constant operands in MIR is only partially implemented. We don't support it in all modes, and there are various kinds of constants that are unimplemented. See librustc_trans/trans/mir/operand.rs and librustc_trans/trans/mir/constant.rs

@nikomatsakis nikomatsakis added E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html labels Nov 4, 2015
@nagisa
Copy link
Member

nagisa commented Dec 28, 2015

It seems like there’s only ConstVal::Function in librustc_trans/trans/consts.rs left. Everything else seems to be implemented.

The problem is that, AFAIR, @oli-obk moved trans_constval from mir-specific code to trans::consts, but to translate ConstVal::Function you need code from trans::mir::did. So either we move trans_constval back into MIR-specific trans code, or attempt to find a place outside MIR-code for functions in mir::did.

@oli-obk
Copy link
Contributor

oli-obk commented Dec 28, 2015

it should be trivial to move back. I think it was only important to move it into its own function, it can reside in trans::mir without any troubles

bors added a commit that referenced this issue Dec 31, 2015
This moves back (essentially reverts #30265) into MIR-specific translation code, but keeps the
funcition split out, since it is expected to eventually become recursive.

Fixes #29572

cc @oli-obk
nagisa added a commit to nagisa/rust that referenced this issue Dec 31, 2015
…mana

This moves back (essentially reverts rust-lang#30265) into MIR-specific translation code, but keeps the
funcition split out, since it is expected to eventually become recursive.

Fixes rust-lang#29572

cc @oli-obk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants