diff --git a/src/Compilation.zig b/src/Compilation.zig index d4e3c1313..ee2ed6acc 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2288,6 +2288,14 @@ pub fn update(comp: *Compilation) !void { return; } + if (comp.emit_docs) |doc_location| { + if (comp.bin_file.options.module) |module| { + var autodoc = Autodoc.init(module, doc_location); + defer autodoc.deinit(); + try autodoc.generateZirData(); + } + } + // Flush takes care of -femit-bin, but we still have -femit-llvm-ir, -femit-llvm-bc, and // -femit-asm to handle, in the case of C objects. comp.emitOthers(); @@ -2867,14 +2875,6 @@ pub fn performAllTheWork( } } - if (comp.emit_docs) |doc_location| { - if (comp.bin_file.options.module) |module| { - var autodoc = Autodoc.init(module, doc_location); - defer autodoc.deinit(); - try autodoc.generateZirData(); - } - } - if (!use_stage1) { const outdated_and_deleted_decls_frame = tracy.namedFrame("outdated_and_deleted_decls"); defer outdated_and_deleted_decls_frame.end();