From 76fcb95bdf5509f6b02ca8c68af2b8f630a6cfe0 Mon Sep 17 00:00:00 2001 From: Krzysztof Wolicki Der Teufel Date: Sun, 29 Jan 2023 14:42:18 +0100 Subject: autodoc: Implemented struct_init_empty for walkInstruction, fixed variable type with has_init but no type before = --- src/Autodoc.zig | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/Autodoc.zig') diff --git a/src/Autodoc.zig b/src/Autodoc.zig index 8afc9c859b..e51d4a3ca9 100644 --- a/src/Autodoc.zig +++ b/src/Autodoc.zig @@ -2200,17 +2200,10 @@ fn walkInstruction( false, ); - _ = operand; - - // WIP - - printWithContext( - file, - inst_index, - "TODO: implement `{s}` for walkInstruction\n\n", - .{@tagName(tags[inst_index])}, - ); - return self.cteTodo(@tagName(tags[inst_index])); + return DocData.WalkResult{ + .typeRef = operand.expr, + .expr = .{ .@"struct" = &.{} }, + }; }, .struct_init_anon => { const pl_node = data[inst_index].pl_node; @@ -2537,6 +2530,7 @@ fn walkInstruction( const var_init_ref = @intToEnum(Ref, file.zir.extra[extra_index]); const var_init = try self.walkRef(file, parent_scope, parent_src, var_init_ref, need_type); value.expr = var_init.expr; + value.typeRef = var_init.typeRef; } return value; -- cgit v1.2.3 From c3abb63fe99eb7091e5841f8e65f197b77d868a8 Mon Sep 17 00:00:00 2001 From: Krzysztof Wolicki Der Teufel Date: Thu, 2 Feb 2023 14:46:42 +0100 Subject: autodoc: Added `@qualCast` builtin function handling --- lib/docs/main.js | 4 ++++ src/Autodoc.zig | 1 + 2 files changed, 5 insertions(+) (limited to 'src/Autodoc.zig') diff --git a/lib/docs/main.js b/lib/docs/main.js index d488d018a6..62af5866b6 100644 --- a/lib/docs/main.js +++ b/lib/docs/main.js @@ -1354,6 +1354,10 @@ const NAV_MODES = { payloadHtml += "ptrCast"; break; } + case "qual_cast": { + payloadHtml += "qualCast"; + break; + } case "truncate": { payloadHtml += "truncate"; break; diff --git a/src/Autodoc.zig b/src/Autodoc.zig index 8afc9c859b..0798ec198f 100644 --- a/src/Autodoc.zig +++ b/src/Autodoc.zig @@ -1400,6 +1400,7 @@ fn walkInstruction( .float_cast, .int_cast, .ptr_cast, + .qual_cast, .truncate, .align_cast, .has_decl, -- cgit v1.2.3