Autodoc: skip docs when compile errors occur

This commit is contained in:
Andrew Kelley 2022-07-18 13:36:41 -07:00
parent 84adbeb077
commit e5d21e10bc

View File

@ -2288,6 +2288,14 @@ pub fn update(comp: *Compilation) !void {
return; 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 // 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. // -femit-asm to handle, in the case of C objects.
comp.emitOthers(); 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) { if (!use_stage1) {
const outdated_and_deleted_decls_frame = tracy.namedFrame("outdated_and_deleted_decls"); const outdated_and_deleted_decls_frame = tracy.namedFrame("outdated_and_deleted_decls");
defer outdated_and_deleted_decls_frame.end(); defer outdated_and_deleted_decls_frame.end();