Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAllow runtime switching between trans backends #45684
Conversation
rust-highfive
assigned
eddyb
Nov 1, 2017
bjorn3
referenced this pull request
Nov 1, 2017
Closed
[driver breaking] Rename rustc_trans to rustc_codegen_llvm and allow runtime switching between trans backends #45677
This comment has been minimized.
This comment has been minimized.
|
cc @alexcrichton @rust-lang/compiler I'm not sure a flag is the right thing to use here. |
This comment has been minimized.
This comment has been minimized.
|
Most of the driver is the same for each backend. We could pass different compiler callbacks to rustc_driver for each backend. |
This comment has been minimized.
This comment has been minimized.
|
This seems to add |
This comment has been minimized.
This comment has been minimized.
kennytm
added
S-waiting-on-review
T-compiler
labels
Nov 1, 2017
This comment has been minimized.
This comment has been minimized.
|
@bjorn3 We use "custom drivers" to refer to different binaries using |
bjorn3
reviewed
Nov 2, 2017
| type OngoingCrateTranslation; | ||
| type TranslatedCrate; |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
What's the status of this PR @bjorn3 @alexcrichton @eddyb? I'm having a tough time telling :) |
This comment has been minimized.
This comment has been minimized.
|
I'm not sure what we should do here. Nominating for discussion in the next compiler meeting. |
eddyb
added
the
I-nominated
label
Nov 6, 2017
bjorn3
reviewed
Nov 7, 2017
| @@ -157,10 +157,6 @@ impl LlvmTransCrate { | |||
| } | |||
|
|
|||
| impl rustc_trans_utils::trans_crate::TransCrate for LlvmTransCrate { | |||
| type MetadataLoader = metadata::LlvmMetadataLoader; | |||
| type OngoingCrateTranslation = back::write::OngoingCrateTranslation; | |||
| type TranslatedCrate = CrateTranslation; | |||
This comment has been minimized.
This comment has been minimized.
bjorn3
Nov 7, 2017
Author
Contributor
Now with less object unsafe associated types
Edit: now completely object safe
This comment has been minimized.
This comment has been minimized.
|
@bjorn3 Out of curiosity, do you have some specific motivation/need behind this PR, or is it intended as a general refactoring towards supporting multiple backends? |
This comment has been minimized.
This comment has been minimized.
|
Mainly refactoring, but when this is merged I want to try to add basic cranelift support. |
This comment has been minimized.
This comment has been minimized.
|
I'd suggest more coordination between you, @sunfishcode and me, and the compiler team in general. Just to avoid stepping on eachother's toes, as we are all interested in this goal :). |
bjorn3
force-pushed the
bjorn3:runtime_choose_trans2
branch
from
eae208e
to
fd38507
Nov 11, 2017
This comment has been minimized.
This comment has been minimized.
rust-highfive
assigned
nikomatsakis
and unassigned
eddyb
Nov 12, 2017
bjorn3
reviewed
Nov 12, 2017
| @@ -1,87 +0,0 @@ | |||
| // Copyright 2016 The Rust Project Developers. See the COPYRIGHT | |||
This comment has been minimized.
This comment has been minimized.
nikomatsakis
reviewed
Nov 14, 2017
|
So, eddyb kicked this to me, but I actually don't know that I'm the right person to do a detailed review here. I mean I could, but I think that @eddyb and perhaps @michaelwoerister have stronger opinions about how this should be internally architected. @bjorn3 can you and @eddyb sync up at some point and talk it over? |
|
|
||
| sess.abort_if_errors(); | ||
| } | ||
| // FIXME: Check if the compilation options are supported for the selected backend. |
This comment has been minimized.
This comment has been minimized.
nikomatsakis
Nov 14, 2017
Contributor
This seems like an important thing to get right before we land, no? Although I guess it's only a warning, not an error, but I wouldn't want to silently be accepting bad things.
This comment has been minimized.
This comment has been minimized.
|
|
bjorn3
force-pushed the
bjorn3:runtime_choose_trans2
branch
from
831a965
to
b3a986a
Nov 15, 2017
eddyb
reviewed
Nov 15, 2017
| @@ -226,7 +226,7 @@ impl TransCrate for MetadataOnlyTransCrate { | |||
| }; | |||
| } | |||
| fn provide_extern(&self, providers: &mut Providers) { | |||
| self.provide_local(providers) | |||
| self.provide(providers) | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
rust-highfive
assigned
eddyb
and unassigned
nikomatsakis
Nov 15, 2017
nikomatsakis
removed
the
I-nominated
label
Nov 16, 2017
This comment has been minimized.
This comment has been minimized.
|
Fixed ICE |
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Jan 20, 2018
This comment has been minimized.
This comment has been minimized.
|
|
bjorn3
force-pushed the
bjorn3:runtime_choose_trans2
branch
from
fb976fb
to
a30232f
Jan 20, 2018
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Jan 20, 2018
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
@bors retry |
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Jan 21, 2018
This comment has been minimized.
This comment has been minimized.
|
|
bjorn3 commentedNov 1, 2017
The driver callback after_llvm has been removed as it doesnt work with multiple backends.
r? @eddyb