Skip to content

Commit 2f3cd17

Browse files
committed
compiler: raise the bar for backend contributions
1 parent 5a8acc9 commit 2f3cd17

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/target.zig

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -868,10 +868,16 @@ pub inline fn backendSupportsFeature(backend: std.builtin.CompilerBackend, compt
868868
else => false,
869869
},
870870
.separate_thread => switch (backend) {
871+
// Supports a separate thread but does not support N separate
872+
// threads because they would all just be locking the same mutex to
873+
// protect Builder.
871874
.stage2_llvm => false,
872-
.stage2_c, .stage2_wasm, .stage2_x86_64 => true,
873-
// TODO: most self-hosted backends should be able to support this without too much work.
874-
else => false,
875+
// Same problem. Frontend needs to allow this backend to run in the
876+
// linker thread.
877+
.stage2_spirv => false,
878+
// Please do not make any more exceptions. Backends must support
879+
// being run in a separate thread from now on.
880+
else => true,
875881
},
876882
};
877883
}

0 commit comments

Comments
 (0)