Skip to content

Commit 8ec68c6

Browse files
authored
Merge pull request #21323 from jacobly0/dwarf-decls
Dwarf: implement more decls
2 parents 9007534 + 6aa6d08 commit 8ec68c6

26 files changed

+1354
-695
lines changed

ci/x86_64-linux-debug.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ stage3-debug/bin/zig build \
6464

6565
stage3-debug/bin/zig build test docs \
6666
--maxrss 21000000000 \
67-
-Dlldb=$HOME/deps/lldb-zig/Debug-befcd57a8/bin/lldb \
67+
-Dlldb=$HOME/deps/lldb-zig/Debug-4a44163df/bin/lldb \
6868
-fqemu \
6969
-fwasmtime \
7070
-Dstatic-llvm \

ci/x86_64-linux-release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ stage3-release/bin/zig build \
6464

6565
stage3-release/bin/zig build test docs \
6666
--maxrss 21000000000 \
67-
-Dlldb=$HOME/deps/lldb-zig/Release-befcd57a8/bin/lldb \
67+
-Dlldb=$HOME/deps/lldb-zig/Release-4a44163df/bin/lldb \
6868
-fqemu \
6969
-fwasmtime \
7070
-Dstatic-llvm \

lib/std/hash_map.zig

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,9 +1767,11 @@ pub fn HashMapUnmanaged(
17671767
}
17681768

17691769
comptime {
1770-
if (!builtin.strip_debug_info) {
1771-
_ = &dbHelper;
1772-
}
1770+
if (!builtin.strip_debug_info) _ = switch (builtin.zig_backend) {
1771+
.stage2_llvm => &dbHelper,
1772+
.stage2_x86_64 => KV,
1773+
else => {},
1774+
};
17731775
}
17741776
};
17751777
}

lib/std/multi_array_list.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ pub fn MultiArrayList(comptime T: type) type {
573573
}
574574

575575
comptime {
576-
if (!builtin.strip_debug_info) {
576+
if (builtin.zig_backend == .stage2_llvm and !builtin.strip_debug_info) {
577577
_ = &dbHelper;
578578
_ = &Slice.dbHelper;
579579
}

src/InternPool.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4723,7 +4723,7 @@ pub const Index = enum(u32) {
47234723
}
47244724

47254725
comptime {
4726-
if (!builtin.strip_debug_info) {
4726+
if (builtin.zig_backend == .stage2_llvm and !builtin.strip_debug_info) {
47274727
_ = &dbHelper;
47284728
}
47294729
}

src/arch/aarch64/CodeGen.zig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const Alignment = InternPool.Alignment;
2525

2626
const CodeGenError = codegen.CodeGenError;
2727
const Result = codegen.Result;
28-
const DebugInfoOutput = codegen.DebugInfoOutput;
2928

3029
const bits = @import("bits.zig");
3130
const abi = @import("abi.zig");
@@ -48,7 +47,7 @@ pt: Zcu.PerThread,
4847
air: Air,
4948
liveness: Liveness,
5049
bin_file: *link.File,
51-
debug_output: DebugInfoOutput,
50+
debug_output: link.File.DebugInfoOutput,
5251
target: *const std.Target,
5352
func_index: InternPool.Index,
5453
owner_nav: InternPool.Nav.Index,
@@ -327,7 +326,7 @@ pub fn generate(
327326
air: Air,
328327
liveness: Liveness,
329328
code: *std.ArrayList(u8),
330-
debug_output: DebugInfoOutput,
329+
debug_output: link.File.DebugInfoOutput,
331330
) CodeGenError!Result {
332331
const zcu = pt.zcu;
333332
const gpa = zcu.gpa;

src/arch/aarch64/Emit.zig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ const assert = std.debug.assert;
1313
const Instruction = bits.Instruction;
1414
const Register = bits.Register;
1515
const log = std.log.scoped(.aarch64_emit);
16-
const DebugInfoOutput = @import("../../codegen.zig").DebugInfoOutput;
1716

1817
mir: Mir,
1918
bin_file: *link.File,
20-
debug_output: DebugInfoOutput,
19+
debug_output: link.File.DebugInfoOutput,
2120
target: *const std.Target,
2221
err_msg: ?*ErrorMsg = null,
2322
src_loc: Zcu.LazySrcLoc,

src/arch/arm/CodeGen.zig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const Alignment = InternPool.Alignment;
2525

2626
const Result = codegen.Result;
2727
const CodeGenError = codegen.CodeGenError;
28-
const DebugInfoOutput = codegen.DebugInfoOutput;
2928

3029
const bits = @import("bits.zig");
3130
const abi = @import("abi.zig");
@@ -49,7 +48,7 @@ pt: Zcu.PerThread,
4948
air: Air,
5049
liveness: Liveness,
5150
bin_file: *link.File,
52-
debug_output: DebugInfoOutput,
51+
debug_output: link.File.DebugInfoOutput,
5352
target: *const std.Target,
5453
func_index: InternPool.Index,
5554
err_msg: ?*ErrorMsg,
@@ -335,7 +334,7 @@ pub fn generate(
335334
air: Air,
336335
liveness: Liveness,
337336
code: *std.ArrayList(u8),
338-
debug_output: DebugInfoOutput,
337+
debug_output: link.File.DebugInfoOutput,
339338
) CodeGenError!Result {
340339
const zcu = pt.zcu;
341340
const gpa = zcu.gpa;

src/arch/arm/Emit.zig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ const assert = std.debug.assert;
1616
const Instruction = bits.Instruction;
1717
const Register = bits.Register;
1818
const log = std.log.scoped(.aarch32_emit);
19-
const DebugInfoOutput = @import("../../codegen.zig").DebugInfoOutput;
2019
const CodeGen = @import("CodeGen.zig");
2120

2221
mir: Mir,
2322
bin_file: *link.File,
24-
debug_output: DebugInfoOutput,
23+
debug_output: link.File.DebugInfoOutput,
2524
target: *const std.Target,
2625
err_msg: ?*ErrorMsg = null,
2726
src_loc: Zcu.LazySrcLoc,

src/arch/riscv64/CodeGen.zig

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ const Alignment = InternPool.Alignment;
3232

3333
const CodeGenError = codegen.CodeGenError;
3434
const Result = codegen.Result;
35-
const DebugInfoOutput = codegen.DebugInfoOutput;
3635

3736
const bits = @import("bits.zig");
3837
const abi = @import("abi.zig");
@@ -61,7 +60,7 @@ gpa: Allocator,
6160

6261
mod: *Package.Module,
6362
target: *const std.Target,
64-
debug_output: DebugInfoOutput,
63+
debug_output: link.File.DebugInfoOutput,
6564
err_msg: ?*ErrorMsg,
6665
args: []MCValue,
6766
ret_mcv: InstTracking,
@@ -760,7 +759,7 @@ pub fn generate(
760759
air: Air,
761760
liveness: Liveness,
762761
code: *std.ArrayList(u8),
763-
debug_output: DebugInfoOutput,
762+
debug_output: link.File.DebugInfoOutput,
764763
) CodeGenError!Result {
765764
const zcu = pt.zcu;
766765
const comp = zcu.comp;
@@ -928,7 +927,7 @@ pub fn generateLazy(
928927
src_loc: Zcu.LazySrcLoc,
929928
lazy_sym: link.File.LazySymbol,
930929
code: *std.ArrayList(u8),
931-
debug_output: DebugInfoOutput,
930+
debug_output: link.File.DebugInfoOutput,
932931
) CodeGenError!Result {
933932
const comp = bin_file.comp;
934933
const gpa = comp.gpa;

src/arch/riscv64/Emit.zig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
bin_file: *link.File,
44
lower: Lower,
5-
debug_output: DebugInfoOutput,
5+
debug_output: link.File.DebugInfoOutput,
66
code: *std.ArrayList(u8),
77

88
prev_di_line: u32,
@@ -216,7 +216,6 @@ const log = std.log.scoped(.emit);
216216
const mem = std.mem;
217217
const std = @import("std");
218218

219-
const DebugInfoOutput = @import("../../codegen.zig").DebugInfoOutput;
220219
const Emit = @This();
221220
const Lower = @import("Lower.zig");
222221
const Mir = @import("Mir.zig");

src/arch/sparc64/CodeGen.zig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const Liveness = @import("../../Liveness.zig");
2222
const Type = @import("../../Type.zig");
2323
const CodeGenError = codegen.CodeGenError;
2424
const Result = @import("../../codegen.zig").Result;
25-
const DebugInfoOutput = @import("../../codegen.zig").DebugInfoOutput;
2625
const Endian = std.builtin.Endian;
2726
const Alignment = InternPool.Alignment;
2827

@@ -57,7 +56,7 @@ bin_file: *link.File,
5756
target: *const std.Target,
5857
func_index: InternPool.Index,
5958
code: *std.ArrayList(u8),
60-
debug_output: DebugInfoOutput,
59+
debug_output: link.File.DebugInfoOutput,
6160
err_msg: ?*ErrorMsg,
6261
args: []MCValue,
6362
ret_mcv: MCValue,
@@ -268,7 +267,7 @@ pub fn generate(
268267
air: Air,
269268
liveness: Liveness,
270269
code: *std.ArrayList(u8),
271-
debug_output: DebugInfoOutput,
270+
debug_output: link.File.DebugInfoOutput,
272271
) CodeGenError!Result {
273272
const zcu = pt.zcu;
274273
const gpa = zcu.gpa;

src/arch/sparc64/Emit.zig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const Zcu = @import("../../Zcu.zig");
99
const ErrorMsg = Zcu.ErrorMsg;
1010
const Liveness = @import("../../Liveness.zig");
1111
const log = std.log.scoped(.sparcv9_emit);
12-
const DebugInfoOutput = @import("../../codegen.zig").DebugInfoOutput;
1312

1413
const Emit = @This();
1514
const Mir = @import("Mir.zig");
@@ -19,7 +18,7 @@ const Register = bits.Register;
1918

2019
mir: Mir,
2120
bin_file: *link.File,
22-
debug_output: DebugInfoOutput,
21+
debug_output: link.File.DebugInfoOutput,
2322
target: *const std.Target,
2423
err_msg: ?*ErrorMsg = null,
2524
src_loc: Zcu.LazySrcLoc,

src/arch/wasm/CodeGen.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ block_depth: u32 = 0,
648648
air: Air,
649649
liveness: Liveness,
650650
gpa: mem.Allocator,
651-
debug_output: codegen.DebugInfoOutput,
651+
debug_output: link.File.DebugInfoOutput,
652652
func_index: InternPool.Index,
653653
/// Contains a list of current branches.
654654
/// When we return from a branch, the branch will be popped from this list,
@@ -1211,7 +1211,7 @@ pub fn generate(
12111211
air: Air,
12121212
liveness: Liveness,
12131213
code: *std.ArrayList(u8),
1214-
debug_output: codegen.DebugInfoOutput,
1214+
debug_output: link.File.DebugInfoOutput,
12151215
) codegen.CodeGenError!codegen.Result {
12161216
const zcu = pt.zcu;
12171217
const gpa = zcu.gpa;

src/arch/wasm/Emit.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ owner_nav: InternPool.Nav.Index,
2626

2727
// Debug information
2828
/// Holds the debug information for this emission
29-
dbg_output: codegen.DebugInfoOutput,
29+
dbg_output: link.File.DebugInfoOutput,
3030
/// Previous debug info line
3131
prev_di_line: u32,
3232
/// Previous debug info column

src/arch/x86_64/CodeGen.zig

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const Air = @import("../../Air.zig");
1717
const Allocator = mem.Allocator;
1818
const CodeGenError = codegen.CodeGenError;
1919
const Compilation = @import("../../Compilation.zig");
20-
const DebugInfoOutput = codegen.DebugInfoOutput;
2120
const ErrorMsg = Zcu.ErrorMsg;
2221
const Result = codegen.Result;
2322
const Emit = @import("Emit.zig");
@@ -53,7 +52,7 @@ pt: Zcu.PerThread,
5352
air: Air,
5453
liveness: Liveness,
5554
bin_file: *link.File,
56-
debug_output: DebugInfoOutput,
55+
debug_output: link.File.DebugInfoOutput,
5756
target: *const std.Target,
5857
owner: Owner,
5958
inline_func: InternPool.Index,
@@ -819,7 +818,7 @@ pub fn generate(
819818
air: Air,
820819
liveness: Liveness,
821820
code: *std.ArrayList(u8),
822-
debug_output: DebugInfoOutput,
821+
debug_output: link.File.DebugInfoOutput,
823822
) CodeGenError!Result {
824823
const zcu = pt.zcu;
825824
const comp = zcu.comp;
@@ -1000,7 +999,7 @@ pub fn generateLazy(
1000999
src_loc: Zcu.LazySrcLoc,
10011000
lazy_sym: link.File.LazySymbol,
10021001
code: *std.ArrayList(u8),
1003-
debug_output: DebugInfoOutput,
1002+
debug_output: link.File.DebugInfoOutput,
10041003
) CodeGenError!Result {
10051004
const comp = bin_file.comp;
10061005
const gpa = comp.gpa;

src/arch/x86_64/Emit.zig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
air: Air,
44
lower: Lower,
55
atom_index: u32,
6-
debug_output: DebugInfoOutput,
6+
debug_output: link.File.DebugInfoOutput,
77
code: *std.ArrayList(u8),
88

99
prev_di_line: u32,
@@ -546,7 +546,6 @@ const log = std.log.scoped(.emit);
546546
const std = @import("std");
547547

548548
const Air = @import("../../Air.zig");
549-
const DebugInfoOutput = @import("../../codegen.zig").DebugInfoOutput;
550549
const Emit = @This();
551550
const Lower = @import("Lower.zig");
552551
const Mir = @import("Mir.zig");

0 commit comments

Comments
 (0)