Skip to content

Commit ef93148

Browse files
committed
loongarch: rename stage2_loongarch64 backend to stage2_loongarch
1 parent b43554c commit ef93148

File tree

12 files changed

+24
-24
lines changed

12 files changed

+24
-24
lines changed

lib/compiler/test_runner.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var fba = std.heap.FixedBufferAllocator.init(&fba_buffer);
1717
const crippled = switch (builtin.zig_backend) {
1818
.stage2_powerpc,
1919
.stage2_riscv64,
20-
.stage2_loongarch64,
20+
.stage2_loongarch,
2121
=> true,
2222
else => false,
2323
};

lib/std/builtin.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,8 +1126,8 @@ pub const CompilerBackend = enum(u64) {
11261126
/// powerpc backend.
11271127
stage2_powerpc = 12,
11281128
/// The reference implementation self-hosted compiler of Zig, using the
1129-
/// loongarch64 backend.
1130-
stage2_loongarch64 = 13,
1129+
/// loongarch backend.
1130+
stage2_loongarch = 13,
11311131

11321132
_,
11331133
};

lib/std/debug.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ pub fn defaultPanic(
605605
switch (builtin.zig_backend) {
606606
.stage2_aarch64,
607607
.stage2_arm,
608-
.stage2_loongarch64,
608+
.stage2_loongarch,
609609
.stage2_powerpc,
610610
.stage2_riscv64,
611611
.stage2_spirv64,

lib/std/mem.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ const eqlBytes_allowed = switch (builtin.zig_backend) {
678678
// These backends don't support vectors yet.
679679
.stage2_powerpc,
680680
.stage2_riscv64,
681-
.stage2_loongarch64,
681+
.stage2_loongarch,
682682
=> false,
683683
// The SPIR-V backend does not support the optimized path yet.
684684
.stage2_spirv64 => false,

lib/std/os/linux.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ const extern_getauxval = switch (builtin.zig_backend) {
510510
.stage2_powerpc,
511511
.stage2_riscv64,
512512
.stage2_sparc64,
513-
.stage2_loongarch64,
513+
.stage2_loongarch,
514514
=> false,
515515
else => !builtin.link_libc,
516516
};

lib/std/start.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const start_sym_name = if (native_arch.isMIPS()) "__start" else "_start";
1717
pub const simplified_logic = switch (builtin.zig_backend) {
1818
.stage2_aarch64,
1919
.stage2_arm,
20-
.stage2_loongarch64,
20+
.stage2_loongarch,
2121
.stage2_powerpc,
2222
.stage2_sparc64,
2323
.stage2_spirv64,

lib/std/testing.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub const backend_can_print = switch (builtin.zig_backend) {
3636
.stage2_powerpc,
3737
.stage2_riscv64,
3838
.stage2_spirv64,
39-
.stage2_loongarch64,
39+
.stage2_loongarch,
4040
=> false,
4141
else => true,
4242
};

lib/ubsan_rt.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ fn exportHandlerWithAbort(
673673
const can_build_ubsan = switch (builtin.zig_backend) {
674674
.stage2_powerpc,
675675
.stage2_riscv64,
676-
.stage2_loongarch64,
676+
.stage2_loongarch,
677677
=> false,
678678
else => true,
679679
};

src/Zcu.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4590,7 +4590,7 @@ pub fn callconvSupported(zcu: *Zcu, cc: std.builtin.CallingConvention) union(enu
45904590
.spirv_fragment, .spirv_vertex => target.os.tag == .vulkan,
45914591
else => false,
45924592
},
4593-
.stage2_loongarch64 => switch (cc) {
4593+
.stage2_loongarch => switch (cc) {
45944594
.loongarch64_lp64 => true,
45954595
else => false,
45964596
},

src/codegen.zig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fn devFeatureForBackend(backend: std.builtin.CompilerBackend) dev.Feature {
4141
.stage2_wasm => .wasm_backend,
4242
.stage2_x86 => .x86_backend,
4343
.stage2_x86_64 => .x86_64_backend,
44-
.stage2_loongarch64 => .loongarch64_backend,
44+
.stage2_loongarch => .loongarch_backend,
4545
_ => unreachable,
4646
};
4747
}
@@ -53,7 +53,7 @@ fn importBackend(comptime backend: std.builtin.CompilerBackend) type {
5353
.stage2_arm => @import("arch/arm/CodeGen.zig"),
5454
.stage2_c => @import("codegen/c.zig"),
5555
.stage2_llvm => @import("codegen/llvm.zig"),
56-
.stage2_loongarch64 => @import("arch/loongarch64/CodeGen.zig"),
56+
.stage2_loongarch => @import("arch/loongarch64/CodeGen.zig"),
5757
.stage2_powerpc => @import("arch/powerpc/CodeGen.zig"),
5858
.stage2_riscv64 => @import("arch/riscv64/CodeGen.zig"),
5959
.stage2_sparc64 => @import("arch/sparc64/CodeGen.zig"),
@@ -79,7 +79,7 @@ pub fn legalizeFeatures(pt: Zcu.PerThread, nav_index: InternPool.Nav.Index) ?*co
7979
.stage2_riscv64,
8080
.stage2_sparc64,
8181
.stage2_spirv64,
82-
.stage2_loongarch64,
82+
.stage2_loongarch,
8383
.stage2_powerpc,
8484
=> |backend| {
8585
dev.check(devFeatureForBackend(backend));
@@ -106,7 +106,7 @@ pub const AnyMir = union {
106106
return switch (backend) {
107107
.stage2_aarch64 => "aarch64",
108108
.stage2_arm => "arm",
109-
.stage2_loongarch64 => "loongarch64",
109+
.stage2_loongarch => "loongarch64",
110110
.stage2_powerpc => "powerpc",
111111
.stage2_riscv64 => "riscv64",
112112
.stage2_sparc64 => "sparc64",
@@ -124,7 +124,7 @@ pub const AnyMir = union {
124124
else => unreachable,
125125
inline .stage2_aarch64,
126126
.stage2_arm,
127-
.stage2_loongarch64,
127+
.stage2_loongarch,
128128
.stage2_powerpc,
129129
.stage2_riscv64,
130130
.stage2_sparc64,
@@ -156,7 +156,7 @@ pub fn generateFunction(
156156
else => unreachable,
157157
inline .stage2_aarch64,
158158
.stage2_arm,
159-
.stage2_loongarch64,
159+
.stage2_loongarch,
160160
.stage2_powerpc,
161161
.stage2_riscv64,
162162
.stage2_sparc64,
@@ -195,7 +195,7 @@ pub fn emitFunction(
195195
else => unreachable,
196196
inline .stage2_aarch64,
197197
.stage2_arm,
198-
.stage2_loongarch64,
198+
.stage2_loongarch,
199199
.stage2_powerpc,
200200
.stage2_riscv64,
201201
.stage2_sparc64,

src/dev.zig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub const Env = enum {
4646

4747
/// - sema
4848
/// - `zig build-* -fincremental -fno-llvm -fno-lld -target loongarch64-linux --listen=-`
49-
@"loongarch64-linux",
49+
@"loongarch-linux",
5050

5151
pub inline fn supports(comptime dev_env: Env, comptime feature: Feature) bool {
5252
return switch (dev_env) {
@@ -89,7 +89,7 @@ pub const Env = enum {
8989
.riscv64_backend,
9090
.sparc64_backend,
9191
.spirv64_backend,
92-
.loongarch64_backend,
92+
.loongarch_backend,
9393
.lld_linker,
9494
.coff_linker,
9595
.elf_linker,
@@ -191,11 +191,11 @@ pub const Env = enum {
191191
=> true,
192192
else => Env.sema.supports(feature),
193193
},
194-
.@"loongarch64-linux" => switch (feature) {
194+
.@"loongarch-linux" => switch (feature) {
195195
.build_command,
196196
.stdio_listen,
197197
.incremental,
198-
.loongarch64_backend,
198+
.loongarch_backend,
199199
.elf_linker,
200200
.legalize,
201201
=> true,
@@ -264,7 +264,7 @@ pub const Feature = enum {
264264
riscv64_backend,
265265
sparc64_backend,
266266
spirv64_backend,
267-
loongarch64_backend,
267+
loongarch_backend,
268268

269269
lld_linker,
270270
coff_linker,

src/target.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ pub fn zigBackend(target: std.Target, use_llvm: bool) std.builtin.CompilerBacken
810810
return switch (target.cpu.arch) {
811811
.aarch64, .aarch64_be => .stage2_aarch64,
812812
.arm, .armeb, .thumb, .thumbeb => .stage2_arm,
813-
.loongarch64 => .stage2_loongarch64,
813+
.loongarch64 => .stage2_loongarch,
814814
.powerpc, .powerpcle, .powerpc64, .powerpc64le => .stage2_powerpc,
815815
.riscv64 => .stage2_riscv64,
816816
.sparc64 => .stage2_sparc64,
@@ -851,7 +851,7 @@ pub inline fn backendSupportsFeature(backend: std.builtin.CompilerBackend, compt
851851
},
852852
.separate_thread => switch (backend) {
853853
.stage2_llvm => false,
854-
.stage2_c, .stage2_wasm, .stage2_x86_64, .stage2_loongarch64 => true,
854+
.stage2_c, .stage2_wasm, .stage2_x86_64, .stage2_loongarch => true,
855855
// TODO: most self-hosted backends should be able to support this without too much work.
856856
else => false,
857857
},

0 commit comments

Comments
 (0)