Skip to content

Commit

Permalink
Merge pull request #20402 from alexrp/target-cleanup
Browse files Browse the repository at this point in the history
std.Target: Remove some obsolete/dead specifiers.
  • Loading branch information
andrewrk authored Jul 20, 2024
2 parents 6d7bbab + 5e82e90 commit ff02bf4
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 151 deletions.
11 changes: 0 additions & 11 deletions lib/compiler/aro/aro/target.zig
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ pub fn intMaxType(target: std.Target) Type {
pub fn intPtrType(target: std.Target) Type {
switch (target.os.tag) {
.haiku => return .{ .specifier = .long },
.nacl => return .{ .specifier = .int },
else => {},
}

Expand Down Expand Up @@ -467,7 +466,6 @@ pub fn get32BitArchVariant(target: std.Target) ?std.Target {
.csky,
.hexagon,
.m68k,
.le32,
.mips,
.mipsel,
.powerpc,
Expand Down Expand Up @@ -500,7 +498,6 @@ pub fn get32BitArchVariant(target: std.Target) ?std.Target {

.aarch64 => copy.cpu.arch = .arm,
.aarch64_be => copy.cpu.arch = .armeb,
.le64 => copy.cpu.arch = .le32,
.amdil64 => copy.cpu.arch = .amdil,
.nvptx64 => copy.cpu.arch = .nvptx,
.wasm64 => copy.cpu.arch = .wasm32,
Expand Down Expand Up @@ -547,7 +544,6 @@ pub fn get64BitArchVariant(target: std.Target) ?std.Target {
.amdgcn,
.bpfeb,
.bpfel,
.le64,
.amdil64,
.nvptx64,
.wasm64,
Expand All @@ -572,7 +568,6 @@ pub fn get64BitArchVariant(target: std.Target) ?std.Target {
.arm => copy.cpu.arch = .aarch64,
.armeb => copy.cpu.arch = .aarch64_be,
.hsail => copy.cpu.arch = .hsail64,
.le32 => copy.cpu.arch = .le64,
.loongarch32 => copy.cpu.arch = .loongarch64,
.mips => copy.cpu.arch = .mips64,
.mipsel => copy.cpu.arch = .mips64el,
Expand Down Expand Up @@ -643,8 +638,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
.xtensa => "xtensa",
.nvptx => "nvptx",
.nvptx64 => "nvptx64",
.le32 => "le32",
.le64 => "le64",
.amdil => "amdil",
.amdil64 => "amdil64",
.hsail => "hsail",
Expand Down Expand Up @@ -674,7 +667,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
.dragonfly => "dragonfly",
.freebsd => "freebsd",
.fuchsia => "fuchsia",
.kfreebsd => "kfreebsd",
.linux => "linux",
.lv2 => "lv2",
.netbsd => "netbsd",
Expand All @@ -686,7 +678,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
.haiku => "haiku",
.minix => "minix",
.rtems => "rtems",
.nacl => "nacl",
.aix => "aix",
.cuda => "cuda",
.nvcl => "nvcl",
Expand Down Expand Up @@ -737,7 +728,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
.gnueabi => "gnueabi",
.gnueabihf => "gnueabihf",
.gnuf32 => "gnuf32",
.gnuf64 => "gnuf64",
.gnusf => "gnusf",
.gnux32 => "gnux32",
.gnuilp32 => "gnuilp32",
Expand All @@ -752,7 +742,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
.msvc => "msvc",
.itanium => "itanium",
.cygnus => "cygnus",
.coreclr => "coreclr",
.simulator => "simulator",
.macabi => "macabi",
.pixel => "pixel",
Expand Down
34 changes: 1 addition & 33 deletions lib/std/Target.zig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ pub const Os = struct {
freebsd,
fuchsia,
ios,
kfreebsd,
linux,
lv2,
macos,
Expand All @@ -36,7 +35,6 @@ pub const Os = struct {
haiku,
minix,
rtems,
nacl,
aix,
cuda,
nvcl,
Expand Down Expand Up @@ -74,7 +72,7 @@ pub const Os = struct {

pub inline fn isBSD(tag: Tag) bool {
return tag.isDarwin() or switch (tag) {
.kfreebsd, .freebsd, .openbsd, .netbsd, .dragonfly => true,
.freebsd, .openbsd, .netbsd, .dragonfly => true,
else => false,
};
}
Expand Down Expand Up @@ -140,13 +138,11 @@ pub const Os = struct {
.ananas,
.cloudabi,
.fuchsia,
.kfreebsd,
.lv2,
.zos,
.haiku,
.minix,
.rtems,
.nacl,
.aix,
.cuda,
.nvcl,
Expand Down Expand Up @@ -374,13 +370,11 @@ pub const Os = struct {
.ananas,
.cloudabi,
.fuchsia,
.kfreebsd,
.lv2,
.zos,
.haiku,
.minix,
.rtems,
.nacl,
.aix,
.cuda,
.nvcl,
Expand Down Expand Up @@ -563,12 +557,10 @@ pub const Os = struct {
.ananas,
.cloudabi,
.fuchsia,
.kfreebsd,
.lv2,
.zos,
.minix,
.rtems,
.nacl,
.aix,
.cuda,
.nvcl,
Expand Down Expand Up @@ -628,7 +620,6 @@ pub const Abi = enum {
gnueabi,
gnueabihf,
gnuf32,
gnuf64,
gnusf,
gnux32,
gnuilp32,
Expand All @@ -643,7 +634,6 @@ pub const Abi = enum {
msvc,
itanium,
cygnus,
coreclr,
simulator,
macabi,
pixel,
Expand Down Expand Up @@ -673,7 +663,6 @@ pub const Abi = enum {
.zos,
.minix,
.rtems,
.nacl,
.aix,
.cuda,
.nvcl,
Expand All @@ -690,7 +679,6 @@ pub const Abi = enum {
.openbsd,
.freebsd,
.fuchsia,
.kfreebsd,
.netbsd,
.hurd,
.haiku,
Expand Down Expand Up @@ -1024,8 +1012,6 @@ pub const Cpu = struct {
xtensa,
nvptx,
nvptx64,
le32,
le64,
amdil,
amdil64,
hsail,
Expand Down Expand Up @@ -1159,7 +1145,6 @@ pub const Cpu = struct {
.hexagon => .HEXAGON,
.dxil => .NONE,
.m68k => .@"68K",
.le32 => .NONE,
.mips => .MIPS,
.mipsel => .MIPS_RS3_LE,
.powerpc, .powerpcle => .PPC,
Expand Down Expand Up @@ -1193,7 +1178,6 @@ pub const Cpu = struct {
.riscv64 => .RISCV,
.x86_64 => .X86_64,
.nvptx64 => .NONE,
.le64 => .NONE,
.amdil64 => .NONE,
.hsail64 => .NONE,
.spir64 => .NONE,
Expand Down Expand Up @@ -1225,7 +1209,6 @@ pub const Cpu = struct {
.dxil => .Unknown,
.hexagon => .Unknown,
.m68k => .Unknown,
.le32 => .Unknown,
.mips => .Unknown,
.mipsel => .Unknown,
.powerpc, .powerpcle => .POWERPC,
Expand Down Expand Up @@ -1259,7 +1242,6 @@ pub const Cpu = struct {
.riscv64 => .RISCV64,
.x86_64 => .X64,
.nvptx64 => .Unknown,
.le64 => .Unknown,
.amdil64 => .Unknown,
.hsail64 => .Unknown,
.spir64 => .Unknown,
Expand Down Expand Up @@ -1297,8 +1279,6 @@ pub const Cpu = struct {
.hsail,
.hsail64,
.kalimba,
.le32,
.le64,
.mipsel,
.mips64el,
.msp430,
Expand Down Expand Up @@ -1805,8 +1785,6 @@ pub const DynamicLinker = struct {
.tce,
.tcele,
.xcore,
.le32,
.le64,
.amdil,
.amdil64,
.hsail,
Expand Down Expand Up @@ -1856,12 +1834,10 @@ pub const DynamicLinker = struct {
.ananas,
.cloudabi,
.fuchsia,
.kfreebsd,
.lv2,
.zos,
.minix,
.rtems,
.nacl,
.aix,
.cuda,
.nvcl,
Expand Down Expand Up @@ -1904,7 +1880,6 @@ pub fn ptrBitWidth_cpu_abi(cpu: Cpu, abi: Abi) u16 {
.csky,
.hexagon,
.m68k,
.le32,
.mips,
.mipsel,
.powerpc,
Expand Down Expand Up @@ -1943,7 +1918,6 @@ pub fn ptrBitWidth_cpu_abi(cpu: Cpu, abi: Abi) u16 {
.riscv64,
.x86_64,
.nvptx64,
.le64,
.amdil64,
.hsail64,
.spir64,
Expand Down Expand Up @@ -2376,11 +2350,9 @@ pub fn c_type_bit_size(target: Target, c_type: CType) u16 {
},

.cloudabi,
.kfreebsd,
.lv2,
.zos,
.rtems,
.nacl,
.aix,
.elfiamcu,
.mesa3d,
Expand Down Expand Up @@ -2447,7 +2419,6 @@ pub fn c_type_alignment(target: Target, c_type: CType) u16 {
.loongarch32,
.tce,
.tcele,
.le32,
.amdil,
.hsail,
.spir,
Expand Down Expand Up @@ -2475,7 +2446,6 @@ pub fn c_type_alignment(target: Target, c_type: CType) u16 {
.sparcel,
.sparc64,
.lanai,
.le64,
.nvptx,
.nvptx64,
.r600,
Expand Down Expand Up @@ -2568,7 +2538,6 @@ pub fn c_type_preferred_alignment(target: Target, c_type: CType) u16 {
.loongarch32,
.tce,
.tcele,
.le32,
.amdil,
.hsail,
.spir,
Expand Down Expand Up @@ -2603,7 +2572,6 @@ pub fn c_type_preferred_alignment(target: Target, c_type: CType) u16 {
.sparcel,
.sparc64,
.lanai,
.le64,
.nvptx,
.nvptx64,
.r600,
Expand Down
Loading

0 comments on commit ff02bf4

Please sign in to comment.