mirror of
https://github.com/ziglang/zig.git
synced 2026-12-05 20:48:47 -05:00
Module: handle incremental update from ZIR with AST errors
This commit is contained in:
1 parent
e098b287e1
commit
1dbb616e73
1 file changed
+3
-1
+3
-1
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user