mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 12:59:04 +00:00
Module: handle incremental update from ZIR with AST errors
This commit is contained in:
parent
e098b287e1
commit
1dbb616e73
@ -3867,6 +3867,9 @@ fn updateZirRefs(mod: *Module, file: *File, old_zir: Zir) !void {
|
||||
const gpa = mod.gpa;
|
||||
const new_zir = file.zir;
|
||||
|
||||
// The root decl will be null if the previous ZIR had AST errors.
|
||||
const root_decl = file.root_decl.unwrap() orelse return;
|
||||
|
||||
// Maps from old ZIR to new ZIR, struct_decl, enum_decl, etc. Any instruction which
|
||||
// creates a namespace, gets mapped from old to new here.
|
||||
var inst_map: std.AutoHashMapUnmanaged(Zir.Inst.Index, Zir.Inst.Index) = .{};
|
||||
@ -3884,7 +3887,6 @@ fn updateZirRefs(mod: *Module, file: *File, old_zir: Zir) !void {
|
||||
var decl_stack: ArrayListUnmanaged(Decl.Index) = .{};
|
||||
defer decl_stack.deinit(gpa);
|
||||
|
||||
const root_decl = file.root_decl.unwrap().?;
|
||||
try decl_stack.append(gpa, root_decl);
|
||||
|
||||
file.deleted_decls.clearRetainingCapacity();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user