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

Frontend versus backend #19

Open
Serentty opened this issue Jan 7, 2020 · 4 comments
Open

Frontend versus backend #19

Serentty opened this issue Jan 7, 2020 · 4 comments

Comments

@Serentty
Copy link

Serentty commented Jan 7, 2020

I was talking to Centril about this project, and he suggested that it would make more sense to structure it as a codegen target for the Rust compiler instead of a GCC frontend. These were his words, specifically:

also, I think that the perspective "gcc frontend" is a mistake -- I think a "gcc backend" makes more sense in that if this project wants to be viable, it should really be a rustc_codegen_gcc crate

I'm not familiar with compiler internals and have no opinion on this myself, but given that Centril is a central figure in the development of Rust, I figured it would be a good idea to pass this on.

@sapir
Copy link
Owner

sapir commented Jan 9, 2020

Thanks!

I'm not sure I understand, though. I think it's really both a frontend for gcc and a backend for rustc. But do you mean that it should use librustc_codegen_ssa?

@bjorn3
Copy link

bjorn3 commented Jan 9, 2020

I think he means that you use can execute rustc with an extra flag instead of gcc with a rust file to use gcc-rust. This makes it easier to support cargo.

In cg_clif I use -Zcodegen-backend to load a .so as backend. That .so file just needs to provide a __rustc_codegen_backend symbol: https://github.com/bjorn3/rustc_codegen_cranelift/blob/6652f466efc93a8706c07cda0502fd487ce8219d/src/lib.rs#L286

@sapir
Copy link
Owner

sapir commented Jan 11, 2020

My impression of gcc so far is that doing this without libgccjit would be difficult, and in any case it might not integrate as well with gcc.

@sapir sapir mentioned this issue Jan 11, 2020
@bjorn3
Copy link

bjorn3 commented Jan 11, 2020

That is unfortunate.

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