-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Let backends define custom targets #76832
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ use rustc_session::{ | |
}; | ||
use rustc_span::symbol::Symbol; | ||
use rustc_target::abi::LayoutOf; | ||
use rustc_target::spec::Target; | ||
|
||
pub use rustc_data_structures::sync::MetadataRef; | ||
|
||
|
@@ -54,6 +55,12 @@ pub trait CodegenBackend { | |
fn print_passes(&self) {} | ||
fn print_version(&self) {} | ||
|
||
/// If this plugin provides additional builtin targets, provide the one enabled by the options here. | ||
/// Be careful: this is called *before* init() is called. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the llvm codegen backend already check that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe open a separate issue? This PR doesn't add a |
||
fn target_override(&self, _opts: &config::Options) -> Option<Target> { | ||
None | ||
} | ||
|
||
fn metadata_loader(&self) -> Box<MetadataLoaderDyn>; | ||
fn provide(&self, _providers: &mut Providers); | ||
fn provide_extern(&self, _providers: &mut Providers); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The llvm codegen backend is not in any way a plugin. It is linked into
librustc_driver.so
.