Zig 0.17.0-dev (Split by item) This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig standard library.
std › zig › AstGen › GenZir › addExtendedPayloadSmall Private Function addExtendedPayloadSmall Doc Source Private Function std.zig.AstGen.GenZir.addExtendedPayloadSmall
fn addExtendedPayloadSmall (
gz : *GenZir ,
opcode : Zir .Inst .Extended ,
small : u16 ,
extra : anytype ,
) !Zir .Inst .Ref Params gz : *GenZir opcode : Zir .Inst .Extended small : u16 extra File zig/AstGen.zig: 11880
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903 fn addExtendedPayloadSmall (
gz : *GenZir ,
opcode : Zir .Inst .Extended ,
small : u16 ,
extra : anytype ,
) !Zir .Inst .Ref {
const gpa = gz .astgen .gpa ;
try gz .instructions .ensureUnusedCapacity (gpa , 1 );
try gz .astgen .instructions .ensureUnusedCapacity (gpa , 1 );
const payload_index = try gz .astgen .addExtra (extra );
const new_index : Zir .Inst .Index = @fromBackingInt (@intCast (gz .astgen .instructions .len ));
gz .astgen .instructions .appendAssumeCapacity (.{
.tag = .extended ,
.data = .{ .extended = .{
.opcode = opcode ,
.small = small ,
.operand = payload_index ,
} },
});
gz .instructions .appendAssumeCapacity (new_index );
return new_index .toRef ();
}