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 › addExtendedMultiOpPayloadIndex Private Function addExtendedMultiOpPayloadIndex Doc Source Private Function std.zig.AstGen.GenZir.addExtendedMultiOpPayloadIndex
fn addExtendedMultiOpPayloadIndex (
gz : *GenZir ,
opcode : Zir .Inst .Extended ,
payload_index : u32 ,
trailing_len : usize ,
) !Zir .Inst .Ref Params gz : *GenZir opcode : Zir .Inst .Extended payload_index : u32 trailing_len : usize File zig/AstGen.zig: 11938
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960 fn addExtendedMultiOpPayloadIndex (
gz : *GenZir ,
opcode : Zir .Inst .Extended ,
payload_index : u32 ,
trailing_len : usize ,
) !Zir .Inst .Ref {
const astgen = gz .astgen ;
const gpa = astgen .gpa ;
try gz .instructions .ensureUnusedCapacity (gpa , 1 );
try astgen .instructions .ensureUnusedCapacity (gpa , 1 );
const new_index : Zir .Inst .Index = @fromBackingInt (@intCast (astgen .instructions .len ));
astgen .instructions .appendAssumeCapacity (.{
.tag = .extended ,
.data = .{ .extended = .{
.opcode = opcode ,
.small = @intCast (trailing_len ),
.operand = payload_index ,
} },
});
gz .instructions .appendAssumeCapacity (new_index );
return new_index .toRef ();
}