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 › llvm › Builder › WipFunction › phiTag Private Function phiTag Doc Source 8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035 fn phiTag (
self : *WipFunction ,
tag : Instruction .Tag ,
ty : Type ,
name : []const u8 ,
) Allocator .Error !WipPhi {
switch (tag ) {
.phi , .@"phi fast" => assert (try ty .isSized (self .builder )),
else => unreachable ,
}
const incoming = self .cursor .block .ptrConst (self ).incoming ;
assert (incoming > 0 );
try self .ensureUnusedExtraCapacity (1 , Instruction .Phi , incoming * 2 );
const instruction = try self .addInst (name , .{
.tag = tag ,
.data = self .addExtraAssumeCapacity (Instruction .Phi { .type = ty }),
});
_ = self .extra .addManyAsSliceAssumeCapacity (incoming * 2 );
return .{ .block = self .cursor .block , .instruction = instruction };
}