aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Wolicki Der Teufel <der.teufel.mail@gmail.com>2023-01-29 14:42:18 +0100
committerKrzysztof Wolicki Der Teufel <der.teufel.mail@gmail.com>2023-01-29 14:42:18 +0100
commit76fcb95bdf5509f6b02ca8c68af2b8f630a6cfe0 (patch)
tree71a3389e67bc5c805492781068ca37284044c21b
parentf68d3c63df0486c7039732ef442c87fcd7c6fc57 (diff)
downloadzig-76fcb95bdf5509f6b02ca8c68af2b8f630a6cfe0.tar.gz
zig-76fcb95bdf5509f6b02ca8c68af2b8f630a6cfe0.zip
autodoc: Implemented struct_init_empty for walkInstruction, fixed variable type with has_init but no type before =
-rw-r--r--src/Autodoc.zig16
1 files changed, 5 insertions, 11 deletions
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;