Skip to content

Commit 94fa5fe

Browse files
committed
Change the implementation of supports_parallel to signal tha cg_gcc is not thread safe.
1 parent b7091ec commit 94fa5fe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,11 @@ fn new_context<'gcc, 'tcx>(tcx: TyCtxt<'tcx>) -> Context<'gcc> {
289289
}
290290

291291
impl ExtraBackendMethods for GccCodegenBackend {
292+
293+
fn supports_parallel(&self) -> bool {
294+
false
295+
}
296+
292297
fn codegen_allocator(
293298
&self,
294299
tcx: TyCtxt<'_>,
@@ -357,8 +362,7 @@ impl Deref for SyncContext {
357362
}
358363

359364
unsafe impl Send for SyncContext {}
360-
// FIXME(antoyo): that shouldn't be Sync. Parallel compilation is currently disabled with "-Zno-parallel-llvm".
361-
// TODO: disable it here by returning false in CodegenBackend::supports_parallel().
365+
// FIXME(antoyo): that shouldn't be Sync. Parallel compilation is currently disabled with "CodegenBackend::supports_parallel()".
362366
unsafe impl Sync for SyncContext {}
363367

364368
impl WriteBackendMethods for GccCodegenBackend {

0 commit comments

Comments
 (0)