authorgravatar for der.teufel.mail@gmail.comKrzysztof Wolicki <der.teufel.mail@gmail.com> 2023-10-22 16:15:56+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2023-10-22 16:15:56+02:00
logb4d4d19958d6b8fd855401aeb8691205a134f7a3
tree6e5cda618c00432d6031d975b898f49a01e2873d
parent606f0e496ec51932e12a9e8f512cced5365d66b9
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

autodoc: Add support for struct_init_empty_ref_result (#17476)


1 files changed, 20 insertions(+), 0 deletions(-)

src/Autodoc.zig+20
......@@ -2897,6 +2897,26 @@ fn walkInstruction(
28972897 .expr = .{ .@"struct" = &.{} },
28982898 };
28992899 },
2900 .struct_init_empty_ref_result => {
2901 const un_node = data[inst_index].un_node;
2902
2903 var operand: DocData.WalkResult = try self.walkRef(
2904 file,
2905 parent_scope,
2906 parent_src,
2907 un_node.operand,
2908 false,
2909 call_ctx,
2910 );
2911
2912 const struct_init_idx = self.exprs.items.len;
2913 try self.exprs.append(self.arena, .{ .@"struct" = &.{} });
2914
2915 return DocData.WalkResult{
2916 .typeRef = operand.expr,
2917 .expr = .{ .@"&" = struct_init_idx },
2918 };
2919 },
29002920 .struct_init_anon => {
29012921 const pl_node = data[inst_index].pl_node;
29022922 const extra = file.zir.extraData(Zir.Inst.StructInitAnon, pl_node.payload_index);