aboutsummaryrefslogtreecommitdiff
path: root/src/link/Dwarf.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2023-05-26 23:29:05 +0300
committerAndrew Kelley <andrew@ziglang.org>2023-05-26 21:42:19 -0700
commitca16f1e8a703491bcaac0d13379d2556e8ca837d (patch)
treefefadd0912e8e3deedbf0a7261219fbd7ee5149f /src/link/Dwarf.zig
parentdbd44658ff2d392451ea4f3a38ca4bd26da34314 (diff)
downloadzig-ca16f1e8a703491bcaac0d13379d2556e8ca837d.tar.gz
zig-ca16f1e8a703491bcaac0d13379d2556e8ca837d.zip
std.Target adjustments
* move `ptrBitWidth` from Arch to Target since it needs to know about the abi * double isn't always 8 bits * AVR uses 1-byte alignment for everything in GCC
Diffstat (limited to 'src/link/Dwarf.zig')
-rw-r--r--src/link/Dwarf.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/link/Dwarf.zig b/src/link/Dwarf.zig
index 1a064049fc..1d358a29ab 100644
--- a/src/link/Dwarf.zig
+++ b/src/link/Dwarf.zig
@@ -260,7 +260,7 @@ pub const DeclState = struct {
.Pointer => {
if (ty.isSlice()) {
// Slices are structs: struct { .ptr = *, .len = N }
- const ptr_bits = target.cpu.arch.ptrBitWidth();
+ const ptr_bits = target.ptrBitWidth();
const ptr_bytes = @intCast(u8, @divExact(ptr_bits, 8));
// DW.AT.structure_type
try dbg_info_buffer.ensureUnusedCapacity(2);
@@ -751,7 +751,7 @@ pub const DeclState = struct {
.memory,
.linker_load,
=> {
- const ptr_width = @intCast(u8, @divExact(target.cpu.arch.ptrBitWidth(), 8));
+ const ptr_width = @intCast(u8, @divExact(target.ptrBitWidth(), 8));
try dbg_info.ensureUnusedCapacity(2 + ptr_width);
dbg_info.appendSliceAssumeCapacity(&[2]u8{ // DW.AT.location, DW.FORM.exprloc
1 + ptr_width + @boolToInt(is_ptr),
@@ -928,7 +928,7 @@ const min_nop_size = 2;
const ideal_factor = 3;
pub fn init(allocator: Allocator, bin_file: *File, target: std.Target) Dwarf {
- const ptr_width: PtrWidth = switch (target.cpu.arch.ptrBitWidth()) {
+ const ptr_width: PtrWidth = switch (target.ptrBitWidth()) {
0...32 => .p32,
33...64 => .p64,
else => unreachable,