aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2025-05-30 12:13:18 -0400
committerJacob Young <jacobly0@users.noreply.github.com>2025-05-31 18:54:28 -0400
commit6198f7afb76b7a5a6d359bfd24f8fbdabc77939b (patch)
tree8acd0c84bde1d8e05e87a89b222a2d3c6ced2781 /src/codegen.zig
parentb4a0a082dca22b47fe394908c44eec7102def417 (diff)
downloadzig-6198f7afb76b7a5a6d359bfd24f8fbdabc77939b.tar.gz
zig-6198f7afb76b7a5a6d359bfd24f8fbdabc77939b.zip
Sema: remove `all_vector_instructions` logic
Backends can instead ask legalization on a per-instruction basis.
Diffstat (limited to 'src/codegen.zig')
-rw-r--r--src/codegen.zig9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/codegen.zig b/src/codegen.zig
index d482cca4b2..8d609682f1 100644
--- a/src/codegen.zig
+++ b/src/codegen.zig
@@ -52,7 +52,7 @@ fn importBackend(comptime backend: std.builtin.CompilerBackend) type {
pub fn legalizeFeatures(pt: Zcu.PerThread, nav_index: InternPool.Nav.Index) *const Air.Legalize.Features {
const zcu = pt.zcu;
const target = &zcu.navFileScope(nav_index).mod.?.resolved_target.result;
- switch (target_util.zigBackend(target.*, zcu.comp.config.use_llvm)) {
+ return switch (target_util.zigBackend(target.*, zcu.comp.config.use_llvm)) {
else => unreachable,
inline .stage2_llvm,
.stage2_c,
@@ -65,11 +65,8 @@ pub fn legalizeFeatures(pt: Zcu.PerThread, nav_index: InternPool.Nav.Index) *con
.stage2_sparc64,
.stage2_spirv64,
.stage2_powerpc,
- => |backend| {
- const Backend = importBackend(backend);
- return if (@hasDecl(Backend, "legalizeFeatures")) Backend.legalizeFeatures(target) else comptime &.initEmpty();
- },
- }
+ => |backend| importBackend(backend).legalizeFeatures(target),
+ };
}
pub fn generateFunction(