Move supports_parallel from CodegenBackend to ExtraBackendMethods
It is only relevant when using cg_ssa for driving compilation.
This commit is contained in:
@@ -383,7 +383,7 @@ pub struct CodegenContext<B: WriteBackendMethods> {
|
||||
pub coordinator_send: Sender<Box<dyn Any + Send>>,
|
||||
/// `true` if the codegen should be run in parallel.
|
||||
///
|
||||
/// Depends on [`CodegenBackend::supports_parallel()`] and `-Zno_parallel_backend`.
|
||||
/// Depends on [`ExtraBackendMethods::supports_parallel()`] and `-Zno_parallel_backend`.
|
||||
pub parallel: bool,
|
||||
}
|
||||
|
||||
|
||||
@@ -97,13 +97,6 @@ pub trait CodegenBackend {
|
||||
fn link(&self, sess: &Session, codegen_results: CodegenResults, outputs: &OutputFilenames) {
|
||||
link_binary(sess, &ArArchiveBuilderBuilder, codegen_results, outputs);
|
||||
}
|
||||
|
||||
/// Returns `true` if this backend can be safely called from multiple threads.
|
||||
///
|
||||
/// Defaults to `true`.
|
||||
fn supports_parallel(&self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
pub trait ExtraBackendMethods:
|
||||
@@ -144,4 +137,11 @@ pub trait ExtraBackendMethods:
|
||||
{
|
||||
std::thread::Builder::new().name(name).spawn(f)
|
||||
}
|
||||
|
||||
/// Returns `true` if this backend can be safely called from multiple threads.
|
||||
///
|
||||
/// Defaults to `true`.
|
||||
fn supports_parallel(&self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user