diff options
Diffstat (limited to 'src/codegen')
| -rw-r--r-- | src/codegen/c.zig | 6 | ||||
| -rw-r--r-- | src/codegen/llvm.zig | 16 | ||||
| -rw-r--r-- | src/codegen/spirv/Section.zig | 10 |
3 files changed, 10 insertions, 22 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig index 0c2822739c..1fd9539730 100644 --- a/src/codegen/c.zig +++ b/src/codegen/c.zig @@ -4972,8 +4972,7 @@ fn airStructFieldPtr(f: *Function, inst: Air.Inst.Index) !CValue { if (f.liveness.isUnused(inst)) { try reap(f, inst, &.{extra.struct_operand}); - // TODO this @as is needed because of a stage1 bug - return @as(CValue, CValue.none); + return .none; } const struct_ptr = try f.resolveInst(extra.struct_operand); @@ -4987,8 +4986,7 @@ fn airStructFieldPtrIndex(f: *Function, inst: Air.Inst.Index, index: u8) !CValue if (f.liveness.isUnused(inst)) { try reap(f, inst, &.{ty_op.operand}); - // TODO this @as is needed because of a stage1 bug - return @as(CValue, CValue.none); + return .none; } const struct_ptr = try f.resolveInst(ty_op.operand); diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 29d074ea1c..79c253949a 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -1392,8 +1392,9 @@ pub const Object = struct { const dir_path = file.pkg.root_src_directory.path orelse "."; const sub_file_path_z = try gpa.dupeZ(u8, std.fs.path.basename(file.sub_file_path)); defer gpa.free(sub_file_path_z); - const stage1_workaround = std.fs.path.dirname(file.sub_file_path) orelse ""; - const dir_path_z = try std.fs.path.joinZ(gpa, &.{ dir_path, stage1_workaround }); + const dir_path_z = try std.fs.path.joinZ(gpa, &.{ + dir_path, std.fs.path.dirname(file.sub_file_path) orelse "", + }); defer gpa.free(dir_path_z); const di_file = o.di_builder.?.createFile(sub_file_path_z, dir_path_z); gop.value_ptr.* = di_file.toNode(); @@ -6107,12 +6108,11 @@ pub const FuncGen = struct { } fn airAssembly(self: *FuncGen, inst: Air.Inst.Index) !?*llvm.Value { - // Eventually, the Zig compiler needs to be reworked to have inline assembly go - // through the same parsing code regardless of backend, and have LLVM-flavored - // inline assembly be *output* from that assembler. - // We don't have such an assembler implemented yet though. For now, this - // implementation feeds the inline assembly code directly to LLVM, same - // as stage1. + // Eventually, the Zig compiler needs to be reworked to have inline + // assembly go through the same parsing code regardless of backend, and + // have LLVM-flavored inline assembly be *output* from that assembler. + // We don't have such an assembler implemented yet though. For now, + // this implementation feeds the inline assembly code directly to LLVM. const ty_pl = self.air.instructions.items(.data)[inst].ty_pl; const extra = self.air.extraData(Air.Asm, ty_pl.payload); diff --git a/src/codegen/spirv/Section.zig b/src/codegen/spirv/Section.zig index 6484272943..768525028e 100644 --- a/src/codegen/spirv/Section.zig +++ b/src/codegen/spirv/Section.zig @@ -333,8 +333,6 @@ fn extendedUnionSize(comptime Operand: type, operand: Operand) usize { } test "SPIR-V Section emit() - no operands" { - if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest; - var section = Section{}; defer section.deinit(std.testing.allocator); @@ -344,8 +342,6 @@ test "SPIR-V Section emit() - no operands" { } test "SPIR-V Section emit() - simple" { - if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest; - var section = Section{}; defer section.deinit(std.testing.allocator); @@ -362,8 +358,6 @@ test "SPIR-V Section emit() - simple" { } test "SPIR-V Section emit() - string" { - if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest; - var section = Section{}; defer section.deinit(std.testing.allocator); @@ -389,8 +383,6 @@ test "SPIR-V Section emit() - string" { } test "SPIR-V Section emit()- extended mask" { - if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest; - var section = Section{}; defer section.deinit(std.testing.allocator); @@ -415,8 +407,6 @@ test "SPIR-V Section emit()- extended mask" { } test "SPIR-V Section emit() - extended union" { - if (@import("builtin").zig_backend == .stage1) return error.SkipZigTest; - var section = Section{}; defer section.deinit(std.testing.allocator); |
