compiler: avoid field/decl name conflicts

Most of the required renames here are net wins for readaibility, I'd
say. The ones in `arch` are a little more verbose, but I think better. I
didn't bother renaming the non-conflicting functions in
`arch/arm/bits.zig` and `arch/aarch64/bits.zig`, since these backends
are pretty bit-rotted anyway AIUI.
This commit is contained in:
mlugg
2024-08-28 18:25:14 +01:00
parent ba8d3f69ca
commit c62487da76
19 changed files with 604 additions and 623 deletions

View File

@@ -836,16 +836,6 @@ pub const GenResult = union(enum) {
/// Traditionally, this corresponds to emitting a relocation in a relocatable object file.
lea_symbol: u32,
};
fn fail(
gpa: Allocator,
src_loc: Zcu.LazySrcLoc,
comptime format: []const u8,
args: anytype,
) Allocator.Error!GenResult {
const msg = try ErrorMsg.create(gpa, src_loc, format, args);
return .{ .fail = msg };
}
};
fn genNavRef(
@@ -935,7 +925,8 @@ fn genNavRef(
const atom = p9.getAtom(atom_index);
return .{ .mcv = .{ .memory = atom.getOffsetTableAddress(p9) } };
} else {
return GenResult.fail(gpa, src_loc, "TODO genNavRef for target {}", .{target});
const msg = try ErrorMsg.create(gpa, src_loc, "TODO genNavRef for target {}", .{target});
return .{ .fail = msg };
}
}