Skip to content

Commit 16fc083

Browse files
committed
std.Target: remove Abi.code16
This functionality -- if it's actually needed -- can be reintroduced through some other mechanism. An ABI is clearly not the right way to represent it. closes #25918
1 parent 6d543bc commit 16fc083

File tree

5 files changed

+8
-23
lines changed

5 files changed

+8
-23
lines changed

lib/compiler/aro/aro/Target.zig

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,6 @@ pub fn toLLVMTriple(target: *const Target, buf: []u8) []const u8 {
12581258

12591259
.android => "android",
12601260
.androideabi => "androideabi",
1261-
.code16 => "code16",
12621261
.eabi => "eabi",
12631262
.eabihf => "eabihf",
12641263
.gnu => "gnu",
@@ -1630,11 +1629,11 @@ test parseAbi {
16301629
try testing.expect(query.abi == .android);
16311630
try testing.expectEqual(query.android_api_level, 17);
16321631

1633-
try testing.expectError(error.InvalidAbiVersion, parseAbi(&query, "code162", null));
1634-
try testing.expect(query.abi == .code16);
1632+
try testing.expectError(error.InvalidAbiVersion, parseAbi(&query, "ilp322", null));
1633+
try testing.expect(query.abi == .ilp32);
16351634

1636-
try testing.expectError(error.InvalidAbiVersion, parseAbi(&query, "code16.2", null));
1637-
try testing.expect(query.abi == .code16);
1635+
try testing.expectError(error.InvalidAbiVersion, parseAbi(&query, "ilp32.2", null));
1636+
try testing.expect(query.abi == .ilp32);
16381637
}
16391638

16401639
/// Parse OS string with common aliases in `<os>(.?<version>(...<version>))?` format.

lib/std/Target.zig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,6 @@ pub const Abi = enum {
746746
gnuf32,
747747
gnusf,
748748
gnux32,
749-
code16,
750749
eabi,
751750
eabihf,
752751
ilp32,

lib/std/zig/LibCDirs.zig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ fn libCGenericName(target: *const std.Target) [:0]const u8 {
254254
.ohos,
255255
.ohoseabi,
256256
=> return "musl",
257-
.code16,
258257
.eabi,
259258
.eabihf,
260259
.ilp32,

lib/std/zig/system.zig

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -380,38 +380,27 @@ pub fn resolveTargetQuery(io: Io, query: Target.Query) DetectError!Target {
380380

381381
// For x86, we need to populate some CPU feature flags depending on architecture
382382
// and mode:
383-
// * 16bit_mode => if the abi is code16
383+
// * 16bit_mode => if the arch is x86_16
384384
// * 32bit_mode => if the arch is x86
385385
// However, the "mode" flags can be used as overrides, so if the user explicitly
386386
// sets one of them, that takes precedence.
387387
switch (query_cpu_arch) {
388388
.x86_16 => {
389-
cpu.features.addFeature(
390-
@intFromEnum(Target.x86.Feature.@"16bit_mode"),
391-
);
389+
cpu.features.addFeature(@intFromEnum(Target.x86.Feature.@"16bit_mode"));
392390
},
393391
.x86 => {
394392
if (!Target.x86.featureSetHasAny(query.cpu_features_add, .{
395393
.@"16bit_mode", .@"32bit_mode",
396394
})) {
397-
switch (query_abi) {
398-
.code16 => cpu.features.addFeature(
399-
@intFromEnum(Target.x86.Feature.@"16bit_mode"),
400-
),
401-
else => cpu.features.addFeature(
402-
@intFromEnum(Target.x86.Feature.@"32bit_mode"),
403-
),
404-
}
395+
cpu.features.addFeature(@intFromEnum(Target.x86.Feature.@"32bit_mode"));
405396
}
406397
},
407398
.arm, .armeb => {
408399
// XXX What do we do if the target has the noarm feature?
409400
// What do we do if the user specifies +thumb_mode?
410401
},
411402
.thumb, .thumbeb => {
412-
cpu.features.addFeature(
413-
@intFromEnum(Target.arm.Feature.thumb_mode),
414-
);
403+
cpu.features.addFeature(@intFromEnum(Target.arm.Feature.thumb_mode));
415404
},
416405
else => {},
417406
}

src/codegen/llvm.zig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ pub fn targetTriple(allocator: Allocator, target: *const std.Target) ![]const u8
277277
.gnusf => "gnusf",
278278
.gnux32 => "gnux32",
279279
.ilp32 => "unknown",
280-
.code16 => "code16",
281280
.eabi => "eabi",
282281
.eabihf => "eabihf",
283282
.android => "android",

0 commit comments

Comments
 (0)