Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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. Public Enum

Index

Public Enum
std.zig.llvm.Builder.Function.Index
pub const Index = enum(u32)

Functions

pub fn ptr(self: Index, builder: *Builder) *Function
pub fn ptrConst(self: Index, builder: *const Builder) *const Function
pub fn name(self: Index, builder: *const Builder) StrtabString
pub fn rename(self: Index, new_name: StrtabString, builder: *Builder) Allocator.Error!void
pub fn typeOf(self: Index, builder: *const Builder) Type
pub fn toConst(self: Index, builder: *const Builder) Constant
pub fn toValue(self: Index, builder: *const Builder) Value
pub fn setLinkage(self: Index, linkage: Linkage, builder: *Builder) void
pub fn setUnnamedAddr(self: Index, unnamed_addr: UnnamedAddr, builder: *Builder) void
pub fn setCallConv(self: Index, call_conv: CallConv, builder: *Builder) void
pub fn setAttributes(self: Index, new_function_attributes: FunctionAttributes, builder: *Builder) void
pub fn getAttributes(self: Index, builder: *Builder) FunctionAttributes
pub fn setSection(self: Index, section: String, builder: *Builder) void
pub fn setAlignment(self: Index, alignment: Alignment, builder: *Builder) void
pub fn setSubprogram(self: Index, subprogram: Metadata, builder: *Builder) void
pub fn getSubprogram(self: Index, builder: *const Builder) Metadata.Optional

File

zig/llvm/Builder.zig:5207
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
    pub const Index = enum(u32) {
        none = maxInt(u32),
        _,

        pub fn ptr(self: Index, builder: *Builder) *Function {
            return &builder.functions.items[@backingInt(self)];
        }

        pub fn ptrConst(self: Index, builder: *const Builder) *const Function {
            return &builder.functions.items[@backingInt(self)];
        }

        pub fn name(self: Index, builder: *const Builder) StrtabString {
            return self.ptrConst(builder).global.name(builder);
        }

        pub fn rename(self: Index, new_name: StrtabString, builder: *Builder) Allocator.Error!void {
            return self.ptrConst(builder).global.rename(new_name, builder);
        }

        pub fn typeOf(self: Index, builder: *const Builder) Type {
            return self.ptrConst(builder).global.typeOf(builder);
        }

        pub fn toConst(self: Index, builder: *const Builder) Constant {
            return self.ptrConst(builder).global.toConst();
        }

        pub fn toValue(self: Index, builder: *const Builder) Value {
            return self.toConst(builder).toValue();
        }

        pub fn setLinkage(self: Index, linkage: Linkage, builder: *Builder) void {
            return self.ptrConst(builder).global.setLinkage(linkage, builder);
        }

        pub fn setUnnamedAddr(self: Index, unnamed_addr: UnnamedAddr, builder: *Builder) void {
            return self.ptrConst(builder).global.setUnnamedAddr(unnamed_addr, builder);
        }

        pub fn setCallConv(self: Index, call_conv: CallConv, builder: *Builder) void {
            self.ptr(builder).call_conv = call_conv;
        }

        pub fn setAttributes(
            self: Index,
            new_function_attributes: FunctionAttributes,
            builder: *Builder,
        ) void {
            self.ptr(builder).attributes = new_function_attributes;
        }

        pub fn getAttributes(self: Index, builder: *Builder) FunctionAttributes {
            return self.ptr(builder).attributes;
        }

        pub fn setSection(self: Index, section: String, builder: *Builder) void {
            self.ptr(builder).section = section;
        }

        pub fn setAlignment(self: Index, alignment: Alignment, builder: *Builder) void {
            self.ptr(builder).alignment = alignment;
        }

        pub fn setSubprogram(self: Index, subprogram: Metadata, builder: *Builder) void {
            self.ptrConst(builder).global.setDebugMetadata(subprogram, builder);
        }

        pub fn getSubprogram(self: Index, builder: *const Builder) Metadata.Optional {
            return self.ptrConst(builder).global.getDebugMetadata(builder);
        }
    }