authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-23 20:01:42+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-23 20:05:38+02:00
logebbe6ef4b3ed2d6168ec76d6541f6c93db15a2f5
treeba5c00fbd67474c2aadce8746f798b6e3e739063
parent85aad22b4d299a1e086d906379b3cdeccff5ec46
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.Target: fix casing of some helpers on Cpu.Arch, deprecate old spellings


1 files changed, 46 insertions(+), 13 deletions(-)

lib/std/Target.zig+46-13
......@@ -1510,7 +1510,10 @@ pub const Cpu = struct {
15101510 };
15111511 }
15121512
1513 pub inline fn isAARCH64(arch: Arch) bool {
1513 /// Deprecated; to be removed in 0.18.0. Use `isAarch64` instead.
1514 pub const isAARCH64 = isAarch64;
1515
1516 pub inline fn isAarch64(arch: Arch) bool {
15141517 return switch (arch) {
15151518 .aarch64, .aarch64_be => true,
15161519 else => false,
......@@ -1538,14 +1541,20 @@ pub const Cpu = struct {
15381541 };
15391542 }
15401543
1541 pub inline fn isLoongArch(arch: Arch) bool {
1544 /// Deprecated; to be removed in 0.18.0. Use `isLoongarch` instead.
1545 pub const isLoongArch = isLoongarch;
1546
1547 pub inline fn isLoongarch(arch: Arch) bool {
15421548 return switch (arch) {
15431549 .loongarch32, .loongarch64 => true,
15441550 else => false,
15451551 };
15461552 }
15471553
1548 pub inline fn isRISCV(arch: Arch) bool {
1554 /// Deprecated; to be removed in 0.18.0. Use `isRiscv` instead.
1555 pub const isRISCV = isRiscv;
1556
1557 pub inline fn isRiscv(arch: Arch) bool {
15491558 return arch.isRiscv32() or arch.isRiscv64();
15501559 }
15511560
......@@ -1570,50 +1579,74 @@ pub const Cpu = struct {
15701579 };
15711580 }
15721581
1573 pub inline fn isMIPS(arch: Arch) bool {
1574 return arch.isMIPS32() or arch.isMIPS64();
1582 /// Deprecated; to be removed in 0.18.0. Use `isMips` instead.
1583 pub const isMIPS = isMips;
1584
1585 pub inline fn isMips(arch: Arch) bool {
1586 return arch.isMips32() or arch.isMips64();
15751587 }
15761588
1577 pub inline fn isMIPS32(arch: Arch) bool {
1589 /// Deprecated; to be removed in 0.18.0. Use `isMips32` instead.
1590 pub const isMIPS32 = isMips32;
1591
1592 pub inline fn isMips32(arch: Arch) bool {
15781593 return switch (arch) {
15791594 .mips, .mipsel => true,
15801595 else => false,
15811596 };
15821597 }
15831598
1584 pub inline fn isMIPS64(arch: Arch) bool {
1599 /// Deprecated; to be removed in 0.18.0. Use `isMips64` instead.
1600 pub const isMIPS64 = isMips64;
1601
1602 pub inline fn isMips64(arch: Arch) bool {
15851603 return switch (arch) {
15861604 .mips64, .mips64el => true,
15871605 else => false,
15881606 };
15891607 }
15901608
1591 pub inline fn isPowerPC(arch: Arch) bool {
1592 return arch.isPowerPC32() or arch.isPowerPC64();
1609 /// Deprecated; to be removed in 0.18.0. Use `isPowerpc` instead.
1610 pub const isPowerPC = isPowerpc;
1611
1612 pub inline fn isPowerpc(arch: Arch) bool {
1613 return arch.isPowerpc32() or arch.isPowerpc64();
15931614 }
15941615
1595 pub inline fn isPowerPC32(arch: Arch) bool {
1616 /// Deprecated; to be removed in 0.18.0. Use `isPowerpc32` instead.
1617 pub const isPowerPC32 = isPowerpc32;
1618
1619 pub inline fn isPowerpc32(arch: Arch) bool {
15961620 return switch (arch) {
15971621 .powerpc, .powerpcle => true,
15981622 else => false,
15991623 };
16001624 }
16011625
1602 pub inline fn isPowerPC64(arch: Arch) bool {
1626 /// Deprecated; to be removed in 0.18.0. Use `isPowerpc64` instead.
1627 pub const isPowerPC64 = isPowerpc64;
1628
1629 pub inline fn isPowerpc64(arch: Arch) bool {
16031630 return switch (arch) {
16041631 .powerpc64, .powerpc64le => true,
16051632 else => false,
16061633 };
16071634 }
16081635
1609 pub inline fn isSPARC(arch: Arch) bool {
1636 /// Deprecated; to be removed in 0.18.0. Use `isSparc` instead.
1637 pub const isSPARC = isSparc;
1638
1639 pub inline fn isSparc(arch: Arch) bool {
16101640 return switch (arch) {
16111641 .sparc, .sparc64 => true,
16121642 else => false,
16131643 };
16141644 }
16151645
1616 pub inline fn isSpirV(arch: Arch) bool {
1646 /// Deprecated; to be removed in 0.18.0. Use `isSpirv` instead.
1647 pub const isSpirV = isSpirv;
1648
1649 pub inline fn isSpirv(arch: Arch) bool {
16171650 return switch (arch) {
16181651 .spirv32, .spirv64 => true,
16191652 else => false,