Skip to content

link.Dwarf loads AST when emitting debug info #21227

Closed
@mlugg

Description

@mlugg

The following calls to Zcu.File.getTree must be eliminated:

const tree = try file.getTree(dwarf.gpa);

const tree = try file.getTree(dwarf.gpa);

const tree = try file.getTree(dwarf.gpa);

const tree = try file.getTree(dwarf.gpa);

This will require adding column information to ZIR declaration instructions, probably through a src_column: u32 field here:

zig/lib/std/zig/Zir.zig

Lines 2581 to 2590 in 1a178d4

pub const Declaration = struct {
// These fields should be concatenated and reinterpreted as a `std.zig.SrcHash`.
src_hash_0: u32,
src_hash_1: u32,
src_hash_2: u32,
src_hash_3: u32,
/// The name of this `Decl`. Also indicates whether it is a test, comptime block, etc.
name: Name,
src_line: u32,
flags: Flags,

Labeling as a bug because the compiler should never call getTree on a ZIR cache hit without compile errors in the file in question.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions