mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
tools/update_cpu_features: handle ISAs with no features
These are represented by not having a file for them.
This commit is contained in:
parent
a804944c7d
commit
03de5ec6dd
@ -430,8 +430,8 @@ pub const Target = struct {
|
||||
pub const powerpc = @import("target/powerpc.zig");
|
||||
pub const riscv = @import("target/riscv.zig");
|
||||
pub const sparc = @import("target/sparc.zig");
|
||||
pub const spirv = @import("target/spirv.zig");
|
||||
pub const systemz = @import("target/systemz.zig");
|
||||
pub const ve = @import("target/ve.zig");
|
||||
pub const wasm = @import("target/wasm.zig");
|
||||
pub const x86 = @import("target/x86.zig");
|
||||
|
||||
|
||||
@ -320,6 +320,13 @@ fn processOneTarget(job: Job) anyerror!void {
|
||||
defer target_dir.close();
|
||||
|
||||
const zig_code_basename = try std.fmt.allocPrint(arena, "{s}.zig", .{llvm_target.zig_name});
|
||||
|
||||
if (all_features.items.len == 0) {
|
||||
// We represent this with an empty file.
|
||||
try target_dir.deleteTree(zig_code_basename);
|
||||
return;
|
||||
}
|
||||
|
||||
var zig_code_file = try target_dir.createFile(zig_code_basename, .{});
|
||||
defer zig_code_file.close();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user