authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-13 12:53:46-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-14 09:26:24+02:00
log2f3cd175d3fc74be8318c07d943c8d5d067085b3
treee352a45e28c861e3200892005be22eca2c72f3bd
parent5a8acc91158e84d1478478cbf6aa510091708b93

compiler: raise the bar for backend contributions


1 files changed, 9 insertions(+), 3 deletions(-)

src/target.zig+9-3
......@@ -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}