std.Target: Fix Cpu.Model.generic() for arc, csky, and xtensa.

Only targets for which we don't source CPU models/features from LLVM should use
the fallback prong in this switch. Also make it exhaustive to catch similar
mistakes in the future.
This commit is contained in:
Alex Rønne Petersen 2024-10-01 06:37:25 +02:00
parent cb1ac0bb2f
commit 7d71e794dd
No known key found for this signature in database

View File

@ -1526,10 +1526,12 @@ pub const Cpu = struct {
};
};
return switch (arch) {
.arc => &arc.cpu.generic,
.arm, .armeb, .thumb, .thumbeb => &arm.cpu.generic,
.aarch64, .aarch64_be => &aarch64.cpu.generic,
.avr => &avr.cpu.avr2,
.bpfel, .bpfeb => &bpf.cpu.generic,
.csky => &csky.cpu.generic,
.hexagon => &hexagon.cpu.generic,
.lanai => &lanai.cpu.generic,
.loongarch32 => &loongarch.cpu.generic_la32,
@ -1555,8 +1557,11 @@ pub const Cpu = struct {
.ve => &ve.cpu.generic,
.wasm32, .wasm64 => &wasm.cpu.generic,
.xcore => &xcore.cpu.generic,
.xtensa => &xtensa.cpu.generic,
else => &S.generic_model,
.kalimba,
.spu_2,
=> &S.generic_model,
};
}