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 › Type › bits Public Function bits Doc Source Public Function std.zig.llvm.Builder.Type.bits
pub fn bits (ty : Type , builder : *const Builder ) Size Params File zig/llvm/Builder.zig: 1684
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703 pub fn bits (ty : Type , builder : *const Builder ) Size {
const item = builder .type_items .items [@backingInt (ty )];
return switch (item .tag ) {
else => unreachable ,
.simple => switch (@as (Simple , @fromBackingInt (@intCast (item .data )))) {
else => unreachable ,
.label => .{ .fixed = builder .data_layout .getPointerSpec (.default ).bit_width },
.half , .bfloat => .{ .fixed = 16 },
.float => .{ .fixed = 32 },
.double => .{ .fixed = 64 },
.ppc_fp128 , .fp128 => .{ .fixed = 128 },
.x86_amx => .{ .fixed = 8192 },
.x86_fp80 => .{ .fixed = 80 },
},
.integer => .{ .fixed = item .data },
.pointer => .{
.fixed = builder .data_layout .getPointerSpec (@fromBackingInt (@intCast (item .data ))).bit_width ,
},
};
}