aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-07-22 20:56:59 -0700
committerGitHub <noreply@github.com>2022-07-22 20:56:59 -0700
commit7502e490cb83a91133aa696e4ec0936022bee0c6 (patch)
treee87e4bcdc01f312a0dcf401c959fd52830d0c56a /src/Compilation.zig
parentf591936480730a279d55a051f92806e19834faf7 (diff)
parent92966088c2679ef670dc9776408deee98d16486f (diff)
downloadzig-7502e490cb83a91133aa696e4ec0936022bee0c6.tar.gz
zig-7502e490cb83a91133aa696e4ec0936022bee0c6.zip
Merge pull request #12173 from ziglang/autodocs-rebased
New Autodocs!
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 659fa5e972..5204910193 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -34,6 +34,7 @@ const ThreadPool = @import("ThreadPool.zig");
const WaitGroup = @import("WaitGroup.zig");
const libtsan = @import("libtsan.zig");
const Zir = @import("Zir.zig");
+const Autodoc = @import("Autodoc.zig");
const Color = @import("main.zig").Color;
/// General-purpose allocator. Used for both temporary and long-term storage.
@@ -2287,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();
@@ -5160,8 +5169,6 @@ fn updateStage1Module(comp: *Compilation, main_progress_node: *std.Progress.Node
const emit_asm_path = try stage1LocPath(arena, comp.emit_asm, directory);
const emit_llvm_ir_path = try stage1LocPath(arena, comp.emit_llvm_ir, directory);
const emit_llvm_bc_path = try stage1LocPath(arena, comp.emit_llvm_bc, directory);
- const emit_analysis_path = try stage1LocPath(arena, comp.emit_analysis, directory);
- const emit_docs_path = try stage1LocPath(arena, comp.emit_docs, directory);
const stage1_pkg = try createStage1Pkg(arena, "root", mod.main_pkg, null);
const test_filter = comp.test_filter orelse ""[0..0];
const test_name_prefix = comp.test_name_prefix orelse ""[0..0];
@@ -5182,10 +5189,6 @@ fn updateStage1Module(comp: *Compilation, main_progress_node: *std.Progress.Node
.emit_llvm_ir_len = emit_llvm_ir_path.len,
.emit_bitcode_ptr = emit_llvm_bc_path.ptr,
.emit_bitcode_len = emit_llvm_bc_path.len,
- .emit_analysis_json_ptr = emit_analysis_path.ptr,
- .emit_analysis_json_len = emit_analysis_path.len,
- .emit_docs_ptr = emit_docs_path.ptr,
- .emit_docs_len = emit_docs_path.len,
.builtin_zig_path_ptr = builtin_zig_path.ptr,
.builtin_zig_path_len = builtin_zig_path.len,
.test_filter_ptr = test_filter.ptr,