authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-22 19:39:18-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-22 19:43:47-07:00
loge9b9a27a52fa765ccb8cd838fc24ccfb2085a363
tree7d2f6201cb6687e81708f6b2460af187b090aaad
parent5060ab99c94dd8afc8b84e74fe4d050c88cdfc0a

codegen: prevent AnyMir from bloating zig1.wasm


1 files changed, 6 insertions(+), 6 deletions(-)

src/codegen.zig+6-6
......@@ -98,12 +98,12 @@ pub fn wantsLiveness(pt: Zcu.PerThread, nav_index: InternPool.Nav.Index) bool {
9898/// MIR from codegen to the linker *regardless* of which backend is in use. So, we use this: a
9999/// union of all MIR types. The active tag is known from the backend in use; see `AnyMir.tag`.
100100pub const AnyMir = union {
101 aarch64: @import("codegen/aarch64/Mir.zig"),
102 riscv64: @import("arch/riscv64/Mir.zig"),
103 sparc64: @import("arch/sparc64/Mir.zig"),
104 x86_64: @import("arch/x86_64/Mir.zig"),
105 wasm: @import("arch/wasm/Mir.zig"),
106 c: @import("codegen/c.zig").Mir,
101 aarch64: if (dev.env.supports(.aarch64_backend)) @import("codegen/aarch64/Mir.zig") else noreturn,
102 riscv64: if (dev.env.supports(.riscv64_backend)) @import("arch/riscv64/Mir.zig") else noreturn,
103 sparc64: if (dev.env.supports(.sparc64_backend)) @import("arch/sparc64/Mir.zig") else noreturn,
104 x86_64: if (dev.env.supports(.x86_64_backend)) @import("arch/x86_64/Mir.zig") else noreturn,
105 wasm: if (dev.env.supports(.wasm_backend)) @import("arch/wasm/Mir.zig") else noreturn,
106 c: if (dev.env.supports(.c_backend)) @import("codegen/c.zig").Mir else noreturn,
107107
108108 pub inline fn tag(comptime backend: std.builtin.CompilerBackend) []const u8 {
109109 return switch (backend) {